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
40 These are suite specific options that can be specified after each suite on
43 --only LIST Run only specific list of subtests
44 --except LIST Skip list of subtests
45 --start-at SUBTEST Start testing from subtest
46 --stop-at SUBTEST Stop testing at subtest
47 --time-limit LIMIT Don't allow this suite to run longer
48 than LIMT seconds. [UNIMPLEMENTED]
51 Run all of sanity and all of replay-single except for 70b with SLOW=y using
52 the default "local" configuration.
54 auster -s sanity replay-single --except 70b
56 Run all tests in the regression group 5 times using large config.
58 auster -f large -g test-groups/regression -i 5
71 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
75 while getopts "c:d:D:nkf:S:g:Hi:rRslL:hv" opt
78 c) export CONFIG=$OPTARG;;
79 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
80 D) test_logs_dir=$OPTARG;;
81 g) test_group_file=$OPTARG;;
82 S) FIRST_SUITE=$OPTARG;;
83 k) export FAIL_ON_ERROR=false;;
86 H) export HONOR_EXCEPT="y";;
87 i) repeat_count=$OPTARG;;
93 L) script_lang=$OPTARG;;
98 # If a test_group_file is specified, then ignore rest of command line
99 if [[ $test_group_file ]]; then
100 export TEST_GROUP=$(basename $test_group_file)
101 set $(sed 's/#.*$//' $test_group_file)
115 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
116 . $LUSTRE/tests/test-framework.sh
121 local form="%-13s %-17s %s\n"
122 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
123 echo "------------------------------------------------------------------------------------"
129 nfs_client_mode && return
132 local MOUNTED=$(mounted_lustre_filesystems)
133 if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
134 check_config_clients $MOUNT
140 echo "Lustre is not mounted, trying to do setup ... "
141 $reformat && CLEANUP_DM_DEV=true formatall
144 MOUNTED=$(mounted_lustre_filesystems)
145 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
146 echo "Lustre is not mounted after setup! "
152 cleanup_if_needed() {
153 if $AUSTER_CLEANUP; then
158 find_script_in_path() {
161 for dir in $(tr : " " <<< $path); do
162 if [ -f $dir/$target ]; then
166 if [ -f $dir/$target.sh ]; then
175 log "-----============= acceptance-small: "$*" ============----- `date`"
180 printf "Would have run: %s\n" "$*"
184 printf "Running: %s\n" "$*"
192 local suite_script=$2
198 local start_ts=$(date +%s)
199 doit $script_lang $suite_script
201 local duration=$(($(date +%s) - $start_ts))
204 if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
206 elif [[ -f $TF_SKIP ]]; then
209 log_test_status $duration $status
210 [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
216 local suite_name=${1%.sh}
217 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
219 suite_script=$(find_script_in_path $suite_name $LUSTRE/tests)
221 if [[ -z $suite_script ]]; then
222 echo "Can't find test script for $suite_name"
226 echo "run_suite $suite_name $suite_script"
227 local log_name=${suite_name}.suite_log.$(hostname -s).log
229 run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
231 run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
237 # Add this to test-framework somewhere.
251 while ((n < repeat_count)); do
253 local logdir=${test_logs_dir}
254 local first_suite=$FIRST_SUITE
255 ((repeat_count > 1)) && logdir="$logdir/$n"
256 reset_logging $logdir
258 while [[ -n $1 ]]; do
259 unset ONLY EXCEPT START_AT STOP_AT
265 while [[ -n $1 ]]; do
269 export ONLY=$(split_commas $1)
270 opts+="ONLY=$ONLY ";;
273 export EXCEPT=$(split_commas $1)
274 opts+="EXCEPT=$EXCEPT ";;
278 opts+="START_AT=$START_AT ";;
282 opts+="STOP_AT=$STOP_AT ";;
291 if [ "x"$first_suite == "x" ] || [ $first_suite == $suite ]; then # If first_suite not set or this is the first suite
292 echo "running: $suite $opts"
293 run_suite_logged $suite || RC=$?
295 echo $suite returned $RC
298 if $upload_logs; then
299 $upload_script $LOGDIR
305 if [ $upload_logs = true ] ; then
306 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
307 if [[ -z $upload_script ]]; then
308 echo "Can't find maloo_upload.sh script"
312 if [ ! -r ~/.maloorc ] ; then
313 echo "A ~/.maloorc file is required in order to upload results."
314 echo "Visit your maloo web interface to download your .maloorc file"
319 export NAME MOUNT START CLEAN
320 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
323 assert_env ost_HOST OSTCOUNT
324 assert_env FSNAME MOUNT MOUNT2
326 echo "Started at `date`"
332 if [[ $RC -eq 0 ]]; then
336 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
337 echo "$0: completed with rc $RC" && exit $RC