3 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
4 . $LUSTRE/tests/test-framework.sh
6 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
10 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
12 [ x$LST = x ] && { skip_env "$0 : lst not found LST=$LST" && exit 0; }
14 # FIXME: what is the reasonable value here?
15 lst_LOOP=${lst_LOOP:-100000}
16 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
17 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
18 if [ "$SLOW" = no ]; then
24 smoke_DURATION=${smoke_DURATION:-1800}
25 if [ "$SLOW" = no ]; then
26 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
29 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
30 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
31 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
35 local mounted=$(mounted_lustre_filesystems)
36 echo $mounted' ' | grep -w -q $mntpt' '
40 lst_SERVERS=`hostname`
41 lst_CLIENTS=`hostname`
44 # FIXME: do we really need to unload lustre modules on all nodes?
45 # bug 19387, comment 9
46 # unloading lustre modules is not strictly necessary but unmounting
47 # /mnt/lustre before running lst would be useful:
48 # 1) because lustre messages clutter logs - we needn't them for testing LNET
49 # 2) it's theoretically possible that lst tests congest comm paths so tightly
50 # that mounted lustre wouldn't able to perform some of its background activities
51 if is_mounted $MOUNT || is_mounted $MOUNT2; then
52 local_mode && CLIENTONLY=yes
60 # Workaround for bug 15619
71 local nc=$(echo ${clients//,/ } | wc -w)
72 local ns=$(echo ${servers//,/ } | wc -w)
76 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
78 echo "$LST new_session --timeo 100000 hh"
79 echo "$LST add_group c $(nids_list $clients)"
80 echo "$LST add_group s $(nids_list $servers)"
81 echo "$LST add_batch b"
83 pre="$LST add_test --batch b --loop $lst_LOOP "
84 for t in "brw read" "brw write" ; do
85 for s in $lst_SIZES; do
86 for c in $lst_CONCR; do
87 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
89 echo " --concurrency $c --distribute $d $t check=full size=$s"
95 for c in $lst_CONCR; do
96 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
98 echo " --concurrency $c --distribute $d ping "
104 echo "$LST stat --delay 10 --timeout 10 c s &"
106 echo 'trap "cleanup $pid" INT TERM'
107 echo sleep $smoke_DURATION
115 export LST_SESSION=$$
126 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
127 error 'lst Error found'
134 local servers=$lst_SERVERS
135 local clients=$lst_CLIENTS
137 local runlst=$TMP/smoke.sh
139 local log=$TMP/$tfile.log
142 test_smoke_sub $servers $clients 2>&1 > $runlst
146 run_lst $runlst | tee $log
148 [ $rc = 0 ] || error "$runlst failed: $rc"
150 lst_end_session --verbose | tee -a $log
152 # error counters in "lst show_error" should be checked
156 run_test smoke "lst regression test"
158 complete $(basename $0) $SECONDS
159 if [ "$RESTORE_MOUNT" = yes ]; then