Whamcloud - gitweb
LU-15334 tests: cleanup conf-sanity test_30a 11/45811/2
authorElena Gryaznova <elena.gryaznova@hpe.com>
Thu, 9 Dec 2021 18:17:14 +0000 (21:17 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 7 Feb 2022 04:43:05 +0000 (04:43 +0000)
Fix typo: use error() instead of not existing fail(),
localize some variables.

Fixes: 5e546603cb ("b=15253 add conf_param -d to remove permanent settings")
Test-Parameters: trivial testlist=conf-sanity env=ONLY=30a
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Change-Id: I970d8422ba8ba75aca922d8ac6bac09c7cfcd67d
Reviewed-on: https://review.whamcloud.com/45811
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
lustre/tests/conf-sanity.sh

index 0a07e92..4e0416e 100644 (file)
@@ -1253,37 +1253,42 @@ test_30a() {
        setup_noconfig
 
        echo Big config llog
-       TEST="llite.$FSNAME-*.max_read_ahead_whole_mb"
-       ORIG=$($LCTL get_param -n $TEST)
-       LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
-       for i in ${LIST[@]}; do
-               set_persistent_param_and_check client "$TEST" \
-                       "$FSNAME.llite.max_read_ahead_whole_mb" $i
+       local path="llite.$FSNAME-*"
+       local cpath="$FSNAME.llite"
+       local param="max_read_ahead_whole_mb"
+
+       local test="${path}.$param"
+       local conf="${cpath}.$param"
+
+       local orig=$($LCTL get_param -n $test)
+       local list=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
+       for i in ${list[@]}; do
+               set_persistent_param_and_check client $test $conf $i
        done
        # make sure client restart still works
        umount_client $MOUNT
        mount_client $MOUNT || error "mount_client $MOUNT failed"
-       [ "$($LCTL get_param -n $TEST)" -ne "$i" ] &&
-               error "Param didn't stick across restart $($TEST) != $i"
+       [ "$($LCTL get_param -n $test)" -ne "$i" ] &&
+               error "Param didn't stick across restart $($test) != $i"
        pass
 
        echo Erase parameter setting
        if [[ $PERM_CMD == *"set_param -P"* ]]; then
-               do_facet mgs "$PERM_CMD -d $TEST" ||
-                       error "Erase param $TEST failed"
+               do_facet mgs "$PERM_CMD -d $test" ||
+                       error "Erase param $test failed"
        else
-               do_facet mgs "$PERM_CMD \
-                             -d $FSNAME.llite.max_read_ahead_whole_mb" ||
-                       error "Erase param $FSNAME.llite.max_read_ahead_whole_mb failed"
+               do_facet mgs "$PERM_CMD -d $conf" ||
+                       error "Erase param $conf failed"
        fi
        umount_client $MOUNT
        mount_client $MOUNT || error "mount_client $MOUNT failed"
-       FINAL=$($LCTL get_param -n $TEST)
-       echo "deleted (default) value=$FINAL, orig=$ORIG"
-       ORIG=${ORIG%%.[0-9]*}
-       FINAL=${FINAL%%.[0-9]*}
+       local final=$($LCTL get_param -n $test)
+       echo "deleted (default) value=$final, orig=$orig"
+       orig=${orig%%.[0-9]*}
+       final=${final%%.[0-9]*}
        # assumes this parameter started at the default value
-       [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
+       [ "$final" -eq "$orig" ] ||
+               error "Deleted value=$final -ne orig=$orig"
 
        cleanup || error "cleanup failed with rc $?"
 }