mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 23:05:39 +00:00
zdtm: Extend inotify00 test to have ghost file used
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
b146fe4af6
commit
d9df71dc87
@@ -18,12 +18,14 @@
|
|||||||
const char *test_doc = "Check for inotify delivery";
|
const char *test_doc = "Check for inotify delivery";
|
||||||
const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org>";
|
const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org>";
|
||||||
|
|
||||||
|
const char path[] = "inotify-removed";
|
||||||
|
|
||||||
#define BUFF_SIZE ((sizeof(struct inotify_event) + PATH_MAX))
|
#define BUFF_SIZE ((sizeof(struct inotify_event) + PATH_MAX))
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char buf[BUFF_SIZE];
|
char buf[BUFF_SIZE];
|
||||||
int fd, wd;
|
int fd, wd, deleted, wd_deleted;
|
||||||
|
|
||||||
test_init(argc, argv);
|
test_init(argc, argv);
|
||||||
|
|
||||||
@@ -40,6 +42,23 @@ int main (int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleted = open(path, O_CREAT | O_TRUNC);
|
||||||
|
if (deleted < 0) {
|
||||||
|
fail("inotify_init failed");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
wd_deleted = inotify_add_watch(fd, path, IN_ALL_EVENTS);
|
||||||
|
if (wd_deleted < 0) {
|
||||||
|
fail("inotify_add_watch failed");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unlink(path)) {
|
||||||
|
fail("can't unlink %s\n", path);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
test_daemon();
|
test_daemon();
|
||||||
test_waitsig();
|
test_waitsig();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user