4 # auster - drive lustre tests
6 # 1. --time-limt <seconds> add per test time limit, kill test if it runs to long
7 # 2. Read list of tests to run from a file. same syntax as cli, but one test per line
8 # 3. Run test on remote node
9 # 4. Use long opts for auster options
13 export TF_FAIL=/tmp/tf.fail
14 export TF_SKIP=/tmp/tf.skip
18 Usage ${0##*/} [options] suite [suite options] [suite [suite options]]
19 Run Lustre regression tests suites.
20 -c CONFIG Test environment config file
21 -d LOGDIR Top level directory for logs
22 -D FULLLOGDIR Full directory for logs
23 -f STR Config name (cfg/<name>.sh)
24 -g GROUP Test group file (Overrides tests listed on command line)
25 -S TESTSUITE First test suite to run allows for restarts
26 -i N Repeat tests N times (default 1). A new directory
27 will be created under LOGDIR for each iteration.
28 -k Don't stop when subtests fail
29 -R Remount lustre between tests
30 -r Reformat (during initial configuration if needed)
33 -l Send logs to the Maloo database after run
34 (can be done later by running maloo_upload.sh)
35 -L Script language of test suite. Default: bash
39 These are suite specific options that can be specified after each suite on
42 --only LIST Run only specific list of subtests
43 --except LIST Skip list of subtests
44 --start-at SUBTEST Start testing from subtest
45 --stop-at SUBTEST Stop testing at subtest
46 --time-limit LIMIT Don't allow this suite to run longer
47 than LIMT seconds. [UNIMPLEMENTED]
50 Run all of sanity and all of replay-single except for 70b with SLOW=y using
51 the default "local" configuration.
53 auster -s sanity replay-single --except 70b
55 Run all tests in the regression group 5 times using large config.
57 auster -f large -g test-groups/regression -i 5
70 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
73 while getopts "c:d:D:nkf:S:g:i:rRslL:hv" opt
76 c) export CONFIG=$OPTARG;;
77 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
78 D) test_logs_dir=$OPTARG;;
79 g) test_group_file=$OPTARG;;
80 S) FIRST_SUITE=$OPTARG;;
81 k) export FAIL_ON_ERROR=false;;
84 i) repeat_count=$OPTARG;;
90 L) script_lang=$OPTARG;;
95 # If a test_group_file is specified, then ignore rest of command line
96 if [[ $test_group_file ]]; then
97 export TEST_GROUP=$(basename $test_group_file)
98 set $(sed 's/#.*$//' $test_group_file)
112 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
113 . $LUSTRE/tests/test-framework.sh
118 local form="%-13s %-17s %s\n"
119 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
120 echo "------------------------------------------------------------------------------------"
126 nfs_client_mode && return
129 local MOUNTED=$(mounted_lustre_filesystems)
130 if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
131 check_config_clients $MOUNT
137 echo "Lustre is not mounted, trying to do setup ... "
138 $reformat && CLEANUP_DM_DEV=true formatall
141 MOUNTED=$(mounted_lustre_filesystems)
142 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
143 echo "Lustre is not mounted after setup! "
149 cleanup_if_needed() {
150 if $AUSTER_CLEANUP; then
155 find_script_in_path() {
158 for dir in $(tr : " " <<< $path); do
159 if [ -f $dir/$target ]; then
163 if [ -f $dir/$target.sh ]; then
172 log "-----============= acceptance-small: "$*" ============----- `date`"
177 printf "Would have run: %s\n" "$*"
181 printf "Running: %s\n" "$*"
189 local suite_script=$2
195 local start_ts=$(date +%s)
196 doit $script_lang $suite_script
198 local duration=$(($(date +%s) - $start_ts))
201 if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
203 elif [[ -f $TF_SKIP ]]; then
206 log_test_status $duration $status
207 [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
213 local suite_name=${1%.sh}
214 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
216 suite_script=$(find_script_in_path $suite_name $LUSTRE/tests)
218 if [[ -z $suite_script ]]; then
219 echo "Can't find test script for $suite_name"
223 echo "run_suite $suite_name $suite_script"
224 local log_name=${suite_name}.suite_log.$(hostname -s).log
226 run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
228 run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
234 # Add this to test-framework somewhere.
248 while ((n < repeat_count)); do
250 local logdir=${test_logs_dir}
251 local first_suite=$FIRST_SUITE
252 ((repeat_count > 1)) && logdir="$logdir/$n"
253 reset_logging $logdir
255 while [[ -n $1 ]]; do
256 unset ONLY EXCEPT START_AT STOP_AT
262 while [[ -n $1 ]]; do
266 export ONLY=$(split_commas $1)
267 opts+="ONLY=$ONLY ";;
270 export EXCEPT=$(split_commas $1)
271 opts+="EXCEPT=$EXCEPT ";;
275 opts+="START_AT=$START_AT ";;
279 opts+="STOP_AT=$STOP_AT ";;
288 if [ "x"$first_suite == "x" ] || [ $first_suite == $suite ]; then # If first_suite not set or this is the first suite
289 echo "running: $suite $opts"
290 run_suite_logged $suite || RC=$?
292 echo $suite returned $RC
295 if $upload_logs; then
296 $upload_script $LOGDIR
302 if [ $upload_logs = true ] ; then
303 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
304 if [[ -z $upload_script ]]; then
305 echo "Can't find maloo_upload.sh script"
309 if [ ! -r ~/.maloorc ] ; then
310 echo "A ~/.maloorc file is required in order to upload results."
311 echo "Visit your maloo web interface to download your .maloorc file"
316 export NAME MOUNT START CLEAN
317 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
320 assert_env ost_HOST OSTCOUNT
321 assert_env FSNAME MOUNT MOUNT2
323 echo "Started at `date`"
329 if [[ $RC -eq 0 ]]; then
333 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
334 echo "$0: completed with rc $RC" && exit $RC