3 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
4 . $LUSTRE/tests/test-framework.sh
6 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
9 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
11 [ x$LST = x ] && { skip_env "$0 : lst not found LST=$LST" && exit 0; }
13 # FIXME: what is the reasonable value here?
14 lst_LOOP=${lst_LOOP:-100000}
15 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
16 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
17 if [ "$SLOW" = no ]; then
23 smoke_DURATION=${smoke_DURATION:-1800}
24 if [ "$SLOW" = no ]; then
25 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
28 lst_SERVERS=${lst_SERVERS:-$(comma_list $(osts_nodes) $(mdts_nodes))}
29 lst_CLIENTS=${lst_CLIENTS:-${CLIENTS:-`hostname`}}
33 local mounted=$(mounted_lustre_filesystems)
34 echo $mounted' ' | grep -w -q $mntpt' '
38 lst_SERVERS=`hostname`
39 lst_CLIENTS=`hostname`
42 # FIXME: do we really need to unload lustre modules on all nodes?
43 # bug 19387, comment 9
44 # unloading lustre modules is not strictly necessary but unmounting
45 # /mnt/lustre before running lst would be useful:
46 # 1) because lustre messages clutter logs - we needn't them for testing LNET
47 # 2) it's theoretically possible that lst tests congest comm paths so tightly
48 # that mounted lustre wouldn't able to perform some of its background activities
49 if is_mounted $MOUNT || is_mounted $MOUNT2; then
50 local_mode && CLIENTONLY=yes
58 # Workaround for bug 15619
69 local nc=$(echo ${clients//,/ } | wc -w)
70 local ns=$(echo ${servers//,/ } | wc -w)
74 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
76 echo "$LST new_session --timeo 100000 hh"
77 echo "$LST add_group c $(nids_list $clients)"
78 echo "$LST add_group s $(nids_list $servers)"
79 echo "$LST add_batch b"
81 pre="$LST add_test --batch b --loop $lst_LOOP "
82 for t in "brw read" "brw write" ; do
83 for s in $lst_SIZES; do
84 for c in $lst_CONCR; do
85 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
87 echo " --concurrency $c --distribute $d $t check=full size=$s"
93 for c in $lst_CONCR; do
94 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
96 echo " --concurrency $c --distribute $d ping "
102 echo "$LST stat --delay 10 c s &"
104 echo 'trap "cleanup $pid" INT TERM'
105 echo sleep $smoke_DURATION
113 export LST_SESSION=$$
124 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
125 error 'lst Error found'
132 local servers=$lst_SERVERS
133 local clients=$lst_CLIENTS
135 local runlst=$TMP/smoke.sh
137 local log=$TMP/$tfile.log
140 test_smoke_sub $servers $clients 2>&1 > $runlst
144 run_lst $runlst | tee $log
146 [ $rc = 0 ] || error "$runlst failed: $rc"
148 lst_end_session --verbose | tee -a $log
150 # error counters in "lst show_error" should be checked
154 run_test smoke "lst regression test"
156 equals_msg `basename $0`: test complete, cleaning up
157 if [ "$RESTORE_MOUNT" = yes ]; then
160 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true