Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / tests / run-quotacheck.sh
1 #!/bin/bash
2 PATH=`dirname $0`:`dirname $0`/../utils:$PATH
3 TMP=${TMP:-/tmp}
4
5 OBD=${1:-obdfilter}
6 TARGET=`ls /proc/fs/lustre/$OBD | grep -v num_refs | head -n 1`
7 [ -z "$TARGET" ] && echo "no TARGET available, skipping quotacheck test" && exit 0
8
9 insmod ../lvfs/quotacheck_test.ko || exit 1
10 lctl modules > $TMP/ogdb-`hostname`
11 echo "NOW reload debugging syms.."
12
13 RC=0
14 lctl <<EOT || RC=2
15 newdev
16 attach quotacheck_test qchk_name qchk_uuid
17 setup $TARGET
18 EOT
19
20 # Using ignore_errors will allow lctl to cleanup even if the test fails.
21 lctl <<EOC
22 cfg_device qchk_name
23 ignore_errors
24 cleanup
25 detach
26 EOC
27 rmmod quotacheck_test || RC2=3
28 [ $RC -eq 0 -a "$RC2" ] && RC=$RC2
29
30 exit $RC