2 # script which _must_ complete successfully (at minimum) before checkins to
3 # the CVS HEAD are allowed.
10 # This is the default set of tests to run.
11 DEFAULT_SUITES="runtests sanity sanity-benchmark sanityn lfsck liblustre
12 runracer replay-single conf-sanity recovery-small
13 replay-ost-single replay-dual insanity sanity-quota sanity-sec
14 sanity-gss performance-sanity large-scale recovery-mds-scale
15 recovery-double-scale recovery-random-scale parallel-scale
16 lustre_rsync-test metadata-updates ost-pools lnet-selftest"
19 ACC_SM_ONLY="${ACC_SM_ONLY} $@"
22 [ "$SIZE" ] || SIZE=$((RAMKB * 2))
23 [ "$RSIZE" ] || RSIZE=512
24 [ "$UID" ] || UID=1000
25 [ "$MOUNT" ] || MOUNT=/mnt/lustre
26 [ "$MOUNT2" ] || MOUNT2=${MOUNT}2
27 [ "$TMP" ] || TMP=/tmp
28 [ "$COUNT" ] || COUNT=1000
29 [ "$DEBUG_LVL" ] || DEBUG_LVL=0
30 [ "$DEBUG_OFF" ] || DEBUG_OFF="eval lctl set_param debug=\"$DEBUG_LVL\""
31 [ "$DEBUG_ON" ] || DEBUG_ON="eval lctl set_param debug=0x33f0484"
33 if [ "$ACC_SM_ONLY" ]; then
34 for O in $DEFAULT_SUITES; do
35 O=$(echo $O | tr "-" "_" | tr "[:lower:]" "[:upper:]")
38 for O in $ACC_SM_ONLY; do
39 O=`echo ${O%.sh} | tr "-" "_"`
40 O=`echo $O | tr "[:lower:]" "[:upper:]"`
44 LFSCK="no" # bug 13698
48 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
49 . $LUSTRE/tests/test-framework.sh
53 # liblustre doesn't support GSS
56 export SANITY_GSS="no"
59 SETUP=${SETUP:-setupall}
60 FORMAT=${FORMAT:-formatall}
61 CLEANUP=${CLEANUP:-stopall}
64 nfs_client_mode && return
66 local MOUNTED=$(mounted_lustre_filesystems)
67 if $(echo $MOUNTED | grep -w -q $MOUNT); then
68 check_config_clients $MOUNT
74 echo "Lustre is not mounted, trying to do setup SETUP=$SETUP ... "
75 [ "$REFORMAT" ] && $FORMAT
78 MOUNTED=$(mounted_lustre_filesystems)
79 if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
80 echo "Lustre is not mounted after setup! SETUP=$SETUP"
87 for dir in $(tr : " " <<< $PATH); do
88 if [ -e $dir/$target ]; then
89 echo "$dir/$target found in PATH"
97 # update titlebar if stdin is attaached to an xterm
98 if ${UPDATE_TITLEBAR:-false}; then
102 echo -ne "\033]2; acceptance-small: $* \007" >&0
107 log "-----============= acceptance-small: "$*" ============----- `date`"
110 is_sanity_benchmark() {
111 local benchmarks="dbench bonnie iozone fsx"
113 for b in $benchmarks; do
114 if [ "$b" == "$suite" ]; then
122 local suite_name=$(echo ${1%.sh} | tr "[:upper:]_" "[:lower:]-" )
123 local suite=$(echo ${suite_name} | tr "[:lower:]-" "[:upper:]_")
124 local suite_only=ONLY # Change to ${suite}_ONLY after fixing YALA
126 if is_sanity_benchmark ${suite_name}; then
127 suite_only=suite_name
128 suite_script=$LUSTRE/tests/sanity-benchmark.sh
129 elif [ -e $LUSTRE/tests/${suite_name}.sh ]; then
130 suite_script=$LUSTRE/tests/${suite_name}.sh
131 elif [ -e $LUSTRE/tests/$suite_name ]; then
132 suite_script=$LUSTRE/tests/$suite_name
133 elif find_in_path $suite_name; then
134 suite_script=${suite_name}
135 elif find_in_path ${suite_name}.sh; then
136 suite_script=${suite_name}.sh
138 echo "Can't find test script for $suite_name"
142 echo "$suite_script located."
143 if [[ ${!suite} != no ]]; then
146 bash $suite_script ${!suite_only}
151 echo "Skipping $suite_name"
161 export NAME MOUNT START CLEAN
162 . $LUSTRE/tests/cfg/$NAME.sh
164 assert_env mds_HOST MDS_MKFS_OPTS
165 assert_env ost_HOST OST_MKFS_OPTS OSTCOUNT
166 assert_env FSNAME MOUNT MOUNT2
171 run_suites ${ACC_SM_ONLY:-$DEFAULT_SUITES}
175 echo "Finished at `date` in $((`date +%s` - $STARTTIME))s"
177 [ "$MSKIPPED" = 1 ] && log "FAIL: remote MDS tests skipped" && RC=1
178 [ "$OSKIPPED" = 1 ] && log "FAIL: remote OST tests skipped" && RC=1
179 echo "$0: completed with rc $RC" && exit $RC