From 887baafe7aed204014634368783e31484c2365e5 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 17 Jun 2019 14:59:39 -0600 Subject: [PATCH] LU-1538 tests: standardize test script init - lnet Standardize the initial Lustre test script initialization for clarity and consistency. 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, PATH, SAVE_PWD, RLUSTRE, MULTIOP variable initialization, since it is already done in init_test_env() or not needed in the test script. 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: testgroup=review-dne-zfs-part-3 Signed-off-by: James Nunez Change-Id: I491cf3e282a1f31fb8c87440554445d708c6da1e Reviewed-on: https://review.whamcloud.com/35254 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Wei Liu Reviewed-by: Oleg Drokin --- lustre/tests/conf-sanity.sh | 55 +++++++++++++++++-------------------------- lustre/tests/lnet-selftest.sh | 9 +++---- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 860cefb..cafcadc 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -4,32 +4,38 @@ set -e ONLY=${ONLY:-"$*"} -# bug number for skipped test: -ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT" +SRCDIR=$(dirname $0) +PTLDEBUG=${PTLDEBUG:--1} +LUSTRE=${LUSTRE:-$(dirname $0)/..} +. $LUSTRE/tests/test-framework.sh +init_test_env $@ +init_logging + +# tool to create lustre filesystem images +ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 32newtarball" + +# bug number for skipped test: LU-11915 +ALWAYS_EXCEPT="$ALWAYS_EXCEPT 110" # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! -# bug number for skipped test: -# a tool to create lustre filesystem images -ALWAYS_EXCEPT="32newtarball $ALWAYS_EXCEPT" if $SHARED_KEY; then -# bug number for skipped tests: LU-9795 (all below) + # bug number for skipped tests: LU-9795 (all below) ALWAYS_EXCEPT="$ALWAYS_EXCEPT 0 31 32a 32d 35a" ALWAYS_EXCEPT="$ALWAYS_EXCEPT 53a 53b 54b 76a 76b" ALWAYS_EXCEPT="$ALWAYS_EXCEPT 76c 76d 78 103" fi -SRCDIR=$(dirname $0) -PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH +if ! combined_mgs_mds; then + # bug number for skipped test: LU-11991 LU-11990 + ALWAYS_EXCEPT="$ALWAYS_EXCEPT 32a 32b 32c 32d 32e 66" + # bug number for skipped test: LU-9897 LU-12032 + ALWAYS_EXCEPT="$ALWAYS_EXCEPT 84 123F" +fi -PTLDEBUG=${PTLDEBUG:--1} -SAVE_PWD=$PWD -LUSTRE=${LUSTRE:-$(dirname $0)/..} -RLUSTRE=${RLUSTRE:-$LUSTRE} -export MULTIOP=${MULTIOP:-multiop} +# 8 22 40 165 (min) +[ "$SLOW" = "no" ] && EXCEPT_SLOW="45 69 106 111" -. $LUSTRE/tests/test-framework.sh -init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} +build_test_filter # use small MDS + OST size to speed formatting time # do not use too small MDSSIZE/OSTSIZE, which affect the default journal size @@ -49,30 +55,15 @@ MDSDEV1_2=$fs2mds_DEV OSTDEV1_2=$fs2ost_DEV OSTDEV2_2=$fs3ost_DEV -# bug number for skipped test: LU-11915 -ALWAYS_EXCEPT="$ALWAYS_EXCEPT 110" - -if ! combined_mgs_mds; then - # bug number for skipped test: LU-11991 LU-11990 - ALWAYS_EXCEPT="$ALWAYS_EXCEPT 32a 32b 32c 32d 32e 66" - # bug number for skipped test: LU-9897 LU-12032 - ALWAYS_EXCEPT="$ALWAYS_EXCEPT 84 123F" -fi - # pass "-E lazy_itable_init" to mke2fs to speed up the formatting time if [[ "$LDISKFS_MKFS_OPTS" != *lazy_itable_init* ]]; then LDISKFS_MKFS_OPTS=$(csa_add "$LDISKFS_MKFS_OPTS" -E lazy_itable_init) fi -init_logging - # require_dsh_mds || exit 0 require_dsh_ost || exit 0 -# 8 22 40 165 (min) -[ "$SLOW" = "no" ] && EXCEPT_SLOW="45 69 106 111" - assert_DIR gen_config() { @@ -275,8 +266,6 @@ generate_name() { cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $1 | head -n 1 } -build_test_filter - if [ "$ONLY" == "setup" ]; then setup exit diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index 10631ca..ed8104d 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -1,11 +1,8 @@ #!/bin/bash -# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- -# vim:shiftwidth=4:softtabstop=4:tabstop=4: -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 ALWAYS_EXCEPT="$LNET_SELFTEST_EXCEPT" @@ -22,6 +19,8 @@ if [ -r /etc/os-release ]; then fi fi +build_test_filter + [ x$LST = x ] && skip_env "lst not found LST=$LST" # FIXME: what is the reasonable value here? @@ -90,8 +89,6 @@ if is_mounted $MOUNT2; then interim_umount1=true fi -build_test_filter - lst_prepare () { # Workaround for bug 15619 lst_cleanup_all -- 1.8.3.1