From 45a1d46af9d4b2fa1f0bb7f3bc82e10c2fa1a9a1 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. Signed-off-by: Umer Saleem --- .../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 4987bc3a9dac..765be8ac0dd1 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