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
14 export TF_SKIP=/tmp/tf.skip
18 Usage ${0##*/} [options] suite [suite options] [suite [suite options]]
19 Run Lustre regression tests suites.
20 -c CONFIG Test environment config file
21 -d LOGDIR Top level directory for logs
22 -D FULLLOGDIR Full directory for logs
23 -f STR Config name (cfg/<name>.sh)
24 -g GROUP Test group file (Overrides tests listed on command line)
25 -S TESTSUITE First test suite to run allows for restarts
26 -i N Repeat tests N times (default 1). A new directory
27 will be created under LOGDIR for each iteration.
28 -k Don't stop when subtests fail
29 -R Remount lustre between tests
30 -r Reformat (during initial configuration if needed)
33 -l Send logs to the Maloo database after run
34 (can be done later by running maloo_upload.sh)
38 These are suite specific options that can be specified after each suite on
41 --only LIST Run only specific list of subtests
42 --except LIST Skip list of subtests
43 --start-at SUBTEST Start testing from subtest
44 --stop-at SUBTEST Stop testing at subtest
45 --time-limit LIMIT Don't allow this suite to run longer
46 than LIMT seconds. [UNIMPLEMENTED]
49 Run all of sanity and all of replay-single except for 70b with SLOW=y using
50 the default "local" configuration.
52 auster -s sanity replay-single --except 70b
54 Run all tests in the regression group 5 times using large config.
56 auster -f large -g test-groups/regression -i 5
68 test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
71 while getopts "c:d:D:nkf:S:g:i:rRslhv" opt
74 c) export CONFIG=$OPTARG;;
75 d) test_logs_dir=$OPTARG/$(date +%Y-%m-%d)/$(date +%H%M%S);;
76 D) test_logs_dir=$OPTARG;;
77 g) test_group_file=$OPTARG;;
78 S) FIRST_SUITE=$OPTARG;;
79 k) export FAIL_ON_ERROR=false;;
82 i) repeat_count=$OPTARG;;
92 # If a test_group_file is specified, then ignore rest of command line
93 if [[ $test_group_file ]]; then
94 export TEST_GROUP=$(basename $test_group_file)
95 set $(sed 's/#.*$//' $test_group_file)
101 # Various paramters for the tests scripts
103 #: ${SIZE:=$((RAMKB * 2))}
106 #: ${MOUNT=/mnt/lustre}
107 #: ${MOUNT2:=${MOUNT}2}
120 : ${LUSTRE:=$(cd $(dirname $0)/..; echo $PWD)}
121 . $LUSTRE/tests/test-framework.sh
126 local form="%-13s %-17s %s\n"
127 printf "$form" "status" "script" "skipped tests E(xcluded) S(low)"
128 echo "------------------------------------------------------------------------------------"
134 nfs_client_mode && return
137 local MOUNTED=$(mounted_lustre_filesystems)
138 if $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
139 check_config_clients $MOUNT
145 echo "Lustre is not mounted, trying to do setup ... "
146 $reformat && formatall
149 MOUNTED=$(mounted_lustre_filesystems)
150 if ! $(echo $MOUNTED' ' | grep -w -q $MOUNT' '); then
151 echo "Lustre is not mounted after setup! "
157 cleanup_if_needed() {
158 if $auster_cleanup; then
163 find_script_in_path() {
166 for dir in $(tr : " " <<< $path); do
167 if [ -f $dir/$target ]; then
171 if [ -f $dir/$target.sh ]; then
180 log "-----============= acceptance-small: "$*" ============----- `date`"
185 printf "Would have run: %s\n" "$*"
189 printf "Running: %s\n" "$*"
197 local suite_script=$2
203 local start_ts=$(date +%s)
204 doit bash $suite_script
206 local duration=$(($(date +%s) - $start_ts))
209 if [[ $rc -ne 0 || -f $TF_FAIL ]]; then
211 elif [[ -f $TF_SKIP ]]; then
214 log_test_status $duration $status
215 [[ ! -f $TF_SKIP ]] || rm -f $TF_SKIP
221 local suite_name=${1%.sh}
222 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
224 suite_script=$(find_script_in_path $suite_name $LUSTRE/tests)
226 if [[ -z $suite_script ]]; then
227 echo "Can't find test script for $suite_name"
231 echo "run_suite $suite_name $suite_script"
232 local log_name=${suite_name}.suite_log.$(hostname -s).log
234 run_suite $suite_name $suite_script 2>&1 |tee $LOGDIR/$log_name
236 run_suite $suite_name $suite_script > $LOGDIR/$log_name 2>&1
242 # Add this to test-framework somewhere.
256 while ((n < repeat_count)); do
258 local logdir=${test_logs_dir}
259 local first_suite=$FIRST_SUITE
260 ((repeat_count > 1)) && logdir="$logdir/$n"
261 reset_logging $logdir
263 while [[ -n $1 ]]; do
264 unset ONLY EXCEPT START_AT STOP_AT
270 while [[ -n $1 ]]; do
274 export ONLY=$(split_commas $1)
275 opts+="ONLY=$ONLY ";;
278 export EXCEPT=$(split_commas $1)
279 opts+="EXCEPT=$EXCEPT ";;
283 opts+="START_AT=$START_AT ";;
287 opts+="STOP_AT=$STOP_AT ";;
296 if [ "x"$first_suite == "x" ] || [ $first_suite == $suite ]; then # If first_suite not set or this is the first suite
297 echo "running: $suite $opts"
298 run_suite_logged $suite || RC=$?
300 echo $suite returned $RC
303 if $upload_logs; then
304 $upload_script $LOGDIR
310 if [ $upload_logs = true ] ; then
311 upload_script=$(find_script_in_path maloo_upload.sh $PATH:$LUSTRE/tests)
312 if [[ -z $upload_script ]]; then
313 echo "Can't find maloo_upload.sh script"
317 if [ ! -r ~/.maloorc ] ; then
318 echo "A ~/.maloorc file is required in order to upload results."
319 echo "Visit your maloo web interface to download your .maloorc file"
324 export NAME MOUNT START CLEAN
325 . ${CONFIG:-$LUSTRE/tests/cfg/$NAME.sh}
328 assert_env ost_HOST OSTCOUNT
329 assert_env FSNAME MOUNT MOUNT2
331 echo "Started at `date`"
337 if [[ $RC -eq 0 ]]; then
341 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
342 echo "$0: completed with rc $RC" && exit $RC