Whamcloud - gitweb
- minor further changes to the test script:
[fs/lustre-release.git] / lustre / tests / runfailure-net
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         $* &
12         sleep 1
13         kill -9 $!
14
15         echo 0 > /proc/sys/lustre/fail_loc
16         umount /mnt/lustre || exit 1
17         mount -t lustre_lite -o device=`$OBDCTL name2dev OSCDEV` none /mnt/lustre || exit 1
18 }
19
20 [ -c /dev/request ] || mknod /dev/request c 10 244
21
22 echo | sh llmount.sh || exit -1
23
24 # GETATTR_NET - ls will hang on the getattr
25 test_fail 0x102 ls -l /mnt/lustre
26
27 # READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
28 test_fail 0x104 ls /mnt/lustre
29
30 sleep 1
31
32 # REINT_NET - touch will hang on setattr
33 test_fail 0x107 touch /mnt/lustre
34
35 # REINT_NET - touch will hang on create
36 test_fail 0x107 touch /mnt/lustre/tt
37
38 # REINT_NET - mv will hang on rename
39 touch /mnt/lustre/foo
40 test_fail 0x107 mv /mnt/lustre/foo /mnt/lustre/bar
41
42 # REINT_NET - rm will hang on unlink
43 touch /mnt/lustre/salmon
44 test_fail 0x107 rm /mnt/lustre/salmon
45
46 # OPEN_NET - touch will hang on open
47 touch /mnt/lustre/foo
48 test_fail 0x113 cat /mnt/lustre/foo
49
50 # CLOSE_NET - ls will hang on close
51 test_fail 0x115 ./testreq --close junk_file_handle
52
53 echo 0 > /proc/sys/lustre/fail_loc
54
55 echo "Done."