From e2bded28ea17211a3e8e55c4376f329f66a3d782 Mon Sep 17 00:00:00 2001 From: Umer Saleem Date: Fri, 20 Sep 2024 23:06:19 +0500 Subject: [PATCH] ZTS: Fix skipping over comment lines in zpool_create.shlib 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 Reviewed-by: Alexander Motin Signed-off-by: Umer Saleem Closes #15909 --- .../functional/cli_root/zpool_create/zpool_create.shlib | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib index 4987bc3a9..765be8ac0 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.shlib @@ -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