Whamcloud - gitweb
LU-1347 style: removes obsolete EXPORT_SYMTAB macros
[fs/lustre-release.git] / lustre / tests / run-llog.sh
1 #!/bin/bash
2
3 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
4
5 load_llog_test() {
6     grep -q llog_test /proc/modules && return
7     # Module should have been placed with other lustre modules...
8     modprobe llog_test 2>&1 | grep -v "llog_test not found"
9     grep -q llog_test /proc/modules && return
10     # But maybe we're running from a developer tree...
11     insmod $LUSTRE/obdclass/llog_test.ko
12     grep -q llog_test /proc/modules && return
13     # This is for 2.4 kernels (deprecated!)
14     insmod $LUSTRE/obdclass/llog_test.o
15     grep -q llog_test /proc/modules && return
16     echo "Unable to load llog_test module!"
17     false
18     return
19 }
20
21 PATH=`dirname $0`:$LUSTRE/utils:$PATH
22 TMP=${TMP:-/tmp}
23
24 MGS=`lctl dl | awk '/mgs/ { print $4 }'`
25 [ -z "$MGS" ] && echo "$0: SKIP: no MGS available, skipping llog test" && exit 0
26
27 load_llog_test || exit 0
28 lctl modules > $TMP/ogdb-`hostname`
29 echo "NOW reload debugging syms.."
30
31 RC=0
32 lctl <<EOT || RC=2
33 attach llog_test llt_name llt_uuid
34 setup $MGS
35 EOT
36
37 # Using ignore_errors will allow lctl to cleanup even if the test fails.
38 lctl <<EOC
39 device llt_name
40 ignore_errors
41 cleanup
42 detach
43 EOC
44 rmmod llog_test || RC2=3
45 [ $RC -eq 0 -a "$RC2" ] && RC=$RC2
46
47 exit $RC