Whamcloud - gitweb
LU-16943 tests: fix replay-single/135 under hard failure mode
authorJian Yu <yujian@whamcloud.com>
Fri, 14 Jul 2023 06:22:25 +0000 (14:22 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 16 Jul 2023 23:09:55 +0000 (23:09 +0000)
This patch fixes replay-single test_135() to load libcfs module
on the failover partner node to avoid 'fail_val' setting error.
It also fixes the issue that not all of the OSTs are mounted after
failing back ost1.

Lustre-change: https://review.whamcloud.com/51574
Lustre-commit: TBD (from 1b73b6465b77744992bb1f6d782362bf0cf7f409)

Test-Parameters: trivial testlist=replay-single

Test-Parameters: trivial env=FAILURE_MODE=HARD \
    clientcount=4 mdtcount=1 mdscount=2 osscount=2 \
    austeroptions=-R failover=true iscsi=1 \
    testlist=replay-single

Change-Id: Id46c722a6db9d832829a739f41f7462b32a6d9d9
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51607
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Deiter <alex.deiter@gmail.com>
lustre/tests/replay-single.sh
lustre/tests/test-framework.sh

index 73dce59..ec26b25 100755 (executable)
@@ -4991,6 +4991,8 @@ test_135() {
 
        #define OBD_FAIL_TGT_REPLAY_RECONNECT     0x32d
        # Make sure lock replay server side never completes and errors out.
+       do_rpc_nodes $(facet_active_host ost1) \
+               load_module ../libcfs/libcfs/libcfs
        do_facet ost1 "$LCTL set_param fail_val=20"
        do_facet ost1 "$LCTL set_param fail_loc=0x32d"
 
@@ -5007,8 +5009,13 @@ test_135() {
        change_active ost1
        wait_for_facet ost1
 
+       do_rpc_nodes $(facet_active_host ost1) \
+               load_module ../libcfs/libcfs/libcfs
        do_facet ost1 "$LCTL set_param fail_loc=0"
        mount_facet ost1
+       unmountoss
+       mountoss
+       clients_up || clients_up || error "$LFS df $MOUNT failed"
        echo blah > $DIR/$tdir/file.test2
 
        rm -rf $DIR/$tdir
index a0c7912..99de900 100755 (executable)
@@ -5057,6 +5057,15 @@ mountmds() {
        done
 }
 
+unmountoss() {
+       local num
+
+       for num in $(seq $OSTCOUNT); do
+               stop ost$num -f
+               rm -f $TMP/ost${num}active
+       done
+}
+
 mountoss() {
        local num
        local devname