Whamcloud - gitweb
Add mds filesystem helper modules to setup and cleanup.
[fs/lustre-release.git] / lustre / tests / runfailure-client-mds-recover.sh
1 #!/bin/sh
2 SRCDIR=.
3
4 . common.sh
5
6 reconnect () { 
7
8 $OBDCTL <<EOF
9 name2dev RPCDEV
10 newconn
11 quit
12 EOF
13
14 }
15
16 echo 
17 echo "Test 5 reopen a file:" `date` "creating and writing/mnt/lustre/foo"
18 echo
19 rm -rf /mnt/lustre/*
20 ./openme /mnt/lustre/foo3 & 
21 ./writeme /mnt/lustre/iogoeson & 
22 sleep 1
23 ls -l /mnt/lustre
24 echo 0x80000107 > /proc/sys/lustre/fail_loc
25 mknod /mnt/lustre/dev c 10 240 &
26 echo "MDS dropped create request -- sleep 4 secs - watch for timeout"
27 sleep 4
28 reconnect
29 sleep 1
30 echo "did things recover? check for file foo, bar, check log for reopen."
31 ls -l /mnt/lustre
32 echo "Test 5 done"
33
34 exit
35
36 echo 
37 echo "Test 1 drop request:" `date` "creating /mnt/lustre/foo"
38 echo
39 rm -rf /mnt/lustre/*
40 echo 0x80000107 > /proc/sys/lustre/fail_loc
41 touch /mnt/lustre/foo &
42 ps axww | grep touch
43 echo "MDS dropped create request -- sleep 4 secs - watch for timeout"
44 sleep 4
45 reconnect
46 sleep 1
47 echo "did things recover? check for file foo."
48 ls -l /mnt/lustre
49
50
51 echo
52 echo "Test 2 test delay queue:" `date` "creating /mnt/lustre/foo"
53 echo
54 rm -rf /mnt/lustre/*
55 mkdir /mnt/lustre/a
56 echo 0x80000107 > /proc/sys/lustre/fail_loc
57 touch /mnt/lustre/foo &
58 ps axww | grep touch
59 echo "MDS dropped create request -- sleep 4 secs - watch for timeout"
60 sleep 4
61 touch /mnt/lustre/a/f &
62 reconnect
63 sleep 1
64 echo "did things recover? check for file foo and a/f"
65 ls -l /mnt/lustre
66 ls -l /mnt/lustre/a
67
68 echo
69 echo "Test 4 dropped reply:" `date` "creating /mnt/lustre/foo2"
70 echo
71 rm -rf /mnt/lustre/*
72 echo 0x80000119 > /proc/sys/lustre/fail_loc
73 touch /mnt/lustre/foo2 &
74 ps axww | grep touch
75 echo "MDS dropped create request -- sleep 4 secs - watch for timeout"
76 sleep 4
77 reconnect
78 echo failure cleared
79 sleep 1
80 echo "did things recover? check for file foo2"
81 ls -l /mnt/lustre
82
83
84
85 exit
86
87 echo
88 echo "Test 3: Multiple failures"
89 echo
90 echo 0x0000107 > /proc/sys/lustre/fail_loc
91 touch /mnt/lustre/bar &
92 ps axww | grep touch
93 echo "touch program will have repeated failures sleeping 10"
94 sleep 10
95 echo 0 > /proc/sys/lustre/fail_loc
96 reconnect
97 sleep 1
98 echo "failure cleared"
99 echo "did things recover? Check for file bar"
100 ls -l /mnt/lustre/bar
101
102