]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: mount_option_supported() returns EAGAIN when new mount API is not supported
authorLuca Boccassi <bluca@debian.org>
Mon, 10 Jul 2023 00:00:18 +0000 (01:00 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Jul 2023 04:12:11 +0000 (13:12 +0900)
Don't fail test-mountpoint-util if we get EAGAIN as it's expected on old
kernels

src/test/test-mountpoint-util.c

index 87badfc112846fb616ef57db482fdebf9e5be918..6b129c2eac8ce06dbcd1e82a660e9df41d3d92fd 100644 (file)
@@ -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) {