Whamcloud - gitweb
LU-15571 tests: save/restore debug mask for interop 36/46636/5
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 26 Feb 2022 03:17:21 +0000 (20:17 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 27 Mar 2022 03:54:41 +0000 (03:54 +0000)
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 <adilger@whamcloud.com>
Change-Id: I36fc06d5a62e34d63619fa977d9f80254bbc073e
Reviewed-on: https://review.whamcloud.com/46636
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/ost-pools.sh
lustre/tests/test-framework.sh

index a01532d..17bebb5 100755 (executable)
@@ -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() {
index 25eb353..b0a4a12 100755 (executable)
@@ -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
 }