2 # -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
3 # vim:shiftwidth=4:softtabstop=4:tabstop=4:
5 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
6 . $LUSTRE/tests/test-framework.sh
8 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
12 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
14 if [[ $MDSCOUNT -ge 2 ]]; then
16 skip "Only run with single MDT for now" && exit
19 [ x$LST = x ] && { skip_env "lst not found LST=$LST" && exit 0; }
21 # FIXME: what is the reasonable value here?
22 lst_LOOP=${lst_LOOP:-100000}
23 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
24 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
25 if [ "$SLOW" = no ]; then
31 smoke_DURATION=${smoke_DURATION:-1800}
32 if [ "$SLOW" = no ]; then
33 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
36 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
37 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
38 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
42 local mounted=$(mounted_lustre_filesystems)
43 echo $mounted' ' | grep -w -q $mntpt' '
47 lst_SERVERS=`hostname`
48 lst_CLIENTS=`hostname`
51 # FIXME: do we really need to unload lustre modules on all nodes?
52 # bug 19387, comment 9
53 # unloading lustre modules is not strictly necessary but unmounting
54 # /mnt/lustre before running lst would be useful:
55 # 1) because lustre messages clutter logs - we needn't them for testing LNET
56 # 2) it's theoretically possible that lst tests congest comm paths so tightly
57 # that mounted lustre wouldn't able to perform some of its background activities
58 if is_mounted $MOUNT || is_mounted $MOUNT2; then
59 local_mode && CLIENTONLY=yes
61 LOAD_MODULES_REMOTE=true
68 # Workaround for bug 15619
79 local nc=$(echo ${clients//,/ } | wc -w)
80 local ns=$(echo ${servers//,/ } | wc -w)
84 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
86 echo "$LST new_session --timeo 100000 hh"
87 echo "$LST add_group c $(nids_list $clients)"
88 echo "$LST add_group s $(nids_list $servers)"
89 echo "$LST add_batch b"
91 pre="$LST add_test --batch b --loop $lst_LOOP "
92 for t in "brw read" "brw write" ; do
93 for s in $lst_SIZES; do
94 for c in $lst_CONCR; do
95 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
97 echo " --concurrency $c --distribute $d $t check=full size=$s"
103 for c in $lst_CONCR; do
104 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
106 echo " --concurrency $c --distribute $d ping "
112 echo "$LST stat --delay 10 --timeout 10 c s &"
114 echo 'trap "cleanup $pid" INT TERM'
115 echo sleep $smoke_DURATION
123 export LST_SESSION=$$
134 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
135 error 'lst Error found'
142 local servers=$lst_SERVERS
143 local clients=$lst_CLIENTS
145 local runlst=$TMP/smoke.sh
147 local log=$TMP/$tfile.log
150 test_smoke_sub $servers $clients 2>&1 > $runlst
154 run_lst $runlst | tee $log
156 [ $rc = 0 ] || error "$runlst failed: $rc"
158 lst_end_session --verbose | tee -a $log
160 # error counters in "lst show_error" should be checked
164 run_test smoke "lst regression test"
167 if [ "$RESTORE_MOUNT" = yes ]; then