Whamcloud - gitweb
EX-7509 tests: enable neterror logging in sanity-benchmark/iozone
authorJian Yu <yujian@whamcloud.com>
Wed, 28 Jun 2023 09:36:19 +0000 (17:36 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Jul 2023 10:03:38 +0000 (10:03 +0000)
This patch enables LNet error logging in sanity-benchmark test_iozone()
to gather network errors while connection issue occurs.

Test-Parameters: trivial env=SLOW=yes,ENABLE_QUOTA=yes \
 clientdistro=el8.6 serverdistro=el7.9 testlist=sanity-benchmark

Change-Id: I398779abc95525fe5579fc7505e6e6221c32bf90
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51483
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-benchmark.sh
lustre/tests/test-framework.sh

index 9fade96..36f482b 100644 (file)
@@ -103,7 +103,7 @@ test_iozone() {
     fi
 
     export O_DIRECT
-    
+
     local IOZDIR=$DIR/d0.iozone
     wait_delete_completed || true
     mkdir -p $IOZDIR
@@ -117,20 +117,25 @@ test_iozone() {
     IOZFILE="$IOZDIR/iozone"
     IOZLOG=$TMP/iozone.log
                # $SPACE was calculated with all OSTs
-    $DEBUG_OFF
-    myUID=$RUNAS_ID
-    myGID=$RUNAS_GID
-    myRUNAS=$RUNAS
-    FAIL_ON_ERROR=false check_runas_id_ret $myUID $myGID $myRUNAS || \
-        { myRUNAS="" && myUID=$UID && myGID=`id -g $USER`; }
-    chown $myUID:$myGID $IOZDIR
-    $myRUNAS iozone $IOZONE_OPTS -s $SIZE -f $IOZFILE 2>&1 | tee $IOZLOG
-    tail -1 $IOZLOG | grep -q complete || \
-       { error "iozone (1) failed" && return 1; }
-    rm -f $IOZLOG
-    wait_delete_completed || true
-    $DEBUG_ON
-    
+
+       $DEBUG_OFF
+       printksave
+       do_nodes $(comma_list $(all_nodes)) \
+               $LCTL set_param -n debug=+neterror printk=+neterror
+       myUID=$RUNAS_ID
+       myGID=$RUNAS_GID
+       myRUNAS=$RUNAS
+       FAIL_ON_ERROR=false check_runas_id_ret $myUID $myGID $myRUNAS ||
+               { myRUNAS="" && myUID=$UID && myGID=`id -g $USER`; }
+       chown $myUID:$myGID $IOZDIR
+       $myRUNAS iozone $IOZONE_OPTS -s $SIZE -f $IOZFILE 2>&1 | tee $IOZLOG
+       tail -1 $IOZLOG | grep -q complete ||
+               { error "iozone (1) failed" && return 1; }
+       rm -f $IOZLOG
+       wait_delete_completed || true
+       printkrestore
+       $DEBUG_ON
+
     # check if O_DIRECT support is implemented in kernel
     if [ -z "$O_DIRECT" ]; then
        touch $DIR/f.iozone
index b87eddc..862f305 100755 (executable)
@@ -6237,6 +6237,24 @@ pgcache_empty() {
     return 0
 }
 
+printksave() {
+       PRINTKSAVE="$($LCTL get_param -n printk)"
+       PRINTKSAVE_SERVER=$(do_facet $SINGLEMDS "$LCTL get_param -n printk")
+}
+
+printkrestore() {
+       [[ -n "$PRINTKSAVE" ]] &&
+               do_nodes $CLIENTS "$LCTL set_param printk=\\\"${PRINTKSAVE}\\\""||
+               true
+       PRINTKSAVE=""
+
+       [[ -n "$PRINTKSAVE_SERVER" ]] &&
+               do_nodes $(comma_list $(all_server_nodes)) \
+                        "$LCTL set_param printk=\\\"${PRINTKSAVE_SERVER}\\\"" ||
+                        true
+       PRINTKSAVE_SERVER=""
+}
+
 debugsave() {
        DEBUGSAVE="$(lctl get_param -n debug)"
        DEBUGSAVE_SERVER=$(do_facet $SINGLEMDS "$LCTL get_param -n debug")