From: James Nunez Date: Thu, 3 Oct 2019 13:58:11 +0000 (-0600) Subject: LU-1538 tests: standardize test script init – failover X-Git-Tag: 2.13.52~58 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5290c48735290a0920d804daa7f428bb0df655c2 LU-1538 tests: standardize test script init – failover 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 Change-Id: I6484130e70a738c2fc4962afe2b814b39ea5ed77 Reviewed-on: https://review.whamcloud.com/36358 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Emoly Liu --- diff --git a/lustre/tests/recovery-double-scale.sh b/lustre/tests/recovery-double-scale.sh index 2f4b81d..57dc0b2 100644 --- a/lustre/tests/recovery-double-scale.sh +++ b/lustre/tests/recovery-double-scale.sh @@ -1,6 +1,5 @@ #!/bin/bash -# vim:shiftwidth=4:softtabstop=4:tabstop=4: - +# # All pairwise combinations of node failures. # Was cmd3-17 # @@ -13,15 +12,16 @@ set -e 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! -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 @@ -203,8 +203,6 @@ Status: $result: rc=$rc" } ################################## Main Flow ################################### -build_test_filter - check_and_setup_lustre rm -rf $DIR/[Rdfs][0-9]* diff --git a/lustre/tests/recovery-mds-scale.sh b/lustre/tests/recovery-mds-scale.sh index a58b97a..134f285 100644 --- a/lustre/tests/recovery-mds-scale.sh +++ b/lustre/tests/recovery-mds-scale.sh @@ -1,6 +1,5 @@ #!/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. @@ -10,15 +9,16 @@ set -e 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! -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 @@ -211,8 +211,6 @@ bug 20918" } ################################## Main Flow ################################### -build_test_filter - check_and_setup_lustre rm -rf $DIR/[Rdfs][0-9]* diff --git a/lustre/tests/recovery-random-scale.sh b/lustre/tests/recovery-random-scale.sh index 23f6ee5..dc4c3ae 100644 --- a/lustre/tests/recovery-random-scale.sh +++ b/lustre/tests/recovery-random-scale.sh @@ -1,6 +1,5 @@ #!/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). @@ -14,15 +13,16 @@ set -e 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! -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 @@ -111,8 +111,6 @@ Status: $result: rc=$rc" } ################################## Main Flow ################################### -build_test_filter - check_and_setup_lustre rm -rf $DIR/[Rdfs][0-9]* diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 2114600..ea5df4e 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -2,43 +2,40 @@ 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} -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} -SETUP=${SETUP:-""} -CLEANUP=${CLEANUP:-""} 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 $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} 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 ]] && -# bug number for skipped test: LU-2230 +# bug number for skipped test: LU-2230 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21b" + 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 -build_test_filter +# 7 (min)" +[ "$SLOW" = "no" ] && EXCEPT_SLOW="21b " +build_test_filter check_and_setup_lustre + 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 diff --git a/lustre/tests/replay-single-lmv.sh b/lustre/tests/replay-single-lmv.sh index 21dd7ca..63ec67a 100755 --- a/lustre/tests/replay-single-lmv.sh +++ b/lustre/tests/replay-single-lmv.sh @@ -1,34 +1,27 @@ #!/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 $@ -. ${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 - lctl set_param debug=0 || true - $CLEANUP - exit 0 + lctl set_param debug=0 || true + $CLEANUP + exit 0 fi setup() { - formatall - setupall + formatall + setupall } $SETUP diff --git a/lustre/tests/replay-vbr.sh b/lustre/tests/replay-vbr.sh index f641498..1994aaa 100755 --- a/lustre/tests/replay-vbr.sh +++ b/lustre/tests/replay-vbr.sh @@ -1,27 +1,20 @@ #!/bin/bash -# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- -# vim:shiftwidth=4:softtabstop=4:tabstop=4: 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"} -export MULTIOP=${MULTIOP:-multiop} + +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $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 +ALWAYS_EXCEPT=" $REPLAY_VBR_EXCEPT" + # ~6 (min)" -[ "$SLOW" = "no" ] && EXCEPT_SLOW="7" +[ "$SLOW" = "no" ] && EXCEPT_SLOW="7 " build_test_filter diff --git a/lustre/tests/rpc.sh b/lustre/tests/rpc.sh index a5831c8..ec7533c 100755 --- a/lustre/tests/rpc.sh +++ b/lustre/tests/rpc.sh @@ -1,16 +1,13 @@ #!/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 - 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 -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} # Reset the trap on ERR set by the framework. Noticing this failure is the # framework's job.