3 # Run select tests by setting ONLY, or as arguments to the script.
4 # Skip specific tests by setting EXCEPT.
11 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
12 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
14 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
16 . $LUSTRE/tests/test-framework.sh
20 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
25 check_and_setup_lustre
27 # $RUNAS_ID may get set incorrectly somewhere else
28 if [[ $UID -eq 0 && $RUNAS_ID -eq 0 ]]; then
29 skip_env "\$RUNAS_ID set to 0, but \$UID is also 0!" && exit
31 check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
36 DOM_SIZE=${DOM_SIZE:-"1M"}
45 # 1 stripe for normal files
47 lfs setstripe -c 1 $NORM
49 if [ "x$DNE" == "xyes" ] ; then
50 lfs setdirstripe -i 0 -c 2 $DOM
55 lfs setstripe -E ${DOM_SIZE} -L mdt -E EOF $DOM
57 # total number of files
65 $LCTL set_param -n ${cli}.*.${cli}_stats=0
66 $LCTL set_param -n ${cli}.*.rpc_stats=0
67 $LCTL set_param -n ${cli}.*.stats=0
68 $LCTL set_param -n llite.*.read_ahead_stats=0
69 $LCTL set_param -n llite.*.unstable_stats=0
77 if [ "x$STATS" != "xyes" ] ; then
81 $LCTL get_param ${cli}.*.${cli}_stats
82 $LCTL get_param ${cli}.*.rpc_stats
83 # for OSC get both OSC and MDC stats
84 if [ $cli == "osc" ] ; then
85 $LCTL get_param mdc.*.stats
87 $LCTL get_param ${cli}.*.stats
88 $LCTL get_param ${cli}.*.unstable_stats
89 $LCTL get_param ${cli}.*.${cli}_cached_mb
90 $LCTL get_param llite.*.read_ahead_stats
98 $LCTL set_param -n debug=0
106 if ! grep -qw "$MOUNT" /proc/mounts ; then
107 echo "!!!!! Lustre is not mounted !!!!!, aborting"
111 echo "##### $cmd #####"
112 echo "##### $(date +'%F %H:%M:%S'): START"
114 echo "##### $(date +'%F %H:%M:%S'): GETSTATS"
116 echo "##### $(date +'%F %H:%M:%S'): STOP"
122 if ! which mdtest > /dev/null 2>&1 ; then
123 echo "Mdtest is not installed, skipping"
127 local mdtest=$(which mdtest)
129 local TDIR=${1:-$MOUNT}
130 local th_num=$((FNUM * 2 / NUM))
132 for bsize in 4096 ; do
133 run_cmd "mpirun -np $NUM $mdtest \
134 -i 3 -I $th_num -F -z 1 -b 1 -L -u -w $bsize -d $TDIR"
141 if [ ! -f createmany ] ; then
142 echo "Createmany is not installed, skipping"
146 if [ ! -f smalliomany ] ; then
147 echo "Smalliomany is not installed, skipping"
151 local TDIR=${1:-$DIR}
154 local MIN=$((count * 16))
155 [ $MDSSIZE -le $MIN ] && count=$((MDSSIZE / 16))
157 run_cmd "./createmany -o $TDIR/file- $count | grep 'total'"
159 if [ -f statmany ]; then
160 run_cmd "./statmany -s $TDIR/file- $count $((count * 5)) | \
164 for opc in w a r ; do
165 run_cmd "./smalliomany -${opc} $TDIR/file- $count 300 | \
169 run_cmd "./unlinkmany $TDIR/file- $count | grep 'total'"
174 if ! which IOR > /dev/null 2>&1 ; then
175 echo "IOR is not installed, skipping"
179 local IOR=$(which IOR)
180 local iter=$((FNUM / NUM))
182 if [ "x$DIO" == "xyes" ] ; then
188 local TDIR=${1:-$MOUNT}
191 segments=$((128 / bsize))
193 run_cmd "mpirun -np $NUM $IOR \
194 -a POSIX -b ${bsize}K -t ${bsize}K -o $TDIR/ -k \
195 -s $segments -w -r -i $iter -F -E -z -m -Z $direct"
196 # check READ performance only (no cache)
197 run_cmd "mpirun -np $NUM $IOR \
198 -a POSIX -b ${bsize}K -t ${bsize}K -o $TDIR/ -X 42\
199 -s $segments -r -i $iter -F -E -z -m -Z $direct"
206 if ! which dbench > /dev/null 2>&1 ; then
207 echo "Dbench is not installed, skipping"
211 if [ "x$DNE" == "xyes" ] ; then
212 echo "dbench uses subdirs, skipping for DNE setup"
216 local TDIR=${1:-$MOUNT}
218 run_cmd "dbench -D $TDIR $NUM | egrep -v 'warmup|execute'"
224 if ! which unzip > /dev/null 2>&1 ; then
225 echo "No unzip is installed, skipping"
229 if [ "x$DIO" == "xyes" ] ; then
230 echo "smallfile has no DIRECT IO mode, skipping"
234 if [ "x$DNE" == "xyes" ] ; then
235 echo "smallfile uses subdirs, skipping for DNE setup"
239 local host_set=$(hostname)
241 ### since smallfile is not installed system wide, get it right now
242 [ -f master.zip ] || \
243 wget https://github.com/bengland2/smallfile/archive/master.zip
245 cd ./smallfile-master
247 if ! ls ./smallfile_cli.py > /dev/null 2>&1 ; then
248 echo "No smallfile test found, skipping"
253 local TDIR=${1:-$MOUNT}
255 local fsize=64 # in Kbytes
256 local total=$FNUM # files in test
257 local fnum=$((total / NUM))
259 SYNC_DIR=${MOUNT}/sync
262 SMF="./smallfile_cli.py --pause 10 --host-set $host_set \
263 --response-times Y --threads $thrds --file-size $fsize \
264 --files $fnum --top $TDIR --network-sync-dir $SYNC_DIR \
265 --file-size-distribution exponential"
267 run_cmd "$SMF --operation create"
269 for oper in read append overwrite ; do
271 run_cmd "$SMF --record-size $bsize --operation $oper"
274 run_cmd "$SMF --operation delete"
284 echo "### Data-on-MDT files, no IO lock on open ###"
285 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=0
288 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=1
290 run_smalliomany $NORM
292 run_test smallio "Performance comparision: smallio"
297 echo "### Data-on-MDT files, NO IO lock on open ###"
298 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=0
301 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=1
302 echo "### Normal files, $OSTCOUNT OSTs ###"
306 run_test mdtest "Performance comparision: mdtest"
311 echo "### Data-on-MDT files, no IO lock on open ###"
312 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=0
315 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=1
319 run_test IOR "Performance comparision: IOR"
324 echo "### Data-on-MDT files, no IO lock on open ###"
325 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=0
328 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=1
332 run_test dbench "Performance comparision: dbench"
337 echo "### Data-on-MDT files, no IO lock on open ###"
338 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=0
341 do_facet $SINGLEMDS lctl set_param -n mdt.*.dom_lock=1
346 run_test smf "Performance comparision: smallfile"
349 check_and_cleanup_lustre