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, 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. Remove all calls to get_lustre_env() in the test scripts
since this is called in init_test_env().
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-part-1
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: Ia8a1b3afcca7af645eed1d0f3dcf843e5254afe6
Reviewed-on: https://review.whamcloud.com/35263
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
-# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
#
# Run select tests by setting ONLY, or as arguments to the script.
# Skip specific tests by setting EXCEPT.
#
#
# Run select tests by setting ONLY, or as arguments to the script.
# Skip specific tests by setting EXCEPT.
#
-# Run test by setting NOSETUP=true when ltest has setup env for us
-SRCDIR=`dirname $0`
-export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
-
-# bug number for skipped test: LU-4256
-ALWAYS_EXCEPT="$LRSYNC_EXCEPT 2b"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
-
-[ "$ALWAYS_EXCEPT$EXCEPT" ] &&
- echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT`"
LREPL_LOG=$TMP/lustre_rsync.log
ORIG_PWD=${PWD}
LREPL_LOG=$TMP/lustre_rsync.log
ORIG_PWD=${PWD}
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+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}
+ALWAYS_EXCEPT="$LRSYNC_EXCEPT "
+# bug number for skipped test: LU-4256
+ALWAYS_EXCEPT+=" 2b"
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
+
+build_test_filter
+
[ -n "$FILESET" ] && skip "Not functional for FILESET set"
check_and_setup_lustre
[ -n "$FILESET" ] && skip "Not functional for FILESET set"
check_and_setup_lustre
error "No generic nobody group"
fi
error "No generic nobody group"
fi
export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
[ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
export LRSYNC="$LRSYNC -v -c no -d 2"
export LRSYNC=${LRSYNC:-"$LUSTRE/utils/lustre_rsync"}
[ ! -f "$LRSYNC" ] && export LRSYNC=$(which lustre_rsync)
export LRSYNC="$LRSYNC -v -c no -d 2"
-export MULTIOP=${MULTIOP:-multiop}
-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/$NAME.sh}
init_logging
ALWAYS_EXCEPT="$RECOVERY_SMALL_EXCEPT "
init_logging
ALWAYS_EXCEPT="$RECOVERY_SMALL_EXCEPT "
$SHARED_KEY && ALWAYS_EXCEPT+=" 136"
fi
$SHARED_KEY && ALWAYS_EXCEPT+=" 136"
fi
-require_dsh_mds || exit 0
-
-# also long tests: 19, 21a, 21e, 21f, 23, 27
-
-[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
-
+require_dsh_mds || exit 0
+
# Allow us to override the setup if we already have a mounted system by
# setting SETUP=" " and CLEANUP=" "
SETUP=${SETUP:-""}
# Allow us to override the setup if we already have a mounted system by
# setting SETUP=" " and CLEANUP=" "
SETUP=${SETUP:-""}
set -e
ONLY=${ONLY:-"$*"}
set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 9977/LU-7105
-# LU-7105
-ALWAYS_EXCEPT=" 28 $SANITYN_EXCEPT"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-SRCDIR=$(dirname $0)
-PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
-CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
OPENFILE=${OPENFILE:-openfile}
OPENUNLINK=${OPENUNLINK:-openunlink}
OPENFILE=${OPENFILE:-openfile}
OPENUNLINK=${OPENUNLINK:-openunlink}
-export MULTIOP=${MULTIOP:-multiop}
export TMP=${TMP:-/tmp}
MOUNT_2=${MOUNT_2:-"yes"}
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
export TMP=${TMP:-/tmp}
MOUNT_2=${MOUNT_2:-"yes"}
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
-SAVE_PWD=$PWD
-
-export NAME=${NAME:-local}
-
-LUSTRE=${LUSTRE:-`dirname $0`/..}
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
. $LUSTRE/tests/test-framework.sh
. $LUSTRE/tests/test-framework.sh
-CLEANUP=${CLEANUP:-:}
-SETUP=${SETUP:-:}
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-get_lustre_env
+ALWAYS_EXCEPT="$SANITYN_EXCEPT "
+# bug number for skipped test: LU-7105
+ALWAYS_EXCEPT+=" 28"
+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
+
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
-# bug number for skipped test:
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT "
-# LU-2829 / LU-2887 - make allowances for ZFS slowness
+ # LU-2829 / LU-2887 - make allowances for ZFS slowness
TEST33_NFILES=${TEST33_NFILES:-1000}
fi
TEST33_NFILES=${TEST33_NFILES:-1000}
fi
# 23 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="33a"
# 23 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="33a"
FAIL_ON_ERROR=false
SETUP=${SETUP:-:}
FAIL_ON_ERROR=false
SETUP=${SETUP:-:}
check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
test_1() {
touch $DIR1/$tfile
[ -f $DIR2/$tfile ] || error "Check create"
test_1() {
touch $DIR1/$tfile
[ -f $DIR2/$tfile ] || error "Check create"