Whamcloud - gitweb
Some racy problems happened when sanity-quota.sh run on buffalo.
[fs/lustre-release.git] / lustre / tests / run-quotactl.sh
1 #!/bin/bash
2 PATH=`dirname $0`:`dirname $0`/../utils:$PATH
3 TMP=${TMP:-/tmp}
4 OBD=${1:-obdfilter}
5
6 TARGET=`ls /proc/fs/lustre/$OBD | grep -v num_refs | head -n 1`
7 [ -z "$TARGET" ] && echo "no TARGET available, skipping quotactl test" && exit 0
8
9 insmod ../lvfs/quotactl_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 quotactl_test qctl_name qctl_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 qctl_name
23 ignore_errors
24 cleanup
25 detach
26 EOC
27 rmmod quotactl_test || RC2=3
28 [ $RC -eq 0 -a "$RC2" ] && RC=$RC2
29
30 exit $RC