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 -g GROUP Test group file (Overrides tests listed on command line)
24 -i N Repeat tests N times (default 1). A new directory
25 will be created under LOGDIR for each iteration.
26 -k Don't stop when subtests fail
27 -R Remount lustre between tests
28 -r Reformat (during initial configuration if needed)
31 -l Send logs to the Maloo database after run
32 (can be done later by running maloo_upload.sh)
36 These are suite specific options that can be specified after each suite on
39 --only LIST Run only specific list of subtests
40 --except LIST Skip list of subtests
41 --start-at SUBTEST Start testing from subtest
42 --stop-at SUBTEST Stop testing at subtest
43 --time-limit LIMIT Don't allow this suite to run longer
44 than LIMT seconds. [UNIMPLEMENTED]
47 Run all of sanity and all of replay-single except for 70b with SLOW=y using
48 the default "local" configuration.
50 auster -s sanity replay-single --except 70b
52 Run all tests in the regression group 5 times using large config.
54 auster -f large -g test-groups/regression -r 5
66 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
69 while getopts "c:d:D:nkf:g:i:rRslhv" opt
73 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
74 D) test_logs_dir=$OPTARG;;
75 g) test_group_file=$OPTARG;;
76 k) export FAIL_ON_ERROR=false;;
79 i) repeat_count=$OPTARG;;
89 # If a test_group_file is specified, then ignore rest of command line
90 if [[ $test_group_file ]]; then
91 export TEST_GROUP=$(basename $test_group_file)
92 set $(sed 's/#.*$//' $test_group_file)
98 # Various paramters for the tests scripts
100 #: ${SIZE:=$((RAMKB * 2))}
103 #: ${MOUNT=/mnt/lustre}
104 #: ${MOUNT2:=${MOUNT}2}
117 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
118 . $LUSTRE/tests/test-framework.sh
123 local form="%-13s %-17s %s\n"
124 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
125 echo "------------------------------------------------------------------------------------"
131 nfs_client_mode && return
134 local MOUNTED=$(mounted_lustre_filesystems)
135 if $(echo $MOUNTED | grep -w -q $MOUNT); then
136 check_config_clients $MOUNT
142 echo "Lustre is not mounted, trying to do setup ... "
143 $reformat && formatall
146 MOUNTED=$(mounted_lustre_filesystems)
147 if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
148 echo "Lustre is not mounted after setup! "
154 cleanup_if_needed() {
155 if $auster_cleanup; then
160 find_script_in_path() {
163 for dir in $(tr : " " <<< $path); do
164 if [ -e $dir/$target ]; then
168 if [ -e $dir/$target.sh ]; then
177 log "-----============= acceptance-small: "$*" ============----- `date`"
182 printf "Would have run: %s\n" "$*"
186 printf "Running: %s\n" "$*"
199 local start_ts=$(date +%s)
200 doit bash $suite_script
202 duration=$(($(date +%s) - $start_ts))
203 if [ -f $TF_FAIL -o $rc -ne 0 ]; then
208 log_test_status $duration $status
214 local suite_name=${1%.sh}
215 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
217 suite_script=$(find_script_in_path $suite_name $PATH:$LUSTRE/tests)
219 if [[ -z $suite_script ]]; then
220 echo "Can't find test script for $suite_name"
224 echo "run_suite $suite_name $suite_script"
225 local log_name=${suite_name}.suite_log.$(hostname).log
227 run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
229 run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
235 # Add this to test-framework somewhere.
249 while ((n < repeat_count)); do
251 local logdir=${test_logs_dir}
252 ((repeat_count > 1)) && logdir="$logdir/$n"
253 reset_logging $logdir
255 while [[ -n $1 ]]; do
256 unset ONLY EXCEPT START_AT STOP_AT
262 while [[ -n $1 ]]; do
266 export ONLY=$(split_commas $1)
267 opts+="ONLY=$ONLY ";;
270 export EXCEPT=$(split_commas $1)
271 opts+="EXCEPT=$EXCEPT ";;
275 opts+="START_AT=$START_AT ";;
279 opts+="STOP_AT=$STOP_AT ";;
288 echo "running: $suite $opts"
289 run_suite_logged $suite || RC=$?
290 echo $suite returned $RC
292 if $upload_logs; then
293 $upload_script $LOGDIR
299 if [ $upload_logs = true ] ; then
300 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
301 if [[ -z $upload_script ]]; then
302 echo "Can't find maloo_upload.sh script"
306 if [ ! -r ~/.maloorc ] ; then
307 echo "A ~/.maloorc file is required in order to upload results."
308 echo "Visit your maloo web interface to download your .maloorc file"
313 export NAME MOUNT START CLEAN
314 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
316 assert_env mds_HOST MDS_MKFS_OPTS
317 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
318 assert_env FSNAME MOUNT MOUNT2
320 echo "Started at `date`"
326 if [[ $RC -eq 0 ]]; then
330 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
331 echo "$0: completed with rc $RC" && exit $RC