2 # Run select tests by setting ONLY, or as arguments to the script.
3 # Skip specific tests by setting EXCEPT.
6 # Sourcing this script will log you out from your shell
7 if [[ -n "${PS1}" ]]; then
8 echo "Do not source this script. Run using ./lutf.sh instead."
12 export ONLY=${ONLY:-"$*"}
13 export SUITE=${SUITE:-"$*"}
14 export PATTERN=${PATTERN:-"$*"}
16 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
17 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
19 LUSTRE=${LUSTRE:-$(dirname "$0")/..}
21 . "$LUSTRE/tests/test-framework.sh"
23 . "${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}"
26 # bug number for skipped test:
27 ALWAYS_EXCEPT="$SANITY_LNET_EXCEPT "
29 export LNETCTL=${LNETCTL:-"$LUSTRE/../lnet/utils/lnetctl"}
30 [ ! -f "$LNETCTL" ] &&
31 export LNETCTL=$(which lnetctl 2> /dev/null)
32 [[ -z $LNETCTL ]] && skip "Need lnetctl"
35 if is_mounted "$MOUNT" || is_mounted "$MOUNT2"; then
36 cleanupall || error "Failed cleanup prior to test execution"
41 echo "Cleaning up LNet"
42 lsmod | grep -q lnet &&
43 $LNETCTL lnet unconfigure 2>/dev/null
48 if module_loaded lnet ; then
49 cleanup_lnet || error "Failed to unload modules before test execution"
56 if $restore_mounts; then
57 setupall || error "Failed to setup Lustre after test execution"
58 elif $restore_modules; then
60 error "Couldn't load modules after test execution"
65 set_env_vars_on_remote() {
66 local list=$(comma_list $(all_nodes))
67 do_rpc_nodes "$list" "echo $PATH; echo $LUSTRE; echo $LNETCTL; echo $LCTL"
70 set_env_vars_on_remote
74 # do not exit if LUTF fails
77 echo "+++++++++++STARTING LUTF"
78 export LUTF_ENV_VARS="$CONFIG"
79 "$LUSTRE/tests/lutf/python/config/lutf_start.py"
81 echo "-----------STOPPING LUTF: $rc"
83 if [ -d /tmp/lutf/ ]; then
84 tar -czf /tmp/lutf.tar.gz /tmp/lutf
85 mv /tmp/lutf.tar.gz "$LOGDIR"
89 complete_test $SECONDS