3 LUSTRE=${LUSTRE:-$(dirname $0)/..}
4 . $LUSTRE/tests/test-framework.sh
8 ALWAYS_EXCEPT="$LNET_SELFTEST_EXCEPT"
9 if [[ $(uname -m) = aarch64 ]]; then
10 # bug number for skipped test: LU-10073
11 ALWAYS_EXCEPT+=" smoke"
14 # Check if running on Ubuntu client
15 if [ -r /etc/os-release ]; then
16 if grep -qi ubuntu /etc/os-release; then
17 # bug number for skipped test: LU-10073
18 ALWAYS_EXCEPT+=" smoke"
24 [ x$LST = x ] && skip_env "lst not found LST=$LST"
26 # FIXME: what is the reasonable value here?
27 lst_LOOP=${lst_LOOP:-100000}
28 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
29 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
30 if [ "$SLOW" = no ]; then
36 smoke_DURATION=${smoke_DURATION:-1800}
37 if [ "$SLOW" = no ]; then
38 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
41 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
42 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
43 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
48 # _restore_mount(): This function calls restore_mount function for "MOUNT" and
49 # "MOUNT2" paths to mount clients if they were not mounted and were umounted
50 # in this file earlier.
52 # Returns: None. Exit with error if client mount fails.
55 if $interim_umount && ! is_mounted $MOUNT; then
56 restore_mount $MOUNT || error "Restore $MOUNT failed"
59 if $interim_umount1 && ! is_mounted $MOUNT2; then
60 restore_mount $MOUNT2 || error "Restore $MOUNT2 failed"
65 lst_SERVERS=`hostname`
66 lst_CLIENTS=`hostname`
69 # FIXME: do we really need to unload lustre modules on all nodes?
70 # bug 19387, comment 9
71 # unloading lustre modules is not strictly necessary but unmounting
72 # /mnt/lustre before running lst would be useful:
73 # 1) because lustre messages clutter logs - we needn't them for testing LNET
74 # 2) it's theoretically possible that lst tests congest comm paths so tightly
75 # that mounted lustre wouldn't able to perform some of its background activities
76 if is_mounted $MOUNT; then
77 cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT"
81 if is_mounted $MOUNT2; then
82 cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2"
87 # Workaround for bug 15619
98 local nc=$(echo ${clients//,/ } | wc -w)
99 local ns=$(echo ${servers//,/ } | wc -w)
103 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
105 echo "$LST new_session --timeo 100000 hh"
106 echo "$LST add_group c $(nids_list $clients)"
107 echo "$LST add_group s $(nids_list $servers)"
108 echo "$LST add_batch b"
110 pre="$LST add_test --batch b --loop $lst_LOOP "
111 for t in "brw read" "brw write" ; do
112 for s in $lst_SIZES; do
113 for c in $lst_CONCR; do
114 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
116 echo " --concurrency $c --distribute $d $t check=full size=$s"
122 for c in $lst_CONCR; do
123 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
125 echo " --concurrency $c --distribute $d ping "
131 echo "$LST stat --delay 10 --timeout 10 c s &"
133 echo 'trap "cleanup $pid" INT TERM'
134 echo sleep $smoke_DURATION
142 export LST_SESSION=$$
153 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
155 error 'lst Error found'
162 local servers=$lst_SERVERS
163 local clients=$lst_CLIENTS
165 local runlst=$TMP/smoke.sh
167 local log=$TMP/$tfile.log
170 test_smoke_sub $servers $clients 2>&1 > $runlst
174 run_lst $runlst | tee $log
176 [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; }
178 lst_end_session --verbose | tee -a $log
180 # error counters in "lst show_error" should be checked
184 run_test smoke "lst regression test"
188 check_and_cleanup_lustre