test: fix and add stub test for zfs-with-vdevs

This commit is contained in:
dylan madisetti committed 2024-08-05 12:11:35 -04:00
1 parent f484389085
commit 8d071db09b
4 files changed
+34 -14

No files matched your search

+3 -5
View File
@@ -150,9 +150,9 @@ in
topology=""
# For shell check
mode="${config.mode}"
if [ $mode != "prescribed" ]; then
${if hasTopology then
''topology="${config.mode} \"''${zfs_devices}\""''
if [ "$mode" != "prescribed" ]; then
${if !hasTopology then
''topology="${config.mode} ''${zfs_devices[*]}"''
else
''
echo "topology cannot be set when mode != 'prescribed', skipping creating zpool ${config.name}" >&2
@@ -174,7 +174,6 @@ in
devs=''${line#*=}
IFS=' ' read -r -a devices <<< "$devs"
all_devices+=("''${devices[@]}")
# shellcheck disable=SC2089
topology+=" ''${mode} ''${devices[*]}"
done
# all_devices sorted should equal zfs_devices sorted
@@ -188,7 +187,6 @@ in
fi
fi
if [ $continue -eq 1 ]; then
# shellcheck disable=SC2090
zpool create -f ${config.name} \
-R ${rootMountPoint} \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \