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 No logger to Maloo database
33 These are suite specific options that can be specified after each suite on
36 --only LIST Run only specific list of subtests
37 --except LIST Skip list of subtests
38 --start-at SUBTEST Start testing from subtest
39 --stop-at SUBTEST Stop testing at subtest
40 --time-limit LIMIT Don't allow this suite to run longer
41 than LIMT seconds. [UNIMPLEMENTED]
44 Run all of sanity and all of replay-single except for 70b with SLOW=y using
45 the default "local" configuration.
47 auster -s sanity replay-single --except 70b
49 Run test listed in batch-list 5 times using large config.
51 auster -f large -r 5 -b batch-list
63 test_logs_dir=/tmp/test_logs
66 while getopts "c:d:nkf:i:rRslhv" opt
70 d) test_logs_dir=$OPTARG;;
71 k) export FAIL_ON_ERROR=false;;
74 i) repeat_count=$OPTARG;;
85 if [ $logging = true ] ; then
86 if [ ! -r ~/.maloorc ] ; then
87 echo "A ~/.maloorc file is required in order to upload results."
88 echo " * Use -l to run without results upload (you can upload results later)"
90 echo " * Visit your maloo web interface to download your .maloorc file"
96 # Various paramters for the tests scripts
98 #: ${SIZE:=$((RAMKB * 2))}
101 #: ${MOUNT=/mnt/lustre}
102 #: ${MOUNT2:=${MOUNT}2}
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 && 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 [ -e $dir/$target ]; then
166 if [ -e $dir/$target.sh ]; then
175 log "-----============= acceptance-small: "$*" ============----- `date`"
180 printf "Would have run: %s\n" "$*"
184 printf "Running: %s\n" "$*"
197 local start_ts=$(date +%s)
198 doit bash $suite_script $only
200 duration=$(($(date +%s) - $start_ts))
201 if [ -f $TF_FAIL -o $rc -ne 0 ]; then
206 log_test_status $duration $status
212 local suite_name=${1%.sh}
213 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
214 local suite_only=${suite}_ONLY
216 suite_script=$(find_script_in_path $suite_name $PATH:$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 ${!suite_only}"
224 local log_name=${suite_name}.suite_log.$(hostname).log
225 run_suite $suite_name $suite_script "${!suite_only}" > $LOGDIR/$log_name 2>&1
226 # run_suite $suite_name $suite_script "${!suite_only}" 2>&1 |tee $LOGDIR/$log_name
231 # Add this to test-framework somewhere.
233 export LOGDIR=${1:-/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)}
245 local basedir=${test_logs_dir}/$(date +%Y-%m-%d)/$(date +%H%M%S)
246 while ((n < repeat_count)); do
248 local logdir=$basedir
249 ((repeat_count > 1)) && logdir="$logdir/$n"
250 reset_logging $logdir
252 while [[ -n $1 ]]; do
253 unset ONLY EXCEPT START_AT STOP_AT
259 while [[ -n $1 ]]; do
263 export ONLY=$(split_commas $1)
264 opts+="ONLY=$ONLY ";;
267 export EXCEPT=$(split_commas $1)
268 opts+="EXCEPT=$EXCEPT ";;
272 opts+="START_AT=$START_AT ";;
276 opts+="STOP_AT=$STOP_AT ";;
285 echo "running: $suite $opts"
286 run_suite_logged $suite || RC=$?
287 echo $suite returned $RC
289 if [ $logging = true ]; then
290 ./maloo_upload.sh $LOGDIR
296 export NAME MOUNT START CLEAN
297 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
299 assert_env mds_HOST MDS_MKFS_OPTS
300 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
301 assert_env FSNAME MOUNT MOUNT2
308 if [[ $RC -eq 0 ]]; then
312 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
313 echo "$0: completed with rc $RC" && exit $RC