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 -S TESTSUITE First test suite to run allows for restarts
25 -i N Repeat tests N times (default 1). A new directory
26 will be created under LOGDIR for each iteration.
27 -k Don't stop when subtests fail
28 -R Remount lustre between tests
29 -r Reformat (during initial configuration if needed)
32 -l Send logs to the Maloo database after run
33 (can be done later by running maloo_upload.sh)
37 These are suite specific options that can be specified after each suite on
40 --only LIST Run only specific list of subtests
41 --except LIST Skip list of subtests
42 --start-at SUBTEST Start testing from subtest
43 --stop-at SUBTEST Stop testing at subtest
44 --time-limit LIMIT Don't allow this suite to run longer
45 than LIMT seconds. [UNIMPLEMENTED]
48 Run all of sanity and all of replay-single except for 70b with SLOW=y using
49 the default "local" configuration.
51 auster -s sanity replay-single --except 70b
53 Run all tests in the regression group 5 times using large config.
55 auster -f large -g test-groups/regression -r 5
67 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
70 while getopts "c:d:D:nkf:S:g:i:rRslhv" opt
74 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
75 D) test_logs_dir=$OPTARG;;
76 g) test_group_file=$OPTARG;;
77 S) FIRST_SUITE=$OPTARG;;
78 k) export FAIL_ON_ERROR=false;;
81 i) repeat_count=$OPTARG;;
91 # If a test_group_file is specified, then ignore rest of command line
92 if [[ $test_group_file ]]; then
93 export TEST_GROUP=$(basename $test_group_file)
94 set $(sed 's/#.*$//' $test_group_file)
100 # Various paramters for the tests scripts
102 #: ${SIZE:=$((RAMKB * 2))}
105 #: ${MOUNT=/mnt/lustre}
106 #: ${MOUNT2:=${MOUNT}2}
119 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
120 . $LUSTRE/tests/test-framework.sh
125 local form="%-13s %-17s %s\n"
126 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
127 echo "------------------------------------------------------------------------------------"
133 nfs_client_mode && return
136 local MOUNTED=$(mounted_lustre_filesystems)
137 if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
138 check_config_clients $MOUNT
144 echo "Lustre is not mounted, trying to do setup ... "
145 $reformat && formatall
148 MOUNTED=$(mounted_lustre_filesystems)
149 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
150 echo "Lustre is not mounted after setup! "
156 cleanup_if_needed() {
157 if $auster_cleanup; then
162 find_script_in_path() {
165 for dir in $(tr : " " <<< $path); do
166 if [ -f $dir/$target ]; then
170 if [ -f $dir/$target.sh ]; then
179 log "-----============= acceptance-small: "$*" ============----- `date`"
184 printf "Would have run: %s\n" "$*"
188 printf "Running: %s\n" "$*"
201 local start_ts=$(date +%s)
202 doit bash $suite_script
204 duration=$(($(date +%s) - $start_ts))
205 if [ -f $TF_FAIL -o $rc -ne 0 ]; then
210 log_test_status $duration $status
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