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