3 LUSTRE=${LUSTRE:-$(dirname $0)/..}
4 . $LUSTRE/tests/test-framework.sh
8 ALWAYS_EXCEPT="$LNET_SELFTEST_EXCEPT"
9 if (( $LINUX_VERSION_CODE >= $(version_code 4.4.0) )); then
10 # bug number for skipped test: LU-10073
11 ALWAYS_EXCEPT+=" smoke"
16 [ x$LST = x ] && skip_env "lst not found LST=$LST"
18 # FIXME: what is the reasonable value here?
19 lst_LOOP=${lst_LOOP:-100000}
20 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
21 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
22 if [ "$SLOW" = no ]; then
28 smoke_DURATION=${smoke_DURATION:-1800}
29 if [ "$SLOW" = no ]; then
30 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
33 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
34 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
35 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
40 # _restore_mount(): This function calls restore_mount function for "MOUNT" and
41 # "MOUNT2" paths to mount clients if they were not mounted and were umounted
42 # in this file earlier.
44 # Returns: None. Exit with error if client mount fails.
47 if $interim_umount && ! is_mounted $MOUNT; then
48 restore_mount $MOUNT || error "Restore $MOUNT failed"
51 if $interim_umount1 && ! is_mounted $MOUNT2; then
52 restore_mount $MOUNT2 || error "Restore $MOUNT2 failed"
57 lst_SERVERS=`hostname`
58 lst_CLIENTS=`hostname`
61 # FIXME: do we really need to unload lustre modules on all nodes?
62 # bug 19387, comment 9
63 # unloading lustre modules is not strictly necessary but unmounting
64 # /mnt/lustre before running lst would be useful:
65 # 1) because lustre messages clutter logs - we needn't them for testing LNET
66 # 2) it's theoretically possible that lst tests congest comm paths so tightly
67 # that mounted lustre wouldn't able to perform some of its background activities
68 if is_mounted $MOUNT; then
69 cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT"
73 if is_mounted $MOUNT2; then
74 cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2"
79 # Workaround for bug 15619
90 local nc=$(echo ${clients//,/ } | wc -w)
91 local ns=$(echo ${servers//,/ } | wc -w)
95 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
97 echo "$LST new_session --timeo 100000 hh"
98 echo "$LST add_group c $(nids_list $clients)"
99 echo "$LST add_group s $(nids_list $servers)"
100 echo "$LST add_batch b"
102 pre="$LST add_test --batch b --loop $lst_LOOP "
103 for t in "brw read" "brw write" ; do
104 for s in $lst_SIZES; do
105 for c in $lst_CONCR; do
106 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
108 echo " --concurrency $c --distribute $d $t check=full size=$s"
114 for c in $lst_CONCR; do
115 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
117 echo " --concurrency $c --distribute $d ping "
123 echo "$LST stat --delay 10 --timeout 10 c s &"
125 echo 'trap "cleanup $pid" INT TERM'
126 echo sleep $smoke_DURATION
134 export LST_SESSION=$$
145 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
147 error 'lst Error found'
154 local servers=$lst_SERVERS
155 local clients=$lst_CLIENTS
157 local runlst=$TMP/smoke.sh
159 local log=$TMP/$tfile.log
162 test_smoke_sub $servers $clients 2>&1 > $runlst
166 run_lst $runlst | tee $log
168 [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; }
170 lst_end_session --verbose | tee -a $log
172 # error counters in "lst show_error" should be checked
176 run_test smoke "lst regression test"
180 check_and_cleanup_lustre