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"
66 local mounted=$(mounted_lustre_filesystems)
67 echo $mounted' ' | grep -w -q $mntpt' '
71 lst_SERVERS=`hostname`
72 lst_CLIENTS=`hostname`
75 # FIXME: do we really need to unload lustre modules on all nodes?
76 # bug 19387, comment 9
77 # unloading lustre modules is not strictly necessary but unmounting
78 # /mnt/lustre before running lst would be useful:
79 # 1) because lustre messages clutter logs - we needn't them for testing LNET
80 # 2) it's theoretically possible that lst tests congest comm paths so tightly
81 # that mounted lustre wouldn't able to perform some of its background activities
82 if is_mounted $MOUNT; then
83 cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT"
87 if is_mounted $MOUNT2; then
88 cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2"
93 # Workaround for bug 15619
104 local nc=$(echo ${clients//,/ } | wc -w)
105 local ns=$(echo ${servers//,/ } | wc -w)
109 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
111 echo "$LST new_session --timeo 100000 hh"
112 echo "$LST add_group c $(nids_list $clients)"
113 echo "$LST add_group s $(nids_list $servers)"
114 echo "$LST add_batch b"
116 pre="$LST add_test --batch b --loop $lst_LOOP "
117 for t in "brw read" "brw write" ; do
118 for s in $lst_SIZES; do
119 for c in $lst_CONCR; do
120 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
122 echo " --concurrency $c --distribute $d $t check=full size=$s"
128 for c in $lst_CONCR; do
129 for d in "${nc}:${ns} --from c --to s" "${ns}:${nc} --from s --to c"; do
131 echo " --concurrency $c --distribute $d ping "
137 echo "$LST stat --delay 10 --timeout 10 c s &"
139 echo 'trap "cleanup $pid" INT TERM'
140 echo sleep $smoke_DURATION
148 export LST_SESSION=$$
159 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
161 error 'lst Error found'
168 local servers=$lst_SERVERS
169 local clients=$lst_CLIENTS
171 local runlst=$TMP/smoke.sh
173 local log=$TMP/$tfile.log
176 test_smoke_sub $servers $clients 2>&1 > $runlst
180 run_lst $runlst | tee $log
182 [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; }
184 lst_end_session --verbose | tee -a $log
186 # error counters in "lst show_error" should be checked
190 run_test smoke "lst regression test"
194 check_and_cleanup_lustre