Whamcloud - gitweb
osc/osc_request.c: replace "n" with "pages", as "n" is not defined anywhere.
[fs/lustre-release.git] / lustre / tests / runfailure-net
1 #!/bin/sh
2
3 set -vx
4
5 test_fail() {
6         echo $1 > /proc/sys/lustre/fail_loc
7         shift
8         $* &
9         sleep 1
10         kill -9 $!
11
12         echo 0 > /proc/sys/lustre/fail_loc
13         umount /mnt/lustre
14         mount -t lustre_lite -o device=3 none /mnt/lustre
15 }
16
17 [ -c /dev/request ] || mknod /dev/request c 10 244
18
19 echo | sh llmount.sh || exit -1
20
21 # GETATTR_NET - ls will hang on the getattr
22 test_fail 0x102 ls -l /mnt/lustre
23
24 # READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
25 test_fail 0x104 ls /mnt/lustre
26
27 sleep 1
28
29 # REINT_NET - touch will hang on setattr
30 test_fail 0x107 touch /mnt/lustre
31
32 # REINT_NET - touch will hang on create
33 test_fail 0x107 touch /mnt/lustre/tt
34
35 # REINT_NET - mv will hang on rename
36 touch /mnt/lustre/foo
37 test_fail 0x107 mv /mnt/lustre/foo /mnt/lustre/bar
38
39 # REINT_NET - rm will hang on unlink
40 touch /mnt/lustre/salmon
41 test_fail 0x107 rm /mnt/lustre/salmon
42
43 # OPEN_NET - touch will hang on open
44 touch /mnt/lustre/foo
45 test_fail 0x113 cat /mnt/lustre/foo
46
47 # CLOSE_NET - ls will hang on close
48 test_fail 0x115 ./testreq --close junk_file_handle
49
50 echo 0 > /proc/sys/lustre/fail_loc
51
52 echo "Done."