From 46df972341a918c8c0796ac0c191ec43bf9768b2 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Wed, 2 Oct 2019 14:42:24 -0600 Subject: [PATCH] =?utf8?q?LU-1538=20tests:=20standardize=20test=20script?= =?utf8?q?=20init=20=E2=80=93=20parallel-scale?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Standardize the initial Lustre test script initialization for clarity and consistency for all parallel-scale tests. 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=yes,ENABLE_QUOTA=yes clientdistro=el7.8 clientcount=2 osscount=1 ostcount=7 mdscount=1 mdtcount=1 austeroptions=-R testlist=parallel-scale-nfsv4 Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes clientdistro=el7.8 clientcount=2 osscount=1 ostcount=7 mdscount=1 mdtcount=1 austeroptions=-R testlist=parallel-scale,parallel-scale-nfsv3 Signed-off-by: James Nunez Change-Id: I5690f17033ca92e5578c579e81cbcc024ca7f770 Reviewed-on: https://review.whamcloud.com/36355 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Wei Liu Reviewed-by: Oleg Drokin --- lustre/tests/parallel-scale-cifs.sh | 4 ++-- lustre/tests/parallel-scale-nfs.sh | 11 ++++++----- lustre/tests/parallel-scale-nfsv3.sh | 4 +--- lustre/tests/parallel-scale-nfsv4.sh | 4 +--- lustre/tests/parallel-scale.sh | 16 +++++++--------- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/lustre/tests/parallel-scale-cifs.sh b/lustre/tests/parallel-scale-cifs.sh index 4eaf97a..a569908 100644 --- a/lustre/tests/parallel-scale-cifs.sh +++ b/lustre/tests/parallel-scale-cifs.sh @@ -13,11 +13,11 @@ #set -vx -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging + . $LUSTRE/tests/setup-cifs.sh check_and_setup_lustre diff --git a/lustre/tests/parallel-scale-nfs.sh b/lustre/tests/parallel-scale-nfs.sh index 1d27a08..7f426ee 100755 --- a/lustre/tests/parallel-scale-nfs.sh +++ b/lustre/tests/parallel-scale-nfs.sh @@ -1,15 +1,17 @@ #!/bin/bash -# -#set -vx NFSVERSION=${1:-"3"} -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} + +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh # only call init_test_env if this script is called directly if [[ -z "$TESTSUITE" || "$TESTSUITE" = "$(basename $0 .sh)" ]]; then init_test_env $@ +else + . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} + fi -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} + init_logging racer=$LUSTRE/tests/racer/racer.sh @@ -69,7 +71,6 @@ NFSCLIENT=true FAIL_ON_ERROR=false # common setup -MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} clients=${NFS_CLIENTS:-$HOSTNAME} generate_machine_file $clients $MACHINEFILE || error "Failed to generate machine file" diff --git a/lustre/tests/parallel-scale-nfsv3.sh b/lustre/tests/parallel-scale-nfsv3.sh index f75327c..014d2cd 100755 --- a/lustre/tests/parallel-scale-nfsv3.sh +++ b/lustre/tests/parallel-scale-nfsv3.sh @@ -1,8 +1,6 @@ #!/bin/bash -# -#set -vx -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ diff --git a/lustre/tests/parallel-scale-nfsv4.sh b/lustre/tests/parallel-scale-nfsv4.sh index e0a5fc4..14ee9d6 100755 --- a/lustre/tests/parallel-scale-nfsv4.sh +++ b/lustre/tests/parallel-scale-nfsv4.sh @@ -1,8 +1,6 @@ #!/bin/bash -# -#set -vx -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ diff --git a/lustre/tests/parallel-scale.sh b/lustre/tests/parallel-scale.sh index b7d9a82..c82a302 100644 --- a/lustre/tests/parallel-scale.sh +++ b/lustre/tests/parallel-scale.sh @@ -1,15 +1,13 @@ #!/bin/bash -# -#set -vx -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -# bug number for skipped test: LU-9429 - ALWAYS_EXCEPT=" parallel_grouplock $PARALLEL_SCALE_EXCEPT " +ALWAYS_EXCEPT="$PARALLEL_SCALE_EXCEPT " +# bug number for skipped test: LU-9429 +ALWAYS_EXCEPT+=" parallel_grouplock " if [ "$mds1_FSTYPE" = zfs -o "$ost1_FSTYPE" = zfs ]; then ZFSSLOW=$SLOW @@ -22,11 +20,12 @@ if [ "$mds1_FSTYPE" = zfs -o "$ost1_FSTYPE" = zfs ]; then statahead_NUMFILES=${statahead_NUMFILES:-100000} fi +build_test_filter + # common setup -MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} clients=${CLIENTS:-$HOSTNAME} generate_machine_file $clients $MACHINEFILE || - error "Failed to generate machine file" + error "Failed to generate machine file" num_clients=$(get_node_count ${clients//,/ }) # compilbench @@ -67,7 +66,6 @@ fi . $LUSTRE/tests/functions.sh -build_test_filter check_and_setup_lustre get_mpiuser_id $MPI_USER -- 1.8.3.1