From: Andreas Dilger Date: Sat, 26 Feb 2022 03:17:21 +0000 (-0700) Subject: LU-15571 tests: save/restore debug mask for interop X-Git-Tag: 2.15.0-RC3~23 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f236119e6e264b00c20533336303f694d9cfe766;p=fs%2Flustre-release.git LU-15571 tests: save/restore debug mask for interop The "createmany" and "unlinkmany" wrappers were saving the debug mask on the client and restoring it on the server, which fails in interop testing if the client has a debug mask set that is unknown on the server. Use the debugsave() and debugrestore() helpers to do this properly. Fixes: 40d286e11138 ("LU-15317 llite: Add D_IOTRACE") Signed-off-by: Andreas Dilger Change-Id: I36fc06d5a62e34d63619fa977d9f80254bbc073e Reviewed-on: https://review.whamcloud.com/46636 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index a01532d..17bebb5 100755 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -990,20 +990,20 @@ test_17() { run_test 17 "Referencing an empty pool" create_perf() { - local cdir=$1/d - local numsec=$2 - local time - - mkdir -p $cdir - sync - wait_delete_completed >/dev/null # give pending IO a chance to go to disk - stat=$(createmany -o $cdir/${tfile} -$numsec | tail -1) - files=$(echo $stat | cut -f 2 -d ' ') - echo $stat 1>&2 - unlinkmany $cdir/${tfile} $files > /dev/null - sync - - echo $files + local cdir=$1/d + local numsec=$2 + local time + + mkdir -p $cdir + sync + wait_delete_completed >/dev/null # give pending IO chance to go to disk + stat=$(createmany -o $cdir/${tfile} -t $numsec | tail -1) + files=$(echo $stat | cut -f 2 -d ' ') + echo $stat 1>&2 + unlinkmany $cdir/${tfile} $files > /dev/null + sync + + echo $files } test_18() { diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 25eb353..b0a4a12 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -10577,33 +10577,31 @@ statx_supported() { # function createmany() { local count=${!#} + local rc - (( count > 100 )) && { - local saved_debug=$($LCTL get_param -n debug) - local list=$(comma_list $(all_nodes)) - - do_nodes $list $LCTL set_param -n debug=0 - } + if (( count > 100 )); then + debugsave + do_nodes $(comma_list $(all_nodes)) $LCTL set_param -n debug=0 + fi $LUSTRE/tests/createmany $* - local rc=$? - (( count > 100 )) && - do_nodes $list "$LCTL set_param -n debug=\\\"$saved_debug\\\"" + rc=$? + debugrestore + return $rc } function unlinkmany() { local count=${!#} + local rc - (( count > 100 )) && { - local saved_debug=$($LCTL get_param -n debug) - local list=$(comma_list $(all_nodes)) - - do_nodes $list $LCTL set_param -n debug=0 - } + if (( count > 100 )); then + debugsave + do_nodes $(comma_list $(all_nodes)) $LCTL set_param -n debug=0 + fi $LUSTRE/tests/unlinkmany $* - local rc=$? - (( count > 100 )) && - do_nodes $list "$LCTL set_param -n debug=\\\"$saved_debug\\\"" + rc=$? + debugrestore + return $rc }