2 # SPDX-License-Identifier: GPL-2.0
5 # This file is part of Lustre, http://www.lustre.org/
14 # 1. --time-limt <seconds> add per test time limit, kill test if it runs to long
15 # 2. Read list of tests to run from a file. same syntax as cli, but one test per line
16 # 3. Run test on remote node
21 export TF_FAIL=/tmp/tf.fail
22 export TF_SKIP=/tmp/tf.skip
26 Usage ${0##*/} [options] suite [suite options] [suite [suite options]]
27 Run Lustre regression tests suites.
28 -c, --config CONFIG Test environment config file
29 -C, --client-only Run client-side sanity tests against an already setup
30 filesystem. Users must define FSNAME and mgs_HOST manually.
31 -d, --log-dir LOGDIR Top level directory for logs
32 -D, --full-log-dir FULLLOGDIR Full directory for logs
33 -f, --cfg-name STR Config name (cfg/<name>.sh)
34 -g, --group GROUP Test group file (Overrides tests listed on command line)
35 -S, --suite TESTSUITE First test suite to run allows for restarts
36 -H, --honor Honor the EXCEPT and ALWAYS_EXCEPT list when --only is used
37 -i, --repeat N Repeat tests N times (default 1). A new directory
38 will be created under LOGDIR for each iteration.
39 -k --no-stop Don't stop when subtests fail
40 -R, --remount Remount lustre between tests
41 -r, --reformat Reformat (during initial configuration if needed)
43 -v, --verbose Verbose mode
44 -l, --send-logs Send logs to the Maloo database after run
45 (can be done later by running maloo_upload.sh)
46 -L, --lang Script language of test suite. Default: bash
47 -N, --no-setup No setup. Do not setup Lustre prior to executing test suite.
51 These are suite specific options that can be specified after each suite on
54 --only LIST Run only specific list of subtests
55 --except LIST Skip list of subtests
56 --start-at SUBTEST Start testing from subtest
57 --stop-at SUBTEST Stop testing at subtest
58 --time-limit LIMIT Don't allow this suite to run longer
59 than LIMT seconds. [UNIMPLEMENTED]
62 Run all of sanity and all of replay-single except for 70b with SLOW=y using
63 the default "local" configuration.
65 auster -s sanity replay-single --except 70b
67 Run all tests in the regression group 5 times using large config.
69 auster -f large -g test-groups/regression -i 5
71 Run the client-only tests from sanity.
73 FSNAME=myfilesystem mgs_HOST=1.2.3.4 auster -C sanity
86 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
89 export client_tests_only=false
91 export "${NAME:=local}"
93 # Replace long option with corresponding short option
97 --config) set -- "$@" '-c';;
98 --client-only) set -- "$@" '-C';;
99 --log-dir) set -- "$@" '-d';;
100 --full-log-dir) set -- "$@" '-D';;
101 --group) set -- "$@" '-g';;
102 --suite) set -- "$@" '-S';;
103 --no-stop) set -- "$@" '-k';;
104 --verbose) set -- "$@" '-v';;
105 --honor) set -- "$@" '-H';;
106 --repeat) set -- "$@" '-i';;
107 --cfg-name) set -- "$@" '-f';;
108 --remount) set -- "$@" '-R';;
109 --reformat) set -- "$@" '-r';;
110 --slow) set -- "$@" '-s';;
111 --send-logs) set -- "$@" '-l';;
112 --lang) set -- "$@" '-L';;
113 --no-setup) set -- "$@" '-N';;
114 --help) set -- "$@" '-h';;
115 *) set -- "$@" "$arg";;
119 while getopts "c:Cd:D:nkf:S:g:Hi:rRslL:Nhv" opt
122 c) export CONFIG=$OPTARG;;
123 C) client_tests_only=true;;
124 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
125 D) test_logs_dir=$OPTARG;;
126 g) test_group_file=$OPTARG;;
127 S) FIRST_SUITE=$OPTARG;;
128 k) export FAIL_ON_ERROR=false;;
131 H) export HONOR_EXCEPT="y";;
132 i) repeat_count=$OPTARG;;
137 l) upload_logs=true;;
138 L) script_lang=$OPTARG;;
144 # If a test_group_file is specified, then ignore rest of command line
145 if [[ $test_group_file ]]; then
146 export TEST_GROUP=$(basename $test_group_file)
147 set $(sed 's/#.*$//' $test_group_file)
154 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
155 . $LUSTRE/tests/test-framework.sh
158 # Set CLIENTONLY, while trying to discover some common
159 # variables so the test runner doesn't need do this
161 if $client_tests_only; then
162 export CLIENTONLY=true;
163 export FSTYPE=${FSTYPE:-ldiskfs};
164 export MDSCOUNT="$(( $($LFS mdts | wc -l) - 1 ))"
165 export OSTCOUNT="$(( $($LFS osts | wc -l) - 1 ))"
168 if [ $upload_logs = true ] ; then
169 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
170 if [[ -z $upload_script ]]; then
171 echo "Can't find maloo_upload.sh script"
175 if [ ! -r ~/.maloorc ] ; then
176 echo "A ~/.maloorc file is required in order to upload results."
177 echo "Visit your maloo web interface to download your .maloorc file"
182 export NAME MOUNT START CLEAN
183 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
185 # Only need to know where (MOUNT) and how (mgs_HOST) to
186 # mount Lustre for client-side only tests
187 if $client_tests_only; then
191 assert_env ost_HOST OSTCOUNT
195 assert_env FSNAME MOUNT
197 echo "Started at `date`"
203 if [[ $RC -eq 0 ]]; then
207 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
208 echo "$0: completed with rc $RC" && exit $RC