xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/inotify/README (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard WorkerThis contains two tests for the inotify subsystem.
2*49cdfc7eSAndroid Build Coastguard Worker
3*49cdfc7eSAndroid Build Coastguard WorkerThe  inotify  API  provides  a mechanism for monitoring file system events. $
4*49cdfc7eSAndroid Build Coastguard WorkerInotify can be used to monitor individual files, or to monitor directories. $
5*49cdfc7eSAndroid Build Coastguard WorkerWhen a directory is monitored, inotify will return events for the directory$
6*49cdfc7eSAndroid Build Coastguard Workeritself, and for files inside  the directory.
7*49cdfc7eSAndroid Build Coastguard Worker
8*49cdfc7eSAndroid Build Coastguard WorkerThe tests are intended to do the following:
9*49cdfc7eSAndroid Build Coastguard Workertest 1:
10*49cdfc7eSAndroid Build Coastguard Worker	initialize inotify for the test file
11*49cdfc7eSAndroid Build Coastguard Worker	generate sequence events:
12*49cdfc7eSAndroid Build Coastguard Worker		operation			expected event
13*49cdfc7eSAndroid Build Coastguard Worker		-----------------------------------------
14*49cdfc7eSAndroid Build Coastguard Worker		chmod file			IN_ATTRIB
15*49cdfc7eSAndroid Build Coastguard Worker		open read-only			IN_OPEN
16*49cdfc7eSAndroid Build Coastguard Worker		read				IN_ACCESS
17*49cdfc7eSAndroid Build Coastguard Worker		close				IN_CLOSE_NOWRITE
18*49cdfc7eSAndroid Build Coastguard Worker		open read-write			IN_OPEN
19*49cdfc7eSAndroid Build Coastguard Worker		write				IN_MODIFY
20*49cdfc7eSAndroid Build Coastguard Worker		close				IN_CLOSE_WRITE
21*49cdfc7eSAndroid Build Coastguard Worker	check that all events have been received
22*49cdfc7eSAndroid Build Coastguard Workertest 2:
23*49cdfc7eSAndroid Build Coastguard Worker	initialize inotify for the test directory
24*49cdfc7eSAndroid Build Coastguard Worker	generate sequence events:
25*49cdfc7eSAndroid Build Coastguard Worker		operate				expected event
26*49cdfc7eSAndroid Build Coastguard Worker		-----------------------------------------
27*49cdfc7eSAndroid Build Coastguard Worker		chmod				IN_ISDIR | IN_ATTRIB
28*49cdfc7eSAndroid Build Coastguard Worker		creat file			IN_CREATE
29*49cdfc7eSAndroid Build Coastguard Worker						IN_OPEN
30*49cdfc7eSAndroid Build Coastguard Worker		close				IN_CLOSE_WRITE
31*49cdfc7eSAndroid Build Coastguard Worker		rename file			IN_MOVED_FROM
32*49cdfc7eSAndroid Build Coastguard Worker						IN_MOVED_TO
33*49cdfc7eSAndroid Build Coastguard Worker		rename yourself			IN_MOVE_SELF
34*49cdfc7eSAndroid Build Coastguard Worker		unlink file			IN_DELETE
35*49cdfc7eSAndroid Build Coastguard Worker		rename yourself again
36*49cdfc7eSAndroid Build Coastguard Worker		rename back			IN_MOVE_SELF
37*49cdfc7eSAndroid Build Coastguard Worker	check that all events have been received and the last two successive
38*49cdfc7eSAndroid Build Coastguard Worker	IN_MOVE_SELF events will be coalesced into a single one.
39