601f811564b6b37503da0219d75cab6ee0407e20
[xfstests-dev.git] / dmapi / src / suite2 / data / nfs.dat
1 //
2 // Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3 // 
4 // This program is free software; you can redistribute it and/or modify it
5 // under the terms of version 2 of the GNU General Public License as
6 // published by the Free Software Foundation.
7 // 
8 // This program is distributed in the hope that it would be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 // 
12 // Further, this software is distributed without any warranty that it is
13 // free of the rightful claim of any third person regarding infringement
14 // or the like.  Any license provided herein, whether implied or
15 // otherwise, applies only to this software file.  Patent licenses, if
16 // any, provided herein do not apply to combinations of this program with
17 // other software, or any other product whatsoever.
18 // 
19 // You should have received a copy of the GNU General Public License along
20 // with this program; if not, write the Free Software Foundation, Inc., 59
21 // Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 // 
23 // Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 // Mountain View, CA  94043, or:
25 // 
26 // http://www.sgi.com 
27 // 
28 // For further information regarding this notice, see: 
29 // 
30 // http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31
32 // This test will use the following files:
33 //
34 ctf stf ls_to_copy ctest.c
35 fcntl open_test truncate rd wf 
36 set_region set_return_on_destroy 
37 --------------------------------------------
38 // These setup commands are run before the daemon starts.
39 // They reset the file structure of the test directory
40 // to a known state.
41 //
42 rm $real_dir/???
43 $1/ctf $1 $real_dir
44 $1/stf $1 $real_dir/l??
45 chown $lname $real_dir/l??
46 $1/set_return_on_destroy $real_dir test
47 --------------------------------------------
48 @@ Aborted events testing (1 of 7):
49 @@    Bring ls0 across NFS, causing it to be cached.
50 @@
51 $1/open_test $2/ls0 o_rdwr
52 event_count 1
53 event[0] read
54 --------------------------------------------
55 @@ Aborted events testing (2 of 7):
56 @@    Set the daemon to halt events with DM_RESP_ABORT
57 @@    and errno EEXIST. 
58 @@
59 run_as_root
60 $1/send_msg unfriendly_17
61 event_count 1
62 event[0] user
63 msg_str[0] unfriendly_17
64 --------------------------------------------
65 @@ Aborted events testing (3 of 7):
66 @@    Try to read ls0.  Since it is cached, this should succeed.
67 @@    and should not generate any events.
68 @@
69 $1/open_test $2/ls0 o_rdwr
70 event_count 0
71 --------------------------------------------
72 @@ Aborted events testing (4 of 7):
73 @@    Try to read ls1.  This should fail with EEXIST.
74 @@
75 $1/open_test $2/ls1 o_rdwr o_trunc
76 event_count 1
77 event[0] truncate
78 failure
79 --------------------------------------------
80 @@ Aborted events testing (5 of 7):
81 @@    Reset the daemon to respond with DM_RESP_CONTINUE.
82 @@
83 run_as_root
84 $1/send_msg friendly
85 event_count 1
86 event[0] user
87 msg_str[0] friendly
88 --------------------------------------------
89 @@ Aborted events testing (6 of 7):
90 @@    Again, try to read ls0.  It will be in the cache, 
91 @@    so no events should occur.
92 @@
93 $1/open_test $2/ls0 o_rdwr
94 event_count 0
95 --------------------------------------------
96 @@ Aborted events testing (7 of 7):
97 @@    Again, try to read ls1.  This time, 
98 @@    it should succeed.
99 @@
100 $1/open_test $2/ls1 o_rdwr o_trunc
101 event_count 2
102 event[0] truncate
103 event[1] attribute
104 --------------------------------------------
105 @@ dm_send_msg test
106 @@
107 run_as_root
108 $1/send_msg dmapi-test-foo-abc123
109 event_count 1
110 event[0] user
111 msg_str[0] dmapi-test-foo-abc123
112 --------------------------------------------
113 @@ NFS test:  DM_RESP_ABORT (1 of 3)
114 @@
115 // For the next two events, respond with
116 // DM_RESP_ABORT and errno 4  The first 
117 // open test of ls1 should fail; the
118 // second should succeed.
119 //
120 run_as_root
121 $1/send_msg countdown_2_4
122 event_count 1
123 event[0] user
124 msg_str[0] countdown_2_4
125 --------------------------------------------
126 @@ NFS test:  DM_RESP_ABORT (2 of 3)
127 @@
128 $1/open_test $2/ls2 o_rdwr
129 event_count 1
130 event[0] read
131 failure
132 --------------------------------------------
133 @@ NFS test:  DM_RESP_ABORT (3 of 3)
134 @@
135 $1/open_test $2/ls2 o_rdwr
136 event_count 1
137 event[0] read
138 --------------------------------------------
139 @@ NFS test:  EAGAIN (1 of 4)
140 @@
141 // For the next two events, respond with
142 // DM_RESP_ABORT and errno 11 -- EAGAIN.
143 // NFS should retry sending the event as
144 // long as EAGAIN is returned.
145 //
146 run_as_root
147 $1/send_msg countdown_2_11
148 event_count 1
149 event[0] user
150 msg_str[0] countdown_2_11
151 --------------------------------------------
152 @@ NFS test:  EAGAIN (2 of 4)
153 @@
154 $1/open_test $2/ls3 o_rdwr
155 event_count 2
156 event[0] read
157 event[1] read
158 --------------------------------------------
159 @@ NFS test:  EAGAIN (3 of 4)
160 @@
161 run_as_root
162 $1/send_msg countdown_4_11
163 event_count 1
164 event[0] user
165 msg_str[0] countdown_4_11
166 --------------------------------------------
167 @@ NFS test:  EAGAIN (4 of 4)
168 @@
169 $1/open_test $2/ls4 o_rdwr
170 event_count 4
171 event[0] read
172 event[1] read
173 event[2] read
174 event[3] read