Whamcloud - gitweb
7b819cefc786623d44385dd380f108eb72366b06
[fs/lustre-release.git] / lustre / tests / runfailure-ost
1 #!/bin/sh
2
3 set -vx
4
5 SRCDIR="`dirname $0`"
6 . $SRCDIR/common.sh
7
8 test_fail() {
9         echo $1 > /proc/sys/lustre/fail_loc
10         shift
11         echo "Running '$*'"
12         $* &
13         sleep 1
14         kill -9 $!
15
16         echo 0 > /proc/sys/lustre/fail_loc
17         umount /mnt/lustre || fail "cannot unmount /mnt/lustre"
18         setup_mount || fail "cannot remount /mnt/lustre"
19 }
20
21 [ "`mount | grep /mnt/lustre`" ] || . llsetup.sh "$@" || exit -1
22
23 # OBD_FAIL_OST_OPEN_NET: OST will discard open request packet
24 touch /mnt/lustre/foo
25 test_fail 0x208 cat /mnt/lustre/foo
26
27 echo "Done."