From 47240ee5e60161662035fc730f6f0ecc961e3185 Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Thu, 9 Dec 2021 21:17:14 +0300 Subject: [PATCH] LU-15334 tests: cleanup conf-sanity test_30a 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 Change-Id: I970d8422ba8ba75aca922d8ac6bac09c7cfcd67d Reviewed-on: https://review.whamcloud.com/45811 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alexander Zarochentsev --- lustre/tests/conf-sanity.sh | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 0a07e92..4e0416e0 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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 $?" } -- 1.8.3.1