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 [ x$LST = x ] && { skip_env "lst not found LST=$LST" && exit 0; }
16 # FIXME: what is the reasonable value here?
17 lst_LOOP=${lst_LOOP:-100000}
18 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
19 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
20 if [ "$SLOW" = no ]; then
26 smoke_DURATION=${smoke_DURATION:-1800}
27 if [ "$SLOW" = no ]; then
28 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
31 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
32 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
33 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
37 local mounted=$(mounted_lustre_filesystems)
38 echo $mounted' ' | grep -w -q $mntpt' '
42 lst_SERVERS=`hostname`
43 lst_CLIENTS=`hostname`
46 # FIXME: do we really need to unload lustre modules on all nodes?
47 # bug 19387, comment 9
48 # unloading lustre modules is not strictly necessary but unmounting
49 # /mnt/lustre before running lst would be useful:
50 # 1) because lustre messages clutter logs - we needn't them for testing LNET
51 # 2) it's theoretically possible that lst tests congest comm paths so tightly
52 # that mounted lustre wouldn't able to perform some of its background activities
53 if is_mounted $MOUNT || is_mounted $MOUNT2; then
54 local_mode && CLIENTONLY=yes
62 # Workaround for bug 15619
73 local nc=$(echo ${clients//,/ } | wc -w)
74 local ns=$(echo ${servers//,/ } | wc -w)
78 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
80 echo "$LST new_session --timeo 100000 hh"
81 echo "$LST add_group c $(nids_list $clients)"
82 echo "$LST add_group s $(nids_list $servers)"
83 echo "$LST add_batch b"
85 pre="$LST add_test --batch b --loop $lst_LOOP "
86 for t in "brw read" "brw write" ; do
87 for s in $lst_SIZES; do
88 for c in $lst_CONCR; do
89 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
91 echo " --concurrency $c --distribute $d $t check=full size=$s"
97 for c in $lst_CONCR; do
98 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
100 echo " --concurrency $c --distribute $d ping "
106 echo "$LST stat --delay 10 --timeout 10 c s &"
108 echo 'trap "cleanup $pid" INT TERM'
109 echo sleep $smoke_DURATION
117 export LST_SESSION=$$
128 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
129 error 'lst Error found'
136 local servers=$lst_SERVERS
137 local clients=$lst_CLIENTS
139 local runlst=$TMP/smoke.sh
141 local log=$TMP/$tfile.log
144 test_smoke_sub $servers $clients 2>&1 > $runlst
148 run_lst $runlst | tee $log
150 [ $rc = 0 ] || error "$runlst failed: $rc"
152 lst_end_session --verbose | tee -a $log
154 # error counters in "lst show_error" should be checked
158 run_test smoke "lst regression test"
161 if [ "$RESTORE_MOUNT" = yes ]; then