Whamcloud - gitweb
- added standard CFS headers in some source files.
[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=`find /proc/fs/lustre/mds/* -type d | head -n1 | sed 's/.*\///'`
6 [ -z "$MDS" ] && echo "no MDS available, skipping llog test" && exit 0
7
8 insmod ../obdclass/llog_test.o || exit 1
9 lctl modules > $TMP/ogdb-`hostname`
10
11 # take care of UML developers
12 [ -f /r/$TMP/ogdb-`hostname` ] && 
13     cp -f $TMP/ogdb-`hostname` /r/$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