From: Luca Boccassi Date: Mon, 10 Jul 2023 00:00:18 +0000 (+0100) Subject: test: mount_option_supported() returns EAGAIN when new mount API is not supported X-Git-Tag: v254-rc2~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1819eb062241c3c565f6fb7f4ec067e06bc55bd;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c index 87badfc1128..6b129c2eac8 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) {