[CRIU] [PATCH 5/5] zdtm: now tempfs_overmounted will pass so remove crfail
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Wed Dec 6 16:51:21 MSK 2017
changes in v2:
make test check that file on overmounted tmpfs mount is dumped
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
test/zdtm/static/tempfs_overmounted.c | 22 ++++++++++++++++++++++
test/zdtm/static/tempfs_overmounted.desc | 2 +-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/test/zdtm/static/tempfs_overmounted.c b/test/zdtm/static/tempfs_overmounted.c
index 56c3d2ed8..c9c1e2dae 100644
--- a/test/zdtm/static/tempfs_overmounted.c
+++ b/test/zdtm/static/tempfs_overmounted.c
@@ -16,6 +16,9 @@ TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
{
+ char testfile[PATH_MAX];
+ int fd;
+
test_init(argc, argv);
mkdir(dirname, 0700);
@@ -23,6 +26,15 @@ int main(int argc, char **argv)
fail("Can't mount tmpfs");
return 1;
}
+
+ snprintf(testfile, PATH_MAX, "%s/testfile", dirname);
+ fd = open(testfile, O_CREAT | O_EXCL, 0600);
+ if (fd < 0) {
+ fail("Can't create file");
+ return 1;
+ }
+ close(fd);
+
if (mount("none", dirname, "tmpfs", 0, "") < 0) {
fail("Can't mount tmpfs");
return 1;
@@ -31,6 +43,16 @@ int main(int argc, char **argv)
test_daemon();
test_waitsig();
+ if (umount(dirname)) {
+ fail("Can't umount");
+ return 1;
+ }
+
+ if (access(testfile, F_OK) < 0) {
+ fail("Can't access testfile");
+ return 1;
+ }
+
pass();
return 0;
}
diff --git a/test/zdtm/static/tempfs_overmounted.desc b/test/zdtm/static/tempfs_overmounted.desc
index 0d8b7f2b4..7657ba45c 100644
--- a/test/zdtm/static/tempfs_overmounted.desc
+++ b/test/zdtm/static/tempfs_overmounted.desc
@@ -1 +1 @@
-{'flavor': 'ns uns', 'flags': 'suid crfail'}
+{'flavor': 'ns uns', 'flags': 'suid'}
--
2.13.6
More information about the CRIU
mailing list