#!/bin/sh
-set -vx
+fail() {
+ echo "ERROR: $1" 1>&2
+ [ $2 ] && RC=$2 || RC=1
+ exit $RC
+}
test_fail() {
+ oldtimeout=`cat /proc/sys/lustre/timeout`
+ echo $TIMEOUT > /proc/sys/lustre/timeout
echo $1 > /proc/sys/lustre/fail_loc
shift
$* &
- sleep 1
+ sleep $TIMEOUT
+ sleep 2 # fudge
kill -9 $!
+ echo $oldtimeout > /proc/sys/lustre/timeout
echo 0 > /proc/sys/lustre/fail_loc
- umount /mnt/lustre
- mount -t lustre_lite -o device=3 none /mnt/lustre
+ umount -f /mnt/lustre || fail "cannot unmount /mnt/lustre"
+ mount -t lustre_lite -o "osc=$OSC,mdc=$MDC" none /mnt/lustre || \
+ fail "cannot remount $OSC/$MDC on /mnt/lustre"
}
-mknod /dev/request c 10 244
+set -vx
+
+LCTL=../utils/lctl
+OSC=OSC_localhost_UUID
+MDC=MDC_client1_UUID
+TIMEOUT=5 # complete in finite time
-sh llmount.sh
+[ "`mount | grep /mnt/lustre`" ] || echo | sh llmount.sh || exit -1
# GETATTR_NET - ls will hang on the getattr
-test_fail 0x102 ls -l /mnt/lustre
+# test_fail 0x102 ls -l /mnt/lustre
# READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
test_fail 0x104 ls /mnt/lustre