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 -f STR Config name (cfg/<name>.sh)
22 -i N Repeat tests N times (default 1). A new directory
23 will be created under LOGDIR for each iteration.
24 -k Don't stop when subtests fail
25 -R Remount lustre between tests
26 -r Reformat (during initial configuration if needed)
29 -l Send logs to the Maloo database after run
30 (can be done later by running maloo_upload.sh)
34 These are suite specific options that can be specified after each suite on
37 --only LIST Run only specific list of subtests
38 --except LIST Skip list of subtests
39 --start-at SUBTEST Start testing from subtest
40 --stop-at SUBTEST Stop testing at subtest
41 --time-limit LIMIT Don't allow this suite to run longer
42 than LIMT seconds. [UNIMPLEMENTED]
45 Run all of sanity and all of replay-single except for 70b with SLOW=y using
46 the default "local" configuration.
48 auster -s sanity replay-single --except 70b
50 Run test listed in batch-list 5 times using large config.
52 auster -f large -r 5 -b batch-list
64 test_logs_dir=/tmp/test_logs
67 while getopts "c:d:nkf:i:rRslhv" opt
71 d) test_logs_dir=$OPTARG;;
72 k) export FAIL_ON_ERROR=false;;
75 i) repeat_count=$OPTARG;;
87 # Various paramters for the tests scripts
89 #: ${SIZE:=$((RAMKB * 2))}
92 #: ${MOUNT=/mnt/lustre}
93 #: ${MOUNT2:=${MOUNT}2}
106 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
107 . $LUSTRE/tests/test-framework.sh
112 local form="%-13s %-17s %s\n"
113 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
114 echo "------------------------------------------------------------------------------------"
120 nfs_client_mode && return
123 local MOUNTED=$(mounted_lustre_filesystems)
124 if $(echo $MOUNTED | grep -w -q $MOUNT); then
125 check_config_clients $MOUNT
131 echo "Lustre is not mounted, trying to do setup ... "
132 $reformat && formatall
135 MOUNTED=$(mounted_lustre_filesystems)
136 if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
137 echo "Lustre is not mounted after setup! "
143 cleanup_if_needed() {
144 if $auster_cleanup; then
149 find_script_in_path() {
152 for dir in $(tr : " " <<< $path); do
153 if [ -e $dir/$target ]; then
157 if [ -e $dir/$target.sh ]; then
166 log "-----============= acceptance-small: "$*" ============----- `date`"
171 printf "Would have run: %s\n" "$*"
175 printf "Running: %s\n" "$*"
188 local start_ts=$(date +%s)
189 doit bash $suite_script $only
191 duration=$(($(date +%s) - $start_ts))
192 if [ -f $TF_FAIL -o $rc -ne 0 ]; then
197 log_test_status $duration $status
203 local suite_name=${1%.sh}
204 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
205 local suite_only=${suite}_ONLY
207 suite_script=$(find_script_in_path $suite_name $PATH:$LUSTRE/tests)
209 if [[ -z $suite_script ]]; then
210 echo "Can't find test script for $suite_name"
214 echo "run_suite $suite_name $suite_script ${!suite_only}"
215 local log_name=${suite_name}.suite_log.$(hostname).log
217 run_suite $suite_name $suite_script "${!suite_only}" 2>&1 |tee $LOGDIR/$log_name
219 run_suite $suite_name $suite_script "${!suite_only}" > $LOGDIR/$log_name 2>&1
225 # Add this to test-framework somewhere.
227 export LOGDIR=${1:-${test_logs_dir}/$(date +%Y-%m-%d)/$(date +%H%M%S)}
239 local basedir=${test_logs_dir}/$(date +%Y-%m-%d)/$(date +%H%M%S)
240 while ((n < repeat_count)); do
242 local logdir=$basedir
243 ((repeat_count > 1)) && logdir="$logdir/$n"
244 reset_logging $logdir
246 while [[ -n $1 ]]; do
247 unset ONLY EXCEPT START_AT STOP_AT
253 while [[ -n $1 ]]; do
257 export ONLY=$(split_commas $1)
258 opts+="ONLY=$ONLY ";;
261 export EXCEPT=$(split_commas $1)
262 opts+="EXCEPT=$EXCEPT ";;
266 opts+="START_AT=$START_AT ";;
270 opts+="STOP_AT=$STOP_AT ";;
279 echo "running: $suite $opts"
280 run_suite_logged $suite || RC=$?
281 echo $suite returned $RC
283 if $upload_logs; then
290 if [ $upload_logs = true ] ; then
291 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
292 if [[ -z $upload_script ]]; then
293 echo "Can't find maloo_upload.sh script"
297 if [ ! -r ~/.maloorc ] ; then
298 echo "A ~/.maloorc file is required in order to upload results."
299 echo "Visit your maloo web interface to download your .maloorc file"
304 export NAME MOUNT START CLEAN
305 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
307 assert_env mds_HOST MDS_MKFS_OPTS
308 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
309 assert_env FSNAME MOUNT MOUNT2
316 if [[ $RC -eq 0 ]]; then
320 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
321 echo "$0: completed with rc $RC" && exit $RC