mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
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
This commit is contained in:
committed by
Yu Watanabe
parent
4729e84e01
commit
e1819eb062
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user