Whamcloud - gitweb
- fixes in sanity tests.
[fs/lustre-release.git] / lustre / tests / run-llog.sh
1 #!/bin/bash
2 PATH=`dirname $0`:`dirname $0`/../utils:$PATH
3 TMP=${TMP:-/tmp}
4
5 MDS=`ls /proc/fs/lustre/mdt | grep -v num_refs | head -n 1`
6 [ -z "$MDS" ] && echo "no MDS available, skipping llog test" && exit 0
7
8 case `uname -r` in
9 2.4.*) modprobe llog_test || exit 1 ;;
10 2.6.*) modprobe llog_test || exit 1 ;;
11 *) echo "unknown kernel version `uname -r`" && exit 99 ;;
12 esac
13 lctl modules > $TMP/ogdb-`hostname`
14 echo "NOW reload debugging syms.."
15
16 RC=0
17 lctl <<EOT || RC=2
18 newdev
19 attach llog_test llt_name llt_uuid
20 setup $MDS
21 EOT
22
23 # Using ignore_errors will allow lctl to cleanup even if the test fails.
24 lctl <<EOC
25 cfg_device llt_name
26 ignore_errors
27 cleanup
28 detach
29 EOC
30 rmmod llog_test || RC2=3
31 [ $RC -eq 0 -a "$RC2" ] && RC=$RC2
32
33 exit $RC