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
17 Usage ${0##*/} [options] suite [suite optoins] [suite [suite options]]
18 Run Lustre regression tests suites.
19 -c CONFIG Test environment config file
20 -d LOGDIR Top level directory for logs
21 -D FULLLOGDIR Full directory for logs
22 -f STR Config name (cfg/<name>.sh)
23 -i N Repeat tests N times (default 1). A new directory
24 will be created under LOGDIR for each iteration.
25 -k Don't stop when subtests fail
26 -R Remount lustre between tests
27 -r Reformat (during initial configuration if needed)
30 -l Send logs to the Maloo database after run
31 (can be done later by running maloo_upload.sh)
35 These are suite specific options that can be specified after each suite on
38 --only LIST Run only specific list of subtests
39 --except LIST Skip list of subtests
40 --start-at SUBTEST Start testing from subtest
41 --stop-at SUBTEST Stop testing at subtest
42 --time-limit LIMIT Don't allow this suite to run longer
43 than LIMT seconds. [UNIMPLEMENTED]
46 Run all of sanity and all of replay-single except for 70b with SLOW=y using
47 the default "local" configuration.
49 auster -s sanity replay-single --except 70b
51 Run test listed in batch-list 5 times using large config.
53 auster -f large -r 5 -b batch-list
65 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
68 while getopts "c:d:D:nkf:i:rRslhv" opt
72 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
73 D) test_logs_dir=$OPTARG;;
74 k) export FAIL_ON_ERROR=false;;
77 i) repeat_count=$OPTARG;;
89 # Various paramters for the tests scripts
91 #: ${SIZE:=$((RAMKB * 2))}
94 #: ${MOUNT=/mnt/lustre}
95 #: ${MOUNT2:=${MOUNT}2}
108 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
109 . $LUSTRE/tests/test-framework.sh
114 local form="%-13s %-17s %s\n"
115 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
116 echo "------------------------------------------------------------------------------------"
122 nfs_client_mode && return
125 local MOUNTED=$(mounted_lustre_filesystems)
126 if $(echo $MOUNTED | grep -w -q $MOUNT); then
127 check_config_clients $MOUNT
133 echo "Lustre is not mounted, trying to do setup ... "
134 $reformat && formatall
137 MOUNTED=$(mounted_lustre_filesystems)
138 if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
139 echo "Lustre is not mounted after setup! "
145 cleanup_if_needed() {
146 if $auster_cleanup; then
151 find_script_in_path() {
154 for dir in $(tr : " " <<< $path); do
155 if [ -e $dir/$target ]; then
159 if [ -e $dir/$target.sh ]; then
168 log "-----============= acceptance-small: "$*" ============----- `date`"
173 printf "Would have run: %s\n" "$*"
177 printf "Running: %s\n" "$*"
190 local start_ts=$(date +%s)
191 doit bash $suite_script $only
193 duration=$(($(date +%s) - $start_ts))
194 if [ -f $TF_FAIL -o $rc -ne 0 ]; then
199 log_test_status $duration $status
205 local suite_name=${1%.sh}
206 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
207 local suite_only=${suite}_ONLY
209 suite_script=$(find_script_in_path $suite_name $PATH:$LUSTRE/tests)
211 if [[ -z $suite_script ]]; then
212 echo "Can't find test script for $suite_name"
216 echo "run_suite $suite_name $suite_script ${!suite_only}"
217 local log_name=${suite_name}.suite_log.$(hostname).log
219 run_suite $suite_name $suite_script "${!suite_only}" 2>&1 |tee $LOGDIR/$log_name
221 run_suite $suite_name $suite_script "${!suite_only}" > $LOGDIR/$log_name 2>&1
227 # Add this to test-framework somewhere.
241 while ((n < repeat_count)); do
243 local logdir=${test_logs_dir}
244 ((repeat_count > 1)) && logdir="$logdir/$n"
245 reset_logging $logdir
247 while [[ -n $1 ]]; do
248 unset ONLY EXCEPT START_AT STOP_AT
254 while [[ -n $1 ]]; do
258 export ONLY=$(split_commas $1)
259 opts+="ONLY=$ONLY ";;
262 export EXCEPT=$(split_commas $1)
263 opts+="EXCEPT=$EXCEPT ";;
267 opts+="START_AT=$START_AT ";;
271 opts+="STOP_AT=$STOP_AT ";;
280 echo "running: $suite $opts"
281 run_suite_logged $suite || RC=$?
282 echo $suite returned $RC
284 if $upload_logs; then
285 $upload_script $LOGDIR
291 if [ $upload_logs = true ] ; then
292 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
293 if [[ -z $upload_script ]]; then
294 echo "Can't find maloo_upload.sh script"
298 if [ ! -r ~/.maloorc ] ; then
299 echo "A ~/.maloorc file is required in order to upload results."
300 echo "Visit your maloo web interface to download your .maloorc file"
305 export NAME MOUNT START CLEAN
306 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
308 assert_env mds_HOST MDS_MKFS_OPTS
309 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
310 assert_env FSNAME MOUNT MOUNT2
317 if [[ $RC -eq 0 ]]; then
321 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
322 echo "$0: completed with rc $RC" && exit $RC