summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-07-10 02:00:18 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-07-10 06:12:11 +0200
commite1819eb062241c3c565f6fb7f4ec067e06bc55bd (patch)
treebf5a5a1fe91b0f637a425089f1dae94ca253d148
parentefi: skip libefitest if 'bootloader' is explicitly set to false (diff)
downloadsystemd-e1819eb062241c3c565f6fb7f4ec067e06bc55bd.tar.xz
systemd-e1819eb062241c3c565f6fb7f4ec067e06bc55bd.zip
test: mount_option_supported() returns EAGAIN when new mount API is not supported
Don't fail test-mountpoint-util if we get EAGAIN as it's expected on old kernels
-rw-r--r--src/test/test-mountpoint-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
index 87badfc112..6b129c2eac 100644
--- a/src/test/test-mountpoint-util.c
+++ b/src/test/test-mountpoint-util.c
@@ -330,7 +330,7 @@ TEST(mount_option_supported) {
r = mount_option_supported("tmpfs", "size", "64M");
log_info("tmpfs supports size=64M: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r > 0 || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r > 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
r = mount_option_supported("ext4", "discard", NULL);
log_info("ext4 supports discard: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
@@ -338,15 +338,15 @@ TEST(mount_option_supported) {
r = mount_option_supported("tmpfs", "idontexist", "64M");
log_info("tmpfs supports idontexist: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r == 0 || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r == 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
r = mount_option_supported("tmpfs", "ialsodontexist", NULL);
log_info("tmpfs supports ialsodontexist: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r == 0 || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r == 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
r = mount_option_supported("proc", "hidepid", "1");
log_info("proc supports hidepid=1: %s (%i)", r < 0 ? "don't know" : yes_no(r), r);
- assert_se(r >= 0 || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
+ assert_se(r >= 0 || r == -EAGAIN || (r < 0 && ERRNO_IS_PRIVILEGE(r)));
}
TEST(fstype_can_discard) {