]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: Fix skipping over comment lines in zpool_create.shlib
authorUmer Saleem <usaleem@ixsystems.com>
Fri, 20 Sep 2024 18:06:19 +0000 (23:06 +0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 21 Sep 2024 17:29:20 +0000 (10:29 -0700)
In zpool_create.shlib, check_feature_set iterates over all features
mentioned in provided compatibility file to check if only those
features are enabled on the pool.

This commit fixes skipping over comment lines correctly. Otherwise,
the test case fails as comment lines are also treated as feature names
by check_feature_set function.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15909

tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib

index 4987bc3a9dacd8e75f21a097092f40f8c407f305..765be8ac0dd1ff4b737b3ea6f44e41339f99a421 100644 (file)
@@ -119,9 +119,8 @@ function check_feature_set
        while read line; do
                typeset flag=1
 
-               if [[ "$line" == "#*" ]]; then
-                       continue
-               fi
+               # Skip comments
+               [[ $line = \#* ]] && continue
 
                for set in "$@"; do
                        if ! grep -q "$line" $ZPOOL_COMPAT_DIR/$set; then