Whamcloud - gitweb
LU-1538 tests: standardize test script init – failover 58/36358/3
authorJames Nunez <jnunez@whamcloud.com>
Thu, 3 Oct 2019 13:58:11 +0000 (07:58 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 28 Jan 2020 06:03:17 +0000 (06:03 +0000)
Standardize the initial Lustre test script initialization for
clarity and consistency for recovery and replay tests in the
failover test group.

The LUSTRE path is already normalized in init_test_env(), so this
doesn't need to be done in the caller.  Use $(...) subshells instead
of `...` in the affected lines.  Remove NAME, SRCDIR, PATH, MULTIOP,
SETUP, CLEANUP, CHECKSTAT, TMP, SAVE_PWD, variable initialization,
since it is already done in init_test_env() or not needed in the test
scripts.

Move all definitions of ALWAYS_EXCEPT and SLOW to after
init_test_env() and init_logging() and call build_test_filter()
immediately after the ALWAYS_EXCEPT and SLOW definitions.

Test-Parameters: trivial
Test-Parameters: envdefinitions=SLOW=no testgroup=failover
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I6484130e70a738c2fc4962afe2b814b39ea5ed77
Reviewed-on: https://review.whamcloud.com/36358
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
lustre/tests/recovery-double-scale.sh
lustre/tests/recovery-mds-scale.sh
lustre/tests/recovery-random-scale.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-single-lmv.sh
lustre/tests/replay-vbr.sh
lustre/tests/rpc.sh

index 2f4b81d..57dc0b2 100644 (file)
@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
-
+#
 # All pairwise combinations of node failures.
 # Was cmd3-17
 #
 # All pairwise combinations of node failures.
 # Was cmd3-17
 #
@@ -13,15 +12,16 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
 
 ONLY=${ONLY:-"$*"}
 
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+init_logging
+
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_DOUBLE_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_DOUBLE_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-. $LUSTRE/tests/test-framework.sh
-init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-init_logging
+build_test_filter
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
@@ -203,8 +203,6 @@ Status: $result: rc=$rc"
 }
 
 ################################## Main Flow ###################################
 }
 
 ################################## Main Flow ###################################
-build_test_filter
-
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
index a58b97a..134f285 100644 (file)
@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
-
+#
 # Was Test 11 in cmd3.
 # For duration of 24 hours repeatedly failover a random MDS at
 # 10 minute intervals and verify that no application errors occur.
 # Was Test 11 in cmd3.
 # For duration of 24 hours repeatedly failover a random MDS at
 # 10 minute intervals and verify that no application errors occur.
@@ -10,15 +9,16 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
 
 ONLY=${ONLY:-"$*"}
 
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+init_logging
+
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_MDS_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_MDS_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-. $LUSTRE/tests/test-framework.sh
-init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-init_logging
+build_test_filter
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
@@ -211,8 +211,6 @@ bug 20918"
 }
 
 ################################## Main Flow ###################################
 }
 
 ################################## Main Flow ###################################
-build_test_filter
-
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
index 23f6ee5..dc4c3ae 100644 (file)
@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
-
+#
 # client failure does not affect other clients
 
 # Start load on clients (each client works on it's own directory).
 # client failure does not affect other clients
 
 # Start load on clients (each client works on it's own directory).
@@ -14,15 +13,16 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
 
 ONLY=${ONLY:-"$*"}
 
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+init_logging
+
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_RANDOM_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 # bug number for skipped test:
 ALWAYS_EXCEPT="$RECOVERY_RANDOM_SCALE_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-. $LUSTRE/tests/test-framework.sh
-init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-init_logging
+build_test_filter
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
 
 remote_mds_nodsh && skip_env "remote MDS with nodsh" && exit 0
 remote_ost_nodsh && skip_env "remote OST with nodsh" && exit 0
@@ -111,8 +111,6 @@ Status: $result: rc=$rc"
 }
 
 ################################## Main Flow ###################################
 }
 
 ################################## Main Flow ###################################
-build_test_filter
-
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
 check_and_setup_lustre
 rm -rf $DIR/[Rdfs][0-9]*
 
index 2114600..ea5df4e 100755 (executable)
@@ -2,43 +2,40 @@
 
 set -e
 
 
 set -e
 
-# bug number:  LU-2012 LU-8333 LU-7372
-ALWAYS_EXCEPT="14b     21b     26      $REPLAY_DUAL_EXCEPT"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-SAVE_PWD=$PWD
 PTLDEBUG=${PTLDEBUG:--1}
 PTLDEBUG=${PTLDEBUG:--1}
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-SETUP=${SETUP:-""}
-CLEANUP=${CLEANUP:-""}
 MOUNT_2=${MOUNT_2:-"yes"}
 MOUNT_2=${MOUNT_2:-"yes"}
-export MULTIOP=${MULTIOP:-multiop}
-. $LUSTRE/tests/test-framework.sh
 
 
+LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+. $LUSTRE/tests/test-framework.sh
 init_test_env $@
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
 
 init_logging
 
 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
 
-#                                   7  (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="21b"
+ALWAYS_EXCEPT="$REPLAY_DUAL_EXCEPT "
+# bug number for skipped test:  LU-2012 LU-8333 LU-7372
+ALWAYS_EXCEPT+="                14b     21b     26 "
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 [[ "$mds1_FSTYPE" == zfs ]] &&
 
 [[ "$mds1_FSTYPE" == zfs ]] &&
-# bug number for skipped test:       LU-2230
+# bug number for skipped test:        LU-2230
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21b"
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21b"
+
 if $SHARED_KEY; then
 if $SHARED_KEY; then
-# bug number for skipped tests:        LU-9795 LU-9795
-       ALWAYS_EXCEPT="         0a      0b      $ALWAYS_EXCEPT"
+# bug number for skipped tests:  LU-9795 LU-9795
+       ALWAYS_EXCEPT+="         0a      0b "
 fi
 
 fi
 
-build_test_filter
+#                                   7  (min)"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="21b "
 
 
+build_test_filter
 check_and_setup_lustre
 check_and_setup_lustre
+
 MOUNTED=$(mounted_lustre_filesystems)
 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT2' '); then
 MOUNTED=$(mounted_lustre_filesystems)
 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT2' '); then
-    zconf_mount $HOSTNAME $MOUNT2
-    MOUNTED2=yes
+       zconf_mount $HOSTNAME $MOUNT2
+       MOUNTED2=yes
 fi
 
 assert_DIR
 fi
 
 assert_DIR
index 21dd7ca..63ec67a 100755 (executable)
@@ -1,34 +1,27 @@
 #!/bin/bash
 
 set -e
 #!/bin/bash
 
 set -e
-#set -v
 
 
-#
-# This test needs to be run on the client
-#
-
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/lmv.sh}
-
 
 
-# Skip these tests
-ALWAYS_EXCEPT=""
+# bug number for skipped test:
+ALWAYS_EXCEPT="REPLAY_SINGLE_LMV_EXCEPT "
 build_test_filter
 
 SETUP=${SETUP:-"setup"}
 CLEANUP=${CLEANUP:-"stopall"}
 
 if [ "$ONLY" == "cleanup" ]; then
 build_test_filter
 
 SETUP=${SETUP:-"setup"}
 CLEANUP=${CLEANUP:-"stopall"}
 
 if [ "$ONLY" == "cleanup" ]; then
-    lctl set_param debug=0 || true
-    $CLEANUP
-    exit 0
+       lctl set_param debug=0 || true
+       $CLEANUP
+       exit 0
 fi
 
 setup() {
 fi
 
 setup() {
-    formatall
-    setupall
+       formatall
+       setupall
 }
 
 $SETUP
 }
 
 $SETUP
index f641498..1994aaa 100755 (executable)
@@ -1,27 +1,20 @@
 #!/bin/bash
 #!/bin/bash
-# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
 
 set -e
 
 
 set -e
 
-# bug number:
-ALWAYS_EXCEPT=" $REPLAY_VBR_EXCEPT"
-
-SAVE_PWD=$PWD
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-SETUP=${SETUP:-}
-CLEANUP=${CLEANUP:-}
 MOUNT_2=${MOUNT_2:-"yes"}
 MOUNT_2=${MOUNT_2:-"yes"}
-export MULTIOP=${MULTIOP:-multiop}
+
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
 
 init_logging
 
 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
 
+ALWAYS_EXCEPT=" $REPLAY_VBR_EXCEPT"
+
 #                                  ~6  (min)"
 #                                  ~6  (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="7"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="7 "
 
 build_test_filter
 
 
 build_test_filter
 
index a5831c8..ec7533c 100755 (executable)
@@ -1,16 +1,13 @@
 #!/bin/bash
 #!/bin/bash
-export PATH=`dirname $0`/../utils:$PATH
-NAME=${NAME:-local}
 
 
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 
 if [ ! -f $LUSTRE/tests/rpc.sh ]; then
 
 if [ ! -f $LUSTRE/tests/rpc.sh ]; then
-    LUSTRE=$(cd $(dirname $(which $0))/..; echo $PWD)
+       LUSTRE=$(cd $(dirname $(which $0))/..; echo $PWD)
 fi
 
 . $LUSTRE/tests/test-framework.sh
 RPC_MODE=true init_test_env
 fi
 
 . $LUSTRE/tests/test-framework.sh
 RPC_MODE=true init_test_env
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
 # Reset the trap on ERR set by the framework.  Noticing this failure is the
 # framework's job.
 
 # Reset the trap on ERR set by the framework.  Noticing this failure is the
 # framework's job.