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)")}
38 # _restore_mount(): This function calls restore_mount function for "MOUNT" and
39 # "MOUNT2" paths to mount clients if they were not mounted and were umounted
40 # in this file earlier.
42 # Returns: None. Exit with error if client mount fails.
45 if $interim_umount && ! is_mounted $MOUNT; then
46 restore_mount $MOUNT || error "Restore $MOUNT failed"
49 if $interim_umount1 && ! is_mounted $MOUNT2; then
50 restore_mount $MOUNT2 || error "Restore $MOUNT2 failed"
56 local mounted=$(mounted_lustre_filesystems)
57 echo $mounted' ' | grep -w -q $mntpt' '
61 lst_SERVERS=`hostname`
62 lst_CLIENTS=`hostname`
65 # FIXME: do we really need to unload lustre modules on all nodes?
66 # bug 19387, comment 9
67 # unloading lustre modules is not strictly necessary but unmounting
68 # /mnt/lustre before running lst would be useful:
69 # 1) because lustre messages clutter logs - we needn't them for testing LNET
70 # 2) it's theoretically possible that lst tests congest comm paths so tightly
71 # that mounted lustre wouldn't able to perform some of its background activities
72 if is_mounted $MOUNT; then
73 cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT"
77 if is_mounted $MOUNT2; then
78 cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2"
85 # Workaround for bug 15619
96 local nc=$(echo ${clients//,/ } | wc -w)
97 local ns=$(echo ${servers//,/ } | wc -w)
101 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
103 echo "$LST new_session --timeo 100000 hh"
104 echo "$LST add_group c $(nids_list $clients)"
105 echo "$LST add_group s $(nids_list $servers)"
106 echo "$LST add_batch b"
108 pre="$LST add_test --batch b --loop $lst_LOOP "
109 for t in "brw read" "brw write" ; do
110 for s in $lst_SIZES; do
111 for c in $lst_CONCR; do
112 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
114 echo " --concurrency $c --distribute $d $t check=full size=$s"
120 for c in $lst_CONCR; do
121 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
123 echo " --concurrency $c --distribute $d ping "
129 echo "$LST stat --delay 10 --timeout 10 c s &"
131 echo 'trap "cleanup $pid" INT TERM'
132 echo sleep $smoke_DURATION
140 export LST_SESSION=$$
151 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
153 error 'lst Error found'
160 local servers=$lst_SERVERS
161 local clients=$lst_CLIENTS
163 local runlst=$TMP/smoke.sh
165 local log=$TMP/$tfile.log
168 test_smoke_sub $servers $clients 2>&1 > $runlst
172 run_lst $runlst | tee $log
174 [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; }
176 lst_end_session --verbose | tee -a $log
178 # error counters in "lst show_error" should be checked
182 run_test smoke "lst regression test"