Whamcloud - gitweb
Fixed some path-slash badness in common.sh, and added embryonic runfailure-ost.
authorshaver <shaver>
Mon, 1 Jul 2002 19:34:20 +0000 (19:34 +0000)
committershaver <shaver>
Mon, 1 Jul 2002 19:34:20 +0000 (19:34 +0000)
lustre/tests/common.sh
lustre/tests/runfailure-ost [new file with mode: 0755]

index fe77905..5fb608c 100644 (file)
@@ -3,8 +3,8 @@ export PATH=$PATH:/sbin:/usr/sbin
 
 [ -d /r ] && R=/r
 
-PORTALS=$SRCDIR../../portals
-LUSTRE=$SRCDIR..
+PORTALS=$SRCDIR/../../portals
+LUSTRE=$SRCDIR/..
 
 PTLCTL=$PORTALS/linux/utils/ptlctl
 DBGCTL=$PORTALS/linux/utils/debugctl
diff --git a/lustre/tests/runfailure-ost b/lustre/tests/runfailure-ost
new file mode 100755 (executable)
index 0000000..718d296
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
+
+export DEBUG_WAIT=yes
+. $SRCDIR/llsetup.sh $SRCDIR/net-local.cfg $SRCDIR/mds.cfg \
+  $SRCDIR/obdfilter.cfg $SRCDIR/client-mount.cfg $SRCDIR/ldlm.cfg || exit 2
+
+test_fail() {
+       echo $1 > /proc/sys/lustre/fail_loc
+       shift
+       echo "Running '$*'"
+       $* 
+
+       echo "Cleaning up and restarting MDS"
+       umount /mnt/lustre || fail "unable to unmount"
+       $OBDCTL <<- EOF
+       name2dev MDSDEV
+       cleanup
+       detach
+       quit
+       EOF
+
+       echo 0 > /proc/sys/lustre/fail_loc
+
+       $OBDCTL <<- EOF
+       newdev
+       attach mds MDSDEV
+       setup ${MDS} ${MDSFS}
+       quit
+       EOF
+       $MNT
+}
+
+#set -vx
+
+touch /mnt/lustre/foo
+chmod a+x /mnt/lustre/foo
+sync
+
+# OBD_FAIL_OST_OPEN_NET: OST will discard open request packet
+cp /etc/issue /mnt/lustre/foo
+test_fail 0x208 cat /mnt/lustre/foo
+
+echo "Done."