Commit dae1d8ac authored by Cristian Marussi's avatar Cristian Marussi Committed by Shuah Khan

selftests: skip mincore.check_file_mmap when fs lacks needed support

Report mincore.check_file_mmap as SKIP instead of FAIL if the underlying
filesystem lacks support of O_TMPFILE or fallocate since such failures
are not really related to mincore functionality.

Cc: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent ac9e0a25
......@@ -207,16 +207,22 @@ TEST(check_file_mmap)
errno = 0;
fd = open(".", O_TMPFILE | O_RDWR, 0600);
ASSERT_NE(-1, fd) {
if (fd < 0) {
ASSERT_EQ(errno, EOPNOTSUPP) {
TH_LOG("Can't create temporary file: %s",
strerror(errno));
}
SKIP(goto out_free, "O_TMPFILE not supported by filesystem.");
}
errno = 0;
retval = fallocate(fd, 0, 0, FILE_SIZE);
ASSERT_EQ(0, retval) {
if (retval) {
ASSERT_EQ(errno, EOPNOTSUPP) {
TH_LOG("Error allocating space for the temporary file: %s",
strerror(errno));
}
SKIP(goto out_close, "fallocate not supported by filesystem.");
}
/*
* Map the whole file, the pages shouldn't be fetched yet.
......@@ -271,7 +277,9 @@ TEST(check_file_mmap)
}
munmap(addr, FILE_SIZE);
out_close:
close(fd);
out_free:
free(vec);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment