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 -H Honor the EXCEPT and ALWAYS_EXCEPT list when --only is used
27 -i N Repeat tests N times (default 1). A new directory
28 will be created under LOGDIR for each iteration.
29 -k Don't stop when subtests fail
30 -R Remount lustre between tests
31 -r Reformat (during initial configuration if needed)
34 -l Send logs to the Maloo database after run
35 (can be done later by running maloo_upload.sh)
36 -L Script language of test suite. Default: bash
37 -N No setup. Do not setup Lustre prior to executing test suite.
41 These are suite specific options that can be specified after each suite on
44 --only LIST Run only specific list of subtests
45 --except LIST Skip list of subtests
46 --start-at SUBTEST Start testing from subtest
47 --stop-at SUBTEST Stop testing at subtest
48 --time-limit LIMIT Don't allow this suite to run longer
49 than LIMT seconds. [UNIMPLEMENTED]
52 Run all of sanity and all of replay-single except for 70b with SLOW=y using
53 the default "local" configuration.
55 auster -s sanity replay-single --except 70b
57 Run all tests in the regression group 5 times using large config.
59 auster -f large -g test-groups/regression -i 5
72 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
77 while getopts "c:d:D:nkf:S:g:Hi:rRslL:Nhv" opt
80 c) export CONFIG=$OPTARG;;
81 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
82 D) test_logs_dir=$OPTARG;;
83 g) test_group_file=$OPTARG;;
84 S) FIRST_SUITE=$OPTARG;;
85 k) export FAIL_ON_ERROR=false;;
88 H) export HONOR_EXCEPT="y";;
89 i) repeat_count=$OPTARG;;
95 L) script_lang=$OPTARG;;
101 # If a test_group_file is specified, then ignore rest of command line
102 if [[ $test_group_file ]]; then
103 export TEST_GROUP=$(basename $test_group_file)
104 set $(sed 's/#.*$//' $test_group_file)
118 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
119 . $LUSTRE/tests/test-framework.sh
124 local form="%-13s %-17s %s\n"
125 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
126 echo "------------------------------------------------------------------------------------"
132 ! ${do_setup} && return
133 nfs_client_mode && return
136 local MOUNTED=$(mounted_lustre_filesystems)
137 if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
138 check_config_clients $MOUNT
144 echo "Lustre is not mounted, trying to do setup ... "
145 $reformat && CLEANUP_DM_DEV=true formatall
148 MOUNTED=$(mounted_lustre_filesystems)
149 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
150 echo "Lustre is not mounted after setup! "
156 cleanup_if_needed() {
157 if $AUSTER_CLEANUP; then
162 find_script_in_path() {
165 for dir in $(tr : " " <<< $path); do
166 if [ -f $dir/$target ]; then
170 if [ -f $dir/$target.sh ]; then
179 log "-----============= acceptance-small: "$*" ============----- `date`"
184 printf "Would have run: %s\n" "$*"
188 printf "Running: %s\n" "$*"
196 local suite_script=$2
202 local start_ts=$(date +%s)
203 doit $script_lang $suite_script
205 local duration=$(($(date +%s) - $start_ts))
208 if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
210 elif [[ -f $TF_SKIP ]]; then
213 log_test_status $duration $status
214 [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
220 local suite_name=${1%.sh}
221 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
223 suite_script=$(find_script_in_path $suite_name $LUSTRE/tests)
225 if [[ -z $suite_script ]]; then
226 echo "Can't find test script for $suite_name"
230 echo "run_suite $suite_name $suite_script"
231 local log_name=${suite_name}.suite_log.$(hostname -s).log
233 run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
235 run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
241 # Add this to test-framework somewhere.
255 while ((n < repeat_count)); do
257 local logdir=${test_logs_dir}
258 local first_suite=$FIRST_SUITE
259 ((repeat_count > 1)) && logdir="$logdir/$n"
260 reset_logging $logdir
262 while [[ -n $1 ]]; do
263 unset ONLY EXCEPT START_AT STOP_AT
269 while [[ -n $1 ]]; do
273 export ONLY=$(split_commas $1)
274 opts+="ONLY=$ONLY ";;
277 export EXCEPT=$(split_commas $1)
278 opts+="EXCEPT=$EXCEPT ";;
282 opts+="START_AT=$START_AT ";;
286 opts+="STOP_AT=$STOP_AT ";;
295 if [ "x"$first_suite == "x" ] || [ $first_suite == $suite ]; then # If first_suite not set or this is the first suite
296 echo "running: $suite $opts"
297 run_suite_logged $suite || RC=$?
299 echo $suite returned $RC
302 if $upload_logs; then
303 $upload_script $LOGDIR
309 if [ $upload_logs = true ] ; then
310 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
311 if [[ -z $upload_script ]]; then
312 echo "Can't find maloo_upload.sh script"
316 if [ ! -r ~/.maloorc ] ; then
317 echo "A ~/.maloorc file is required in order to upload results."
318 echo "Visit your maloo web interface to download your .maloorc file"
323 export NAME MOUNT START CLEAN
324 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
327 assert_env ost_HOST OSTCOUNT
328 assert_env FSNAME MOUNT MOUNT2
330 echo "Started at `date`"
336 if [[ $RC -eq 0 ]]; then
340 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
341 echo "$0: completed with rc $RC" && exit $RC