xref: /minix3/tests/kernel/kqueue/t_vnode.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc #include <sys/event.h>
2*0a6a1f1dSLionel Sambuc #include <sys/stat.h>
3*0a6a1f1dSLionel Sambuc #include <sys/time.h>
4*0a6a1f1dSLionel Sambuc #include <fcntl.h>
5*0a6a1f1dSLionel Sambuc #include <stdio.h>
6*0a6a1f1dSLionel Sambuc #include <unistd.h>
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc #include <atf-c.h>
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc /*
11*0a6a1f1dSLionel Sambuc  * Test cases for events triggered by manipulating a target directory
12*0a6a1f1dSLionel Sambuc  * content.  Using EVFILT_VNODE filter on the target directory descriptor.
13*0a6a1f1dSLionel Sambuc  *
14*0a6a1f1dSLionel Sambuc  */
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc static const char *dir_target = "foo";
17*0a6a1f1dSLionel Sambuc static const char *dir_inside1 = "foo/bar1";
18*0a6a1f1dSLionel Sambuc static const char *dir_inside2 = "foo/bar2";
19*0a6a1f1dSLionel Sambuc static const char *dir_outside = "bar";
20*0a6a1f1dSLionel Sambuc static const char *file_inside1 = "foo/baz1";
21*0a6a1f1dSLionel Sambuc static const char *file_inside2 = "foo/baz2";
22*0a6a1f1dSLionel Sambuc static const char *file_outside = "qux";
23*0a6a1f1dSLionel Sambuc static const struct timespec ts = {0, 0};
24*0a6a1f1dSLionel Sambuc static int kq = -1;
25*0a6a1f1dSLionel Sambuc static int target = -1;
26*0a6a1f1dSLionel Sambuc 
27*0a6a1f1dSLionel Sambuc int init_target(void);
28*0a6a1f1dSLionel Sambuc int init_kqueue(void);
29*0a6a1f1dSLionel Sambuc int create_file(const char *);
30*0a6a1f1dSLionel Sambuc void cleanup(void);
31*0a6a1f1dSLionel Sambuc 
32*0a6a1f1dSLionel Sambuc int
init_target(void)33*0a6a1f1dSLionel Sambuc init_target(void)
34*0a6a1f1dSLionel Sambuc {
35*0a6a1f1dSLionel Sambuc 	if (mkdir(dir_target, S_IRWXU) < 0) {
36*0a6a1f1dSLionel Sambuc 		return -1;
37*0a6a1f1dSLionel Sambuc 	}
38*0a6a1f1dSLionel Sambuc 	target = open(dir_target, O_RDONLY, 0);
39*0a6a1f1dSLionel Sambuc 	return target;
40*0a6a1f1dSLionel Sambuc }
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc int
init_kqueue(void)43*0a6a1f1dSLionel Sambuc init_kqueue(void)
44*0a6a1f1dSLionel Sambuc {
45*0a6a1f1dSLionel Sambuc 	struct kevent eventlist[1];
46*0a6a1f1dSLionel Sambuc 
47*0a6a1f1dSLionel Sambuc 	kq = kqueue();
48*0a6a1f1dSLionel Sambuc 	if (kq < 0) {
49*0a6a1f1dSLionel Sambuc 		return -1;
50*0a6a1f1dSLionel Sambuc 	}
51*0a6a1f1dSLionel Sambuc 	EV_SET(&eventlist[0], (uintptr_t)target, EVFILT_VNODE,
52*0a6a1f1dSLionel Sambuc 		EV_ADD | EV_ONESHOT, NOTE_DELETE |
53*0a6a1f1dSLionel Sambuc 		NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB |
54*0a6a1f1dSLionel Sambuc 		NOTE_LINK | NOTE_RENAME | NOTE_REVOKE, 0, 0);
55*0a6a1f1dSLionel Sambuc 	return kevent(kq, eventlist, 1, NULL, 0, NULL);
56*0a6a1f1dSLionel Sambuc }
57*0a6a1f1dSLionel Sambuc 
58*0a6a1f1dSLionel Sambuc int
create_file(const char * file)59*0a6a1f1dSLionel Sambuc create_file(const char *file)
60*0a6a1f1dSLionel Sambuc {
61*0a6a1f1dSLionel Sambuc 	int fd;
62*0a6a1f1dSLionel Sambuc 
63*0a6a1f1dSLionel Sambuc 	fd = open(file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
64*0a6a1f1dSLionel Sambuc 	if (fd < 0) {
65*0a6a1f1dSLionel Sambuc 		return -1;
66*0a6a1f1dSLionel Sambuc 	}
67*0a6a1f1dSLionel Sambuc 	return close(fd);
68*0a6a1f1dSLionel Sambuc }
69*0a6a1f1dSLionel Sambuc 
70*0a6a1f1dSLionel Sambuc void
cleanup(void)71*0a6a1f1dSLionel Sambuc cleanup(void)
72*0a6a1f1dSLionel Sambuc {
73*0a6a1f1dSLionel Sambuc 	(void)unlink(file_inside1);
74*0a6a1f1dSLionel Sambuc 	(void)unlink(file_inside2);
75*0a6a1f1dSLionel Sambuc 	(void)unlink(file_outside);
76*0a6a1f1dSLionel Sambuc 	(void)rmdir(dir_inside1);
77*0a6a1f1dSLionel Sambuc 	(void)rmdir(dir_inside2);
78*0a6a1f1dSLionel Sambuc 	(void)rmdir(dir_outside);
79*0a6a1f1dSLionel Sambuc 	(void)rmdir(dir_target);
80*0a6a1f1dSLionel Sambuc 	(void)close(kq);
81*0a6a1f1dSLionel Sambuc 	(void)close(target);
82*0a6a1f1dSLionel Sambuc }
83*0a6a1f1dSLionel Sambuc 
84*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_no_note_link_create_file_in);
ATF_TC_HEAD(dir_no_note_link_create_file_in,tc)85*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_no_note_link_create_file_in, tc)
86*0a6a1f1dSLionel Sambuc {
87*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
88*0a6a1f1dSLionel Sambuc 		"that kevent(2) does not return NOTE_LINK for the directory "
89*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is created.");
90*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_no_note_link_create_file_in,tc)91*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_no_note_link_create_file_in, tc)
92*0a6a1f1dSLionel Sambuc {
93*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
94*0a6a1f1dSLionel Sambuc 
95*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
96*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
97*0a6a1f1dSLionel Sambuc 
98*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
99*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
100*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, 0);
101*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_no_note_link_create_file_in,tc)102*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_no_note_link_create_file_in, tc)
103*0a6a1f1dSLionel Sambuc {
104*0a6a1f1dSLionel Sambuc 	cleanup();
105*0a6a1f1dSLionel Sambuc }
106*0a6a1f1dSLionel Sambuc 
107*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_no_note_link_delete_file_in);
ATF_TC_HEAD(dir_no_note_link_delete_file_in,tc)108*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_no_note_link_delete_file_in, tc)
109*0a6a1f1dSLionel Sambuc {
110*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
111*0a6a1f1dSLionel Sambuc 		"that kevent(2) does not return NOTE_LINK for the directory "
112*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is deleted.");
113*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_no_note_link_delete_file_in,tc)114*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_no_note_link_delete_file_in, tc)
115*0a6a1f1dSLionel Sambuc {
116*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
117*0a6a1f1dSLionel Sambuc 
118*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
119*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
120*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
121*0a6a1f1dSLionel Sambuc 
122*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(unlink(file_inside1) != -1);
123*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
124*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, 0);
125*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_no_note_link_delete_file_in,tc)126*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_no_note_link_delete_file_in, tc)
127*0a6a1f1dSLionel Sambuc {
128*0a6a1f1dSLionel Sambuc 	cleanup();
129*0a6a1f1dSLionel Sambuc }
130*0a6a1f1dSLionel Sambuc 
131*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_no_note_link_mv_dir_within);
ATF_TC_HEAD(dir_no_note_link_mv_dir_within,tc)132*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_no_note_link_mv_dir_within, tc)
133*0a6a1f1dSLionel Sambuc {
134*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
135*0a6a1f1dSLionel Sambuc 		"that kevent(2) does not return NOTE_LINK for the directory "
136*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is renamed to 'foo/baz'.");
137*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_no_note_link_mv_dir_within,tc)138*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_no_note_link_mv_dir_within, tc)
139*0a6a1f1dSLionel Sambuc {
140*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
141*0a6a1f1dSLionel Sambuc 
142*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
143*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
144*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
145*0a6a1f1dSLionel Sambuc 
146*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_inside1, dir_inside2) != -1);
147*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
148*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, 0);
149*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_no_note_link_mv_dir_within,tc)150*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_no_note_link_mv_dir_within, tc)
151*0a6a1f1dSLionel Sambuc {
152*0a6a1f1dSLionel Sambuc 	cleanup();
153*0a6a1f1dSLionel Sambuc }
154*0a6a1f1dSLionel Sambuc 
155*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_no_note_link_mv_file_within);
ATF_TC_HEAD(dir_no_note_link_mv_file_within,tc)156*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_no_note_link_mv_file_within, tc)
157*0a6a1f1dSLionel Sambuc {
158*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
159*0a6a1f1dSLionel Sambuc 		"that kevent(2) does not return NOTE_LINK for the directory "
160*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is renamed to 'foo/qux'.");
161*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_no_note_link_mv_file_within,tc)162*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_no_note_link_mv_file_within, tc)
163*0a6a1f1dSLionel Sambuc {
164*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
165*0a6a1f1dSLionel Sambuc 
166*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
167*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
168*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
169*0a6a1f1dSLionel Sambuc 
170*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(file_inside1, file_inside2) != -1);
171*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
172*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, 0);
173*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_no_note_link_mv_file_within,tc)174*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_no_note_link_mv_file_within, tc)
175*0a6a1f1dSLionel Sambuc {
176*0a6a1f1dSLionel Sambuc 	cleanup();
177*0a6a1f1dSLionel Sambuc }
178*0a6a1f1dSLionel Sambuc 
179*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_link_create_dir_in);
ATF_TC_HEAD(dir_note_link_create_dir_in,tc)180*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_link_create_dir_in, tc)
181*0a6a1f1dSLionel Sambuc {
182*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
183*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_LINK for the directory "
184*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is created.");
185*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_link_create_dir_in,tc)186*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_link_create_dir_in, tc)
187*0a6a1f1dSLionel Sambuc {
188*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
189*0a6a1f1dSLionel Sambuc 
190*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
191*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
192*0a6a1f1dSLionel Sambuc 
193*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
194*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
195*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, NOTE_LINK);
196*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_link_create_dir_in,tc)197*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_link_create_dir_in, tc)
198*0a6a1f1dSLionel Sambuc {
199*0a6a1f1dSLionel Sambuc 	cleanup();
200*0a6a1f1dSLionel Sambuc }
201*0a6a1f1dSLionel Sambuc 
202*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_link_delete_dir_in);
ATF_TC_HEAD(dir_note_link_delete_dir_in,tc)203*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_link_delete_dir_in, tc)
204*0a6a1f1dSLionel Sambuc {
205*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
206*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_LINK for the directory "
207*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is deleted.");
208*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_link_delete_dir_in,tc)209*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_link_delete_dir_in, tc)
210*0a6a1f1dSLionel Sambuc {
211*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
212*0a6a1f1dSLionel Sambuc 
213*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
214*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
215*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
216*0a6a1f1dSLionel Sambuc 
217*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rmdir(dir_inside1) != -1);
218*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
219*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, NOTE_LINK);
220*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_link_delete_dir_in,tc)221*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_link_delete_dir_in, tc)
222*0a6a1f1dSLionel Sambuc {
223*0a6a1f1dSLionel Sambuc 	cleanup();
224*0a6a1f1dSLionel Sambuc }
225*0a6a1f1dSLionel Sambuc 
226*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_link_mv_dir_in);
ATF_TC_HEAD(dir_note_link_mv_dir_in,tc)227*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_link_mv_dir_in, tc)
228*0a6a1f1dSLionel Sambuc {
229*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
230*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_LINK for the directory "
231*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'bar' is renamed to 'foo/bar'.");
232*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_link_mv_dir_in,tc)233*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_link_mv_dir_in, tc)
234*0a6a1f1dSLionel Sambuc {
235*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
236*0a6a1f1dSLionel Sambuc 
237*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
238*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_outside, S_IRWXU) != -1);
239*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
240*0a6a1f1dSLionel Sambuc 
241*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_outside, dir_inside1) != -1);
242*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
243*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, NOTE_LINK);
244*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_link_mv_dir_in,tc)245*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_link_mv_dir_in, tc)
246*0a6a1f1dSLionel Sambuc {
247*0a6a1f1dSLionel Sambuc 	cleanup();
248*0a6a1f1dSLionel Sambuc }
249*0a6a1f1dSLionel Sambuc 
250*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_link_mv_dir_out);
ATF_TC_HEAD(dir_note_link_mv_dir_out,tc)251*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_link_mv_dir_out, tc)
252*0a6a1f1dSLionel Sambuc {
253*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
254*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_LINK for the directory "
255*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is renamed to 'bar'.");
256*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_link_mv_dir_out,tc)257*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_link_mv_dir_out, tc)
258*0a6a1f1dSLionel Sambuc {
259*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
260*0a6a1f1dSLionel Sambuc 
261*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
262*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
263*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
264*0a6a1f1dSLionel Sambuc 
265*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_inside1, dir_outside) != -1);
266*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
267*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_LINK, NOTE_LINK);
268*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_link_mv_dir_out,tc)269*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_link_mv_dir_out, tc)
270*0a6a1f1dSLionel Sambuc {
271*0a6a1f1dSLionel Sambuc 	cleanup();
272*0a6a1f1dSLionel Sambuc }
273*0a6a1f1dSLionel Sambuc 
274*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_create_dir_in);
ATF_TC_HEAD(dir_note_write_create_dir_in,tc)275*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_create_dir_in, tc)
276*0a6a1f1dSLionel Sambuc {
277*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
278*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
279*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is created.");
280*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_create_dir_in,tc)281*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_create_dir_in, tc)
282*0a6a1f1dSLionel Sambuc {
283*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
284*0a6a1f1dSLionel Sambuc 
285*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
286*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
287*0a6a1f1dSLionel Sambuc 
288*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
289*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
290*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
291*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_create_dir_in,tc)292*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_create_dir_in, tc)
293*0a6a1f1dSLionel Sambuc {
294*0a6a1f1dSLionel Sambuc 	cleanup();
295*0a6a1f1dSLionel Sambuc }
296*0a6a1f1dSLionel Sambuc 
297*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_create_file_in);
ATF_TC_HEAD(dir_note_write_create_file_in,tc)298*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_create_file_in, tc)
299*0a6a1f1dSLionel Sambuc {
300*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
301*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
302*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is created.");
303*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_create_file_in,tc)304*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_create_file_in, tc)
305*0a6a1f1dSLionel Sambuc {
306*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
307*0a6a1f1dSLionel Sambuc 
308*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
309*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
310*0a6a1f1dSLionel Sambuc 
311*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
312*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
313*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
314*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_create_file_in,tc)315*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_create_file_in, tc)
316*0a6a1f1dSLionel Sambuc {
317*0a6a1f1dSLionel Sambuc 	cleanup();
318*0a6a1f1dSLionel Sambuc }
319*0a6a1f1dSLionel Sambuc 
320*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_delete_dir_in);
ATF_TC_HEAD(dir_note_write_delete_dir_in,tc)321*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_delete_dir_in, tc)
322*0a6a1f1dSLionel Sambuc {
323*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
324*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
325*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is deleted.");
326*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_delete_dir_in,tc)327*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_delete_dir_in, tc)
328*0a6a1f1dSLionel Sambuc {
329*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
330*0a6a1f1dSLionel Sambuc 
331*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
332*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
333*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
334*0a6a1f1dSLionel Sambuc 
335*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rmdir(dir_inside1) != -1);
336*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
337*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
338*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_delete_dir_in,tc)339*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_delete_dir_in, tc)
340*0a6a1f1dSLionel Sambuc {
341*0a6a1f1dSLionel Sambuc 	cleanup();
342*0a6a1f1dSLionel Sambuc }
343*0a6a1f1dSLionel Sambuc 
344*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_delete_file_in);
ATF_TC_HEAD(dir_note_write_delete_file_in,tc)345*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_delete_file_in, tc)
346*0a6a1f1dSLionel Sambuc {
347*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
348*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
349*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is deleted.");
350*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_delete_file_in,tc)351*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_delete_file_in, tc)
352*0a6a1f1dSLionel Sambuc {
353*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
354*0a6a1f1dSLionel Sambuc 
355*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
356*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
357*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
358*0a6a1f1dSLionel Sambuc 
359*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(unlink(file_inside1) != -1);
360*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
361*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
362*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_delete_file_in,tc)363*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_delete_file_in, tc)
364*0a6a1f1dSLionel Sambuc {
365*0a6a1f1dSLionel Sambuc 	cleanup();
366*0a6a1f1dSLionel Sambuc }
367*0a6a1f1dSLionel Sambuc 
368*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_dir_in);
ATF_TC_HEAD(dir_note_write_mv_dir_in,tc)369*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_dir_in, tc)
370*0a6a1f1dSLionel Sambuc {
371*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
372*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
373*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'bar' is renamed to 'foo/bar'.");
374*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_dir_in,tc)375*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_dir_in, tc)
376*0a6a1f1dSLionel Sambuc {
377*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
378*0a6a1f1dSLionel Sambuc 
379*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
380*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_outside, S_IRWXU) != -1);
381*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
382*0a6a1f1dSLionel Sambuc 
383*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_outside, dir_inside1) != -1);
384*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
385*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
386*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_dir_in,tc)387*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_dir_in, tc)
388*0a6a1f1dSLionel Sambuc {
389*0a6a1f1dSLionel Sambuc 	cleanup();
390*0a6a1f1dSLionel Sambuc }
391*0a6a1f1dSLionel Sambuc 
392*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_dir_out);
ATF_TC_HEAD(dir_note_write_mv_dir_out,tc)393*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_dir_out, tc)
394*0a6a1f1dSLionel Sambuc {
395*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
396*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
397*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is renamed to 'bar'.");
398*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_dir_out,tc)399*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_dir_out, tc)
400*0a6a1f1dSLionel Sambuc {
401*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
402*0a6a1f1dSLionel Sambuc 
403*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
404*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
405*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
406*0a6a1f1dSLionel Sambuc 
407*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_inside1, dir_outside) != -1);
408*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
409*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
410*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_dir_out,tc)411*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_dir_out, tc)
412*0a6a1f1dSLionel Sambuc {
413*0a6a1f1dSLionel Sambuc 	cleanup();
414*0a6a1f1dSLionel Sambuc }
415*0a6a1f1dSLionel Sambuc 
416*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_dir_within);
ATF_TC_HEAD(dir_note_write_mv_dir_within,tc)417*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_dir_within, tc)
418*0a6a1f1dSLionel Sambuc {
419*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
420*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
421*0a6a1f1dSLionel Sambuc 		"'foo' if a directory 'foo/bar' is renamed to 'foo/baz'.");
422*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_dir_within,tc)423*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_dir_within, tc)
424*0a6a1f1dSLionel Sambuc {
425*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
426*0a6a1f1dSLionel Sambuc 
427*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
428*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(mkdir(dir_inside1, S_IRWXU) != -1);
429*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
430*0a6a1f1dSLionel Sambuc 
431*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(dir_inside1, dir_inside2) != -1);
432*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
433*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
434*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_dir_within,tc)435*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_dir_within, tc)
436*0a6a1f1dSLionel Sambuc {
437*0a6a1f1dSLionel Sambuc 	cleanup();
438*0a6a1f1dSLionel Sambuc }
439*0a6a1f1dSLionel Sambuc 
440*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_file_in);
ATF_TC_HEAD(dir_note_write_mv_file_in,tc)441*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_file_in, tc)
442*0a6a1f1dSLionel Sambuc {
443*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
444*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
445*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'qux' is renamed to 'foo/baz'.");
446*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_file_in,tc)447*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_file_in, tc)
448*0a6a1f1dSLionel Sambuc {
449*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
450*0a6a1f1dSLionel Sambuc 
451*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
452*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_outside) != -1);
453*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
454*0a6a1f1dSLionel Sambuc 
455*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(file_outside, file_inside1) != -1);
456*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
457*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
458*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_file_in,tc)459*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_file_in, tc)
460*0a6a1f1dSLionel Sambuc {
461*0a6a1f1dSLionel Sambuc 	cleanup();
462*0a6a1f1dSLionel Sambuc }
463*0a6a1f1dSLionel Sambuc 
464*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_file_out);
ATF_TC_HEAD(dir_note_write_mv_file_out,tc)465*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_file_out, tc)
466*0a6a1f1dSLionel Sambuc {
467*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
468*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
469*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is renamed to 'qux'.");
470*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_file_out,tc)471*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_file_out, tc)
472*0a6a1f1dSLionel Sambuc {
473*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
474*0a6a1f1dSLionel Sambuc 
475*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
476*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
477*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
478*0a6a1f1dSLionel Sambuc 
479*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(file_inside1, file_outside) != -1);
480*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
481*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
482*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_file_out,tc)483*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_file_out, tc)
484*0a6a1f1dSLionel Sambuc {
485*0a6a1f1dSLionel Sambuc 	cleanup();
486*0a6a1f1dSLionel Sambuc }
487*0a6a1f1dSLionel Sambuc 
488*0a6a1f1dSLionel Sambuc ATF_TC_WITH_CLEANUP(dir_note_write_mv_file_within);
ATF_TC_HEAD(dir_note_write_mv_file_within,tc)489*0a6a1f1dSLionel Sambuc ATF_TC_HEAD(dir_note_write_mv_file_within, tc)
490*0a6a1f1dSLionel Sambuc {
491*0a6a1f1dSLionel Sambuc 	atf_tc_set_md_var(tc, "descr", "This test case ensures "
492*0a6a1f1dSLionel Sambuc 		"that kevent(2) returns NOTE_WRITE for the directory "
493*0a6a1f1dSLionel Sambuc 		"'foo' if a file 'foo/baz' is renamed to 'foo/qux'.");
494*0a6a1f1dSLionel Sambuc }
ATF_TC_BODY(dir_note_write_mv_file_within,tc)495*0a6a1f1dSLionel Sambuc ATF_TC_BODY(dir_note_write_mv_file_within, tc)
496*0a6a1f1dSLionel Sambuc {
497*0a6a1f1dSLionel Sambuc 	struct kevent changelist[1];
498*0a6a1f1dSLionel Sambuc 
499*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_target() != -1);
500*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(create_file(file_inside1) != -1);
501*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(init_kqueue() != -1);
502*0a6a1f1dSLionel Sambuc 
503*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(rename(file_inside1, file_inside2) != -1);
504*0a6a1f1dSLionel Sambuc 	ATF_REQUIRE(kevent(kq, NULL, 0, changelist, 1, &ts) != -1);
505*0a6a1f1dSLionel Sambuc 	ATF_CHECK_EQ(changelist[0].fflags & NOTE_WRITE, NOTE_WRITE);
506*0a6a1f1dSLionel Sambuc }
ATF_TC_CLEANUP(dir_note_write_mv_file_within,tc)507*0a6a1f1dSLionel Sambuc ATF_TC_CLEANUP(dir_note_write_mv_file_within, tc)
508*0a6a1f1dSLionel Sambuc {
509*0a6a1f1dSLionel Sambuc 	cleanup();
510*0a6a1f1dSLionel Sambuc }
511*0a6a1f1dSLionel Sambuc 
ATF_TP_ADD_TCS(tp)512*0a6a1f1dSLionel Sambuc ATF_TP_ADD_TCS(tp)
513*0a6a1f1dSLionel Sambuc {
514*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_no_note_link_create_file_in);
515*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_no_note_link_delete_file_in);
516*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_no_note_link_mv_dir_within);
517*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_no_note_link_mv_file_within);
518*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_link_create_dir_in);
519*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_link_delete_dir_in);
520*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_link_mv_dir_in);
521*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_link_mv_dir_out);
522*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_create_dir_in);
523*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_create_file_in);
524*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_delete_dir_in);
525*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_delete_file_in);
526*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_dir_in);
527*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_dir_out);
528*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_dir_within);
529*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_file_in);
530*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_file_out);
531*0a6a1f1dSLionel Sambuc 	ATF_TP_ADD_TC(tp, dir_note_write_mv_file_within);
532*0a6a1f1dSLionel Sambuc 	return atf_no_error();
533*0a6a1f1dSLionel Sambuc }
534