3 LUSTRE=${LUSTRE:-$(dirname $0)/..}
4 . $LUSTRE/tests/test-framework.sh
8 ALWAYS_EXCEPT="$LNET_SELFTEST_EXCEPT"
12 [ x$LST = x ] && skip_env "lst not found LST=$LST"
14 # FIXME: what is the reasonable value here?
15 lst_LOOP=${lst_LOOP:-100000}
16 lst_CONCR=${lst_CONCR:-"1 2 4 8"}
17 lst_SIZES=${lst_SIZES:-"4k 8k 256k 1M"}
18 if [ "$SLOW" = no ]; then
24 smoke_DURATION=${smoke_DURATION:-1800}
25 if [ "$SLOW" = no ]; then
26 [ $smoke_DURATION -le 300 ] || smoke_DURATION=300
29 lst_TESTS=${lst_TESTS:-"write read ping"}
31 # "none" -> LST_BRW_CHECK_NONE
32 # "full" -> LST_BRW_CHECK_FULL
33 # "simple" -> LST_BRW_CHECK_SIMPLE
34 lst_CHECK=${lst_CHECK:-"full"}
36 lst_FROM=${lst_FROM:-"cs"}
39 full|simple) check="check=$lst_CHECK";;
41 *) error Unknown flag $lst_CHECK;;
44 LOAD_MODULES_REMOTE=true load_modules
46 nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
47 lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
48 lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
53 # _restore_mount(): This function calls restore_mount function for "MOUNT" and
54 # "MOUNT2" paths to mount clients if they were not mounted and were umounted
55 # in this file earlier.
57 # Returns: None. Exit with error if client mount fails.
60 if $interim_umount && ! is_mounted $MOUNT; then
61 restore_mount $MOUNT || error "Restore $MOUNT failed"
64 if $interim_umount1 && ! is_mounted $MOUNT2; then
65 restore_mount $MOUNT2 || error "Restore $MOUNT2 failed"
70 lst_SERVERS=`hostname`
71 lst_CLIENTS=`hostname`
74 # FIXME: do we really need to unload lustre modules on all nodes?
75 # bug 19387, comment 9
76 # unloading lustre modules is not strictly necessary but unmounting
77 # /mnt/lustre before running lst would be useful:
78 # 1) because lustre messages clutter logs - we needn't them for testing LNET
79 # 2) it's theoretically possible that lst tests congest comm paths so tightly
80 # that mounted lustre wouldn't able to perform some of its background activities
81 if is_mounted $MOUNT; then
82 cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT"
86 if is_mounted $MOUNT2; then
87 cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2"
92 # Workaround for bug 15619
102 local nc=$(echo ${clients//,/ } | wc -w)
103 local ns=$(echo ${servers//,/ } | wc -w)
107 echo 'cleanup () { trap 0; echo killing $1 ... ; kill -9 $1 || true; }'
109 echo "$LST new_session --timeo 100000 hh"
110 echo "$LST add_group c $(nids_list $clients)"
111 echo "$LST add_group s $(nids_list $servers)"
112 echo "$LST add_batch b"
117 c) tests[0]="${nc}:${ns} --from c --to s";;
118 s) tests[0]="${ns}:${nc} --from s --to c";;
119 cs)tests[0]="${nc}:${ns} --from c --to s"
120 tests[1]="${ns}:${nc} --from s --to c";;
121 *) error Unknown flag $lst_FROM;;
124 pre="$LST add_test --batch b --loop $lst_LOOP "
125 for t in $lst_TESTS; do
126 for s in $lst_SIZES; do
127 for c in $lst_CONCR; do
128 for ((i=0; i<${#tests[@]}; i++)); do
129 echo -n "$pre --concurrency $c"\
130 " --distribute ${tests[i]} "
137 *) error Unknonwn LST test;;
147 echo "$LST stat --delay 10 --timeout 10 c s &"
149 echo 'trap "cleanup $pid" INT TERM'
150 echo sleep $smoke_DURATION
157 export LST_SESSION=$$
168 if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then
170 error 'lst Error found'
177 local servers=$lst_SERVERS
178 local clients=$lst_CLIENTS
180 local runlst=$TMP/smoke.sh
182 local log=$TMP/$tfile.log
185 test_smoke_sub $servers $clients 2>&1 > $runlst
189 run_lst $runlst | tee $log
191 [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; }
193 lst_end_session --verbose | tee -a $log
195 # error counters in "lst show_error" should be checked
199 run_test smoke "lst regression test"
203 check_and_cleanup_lustre