From 543784efc384e362a7f77ffac78780fc7ba123ee Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 13 Nov 2024 14:20:34 +0000 Subject: [PATCH] test-loop-block: return -77 on skip in more places (cherry picked from commit 81e0693465402d2e72cb3ba1b28e25e3c4c0206a) (cherry picked from commit 1fb4673a6977c6a694f786dbc6cf2ff1990794ff) (cherry picked from commit 8f92f75ae7e87e07b63974533f7ec344291267f2) --- src/test/test-loop-block.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/test/test-loop-block.c b/src/test/test-loop-block.c index 1bd00d1af1..5c2e0c9526 100644 --- a/src/test/test-loop-block.c +++ b/src/test/test-loop-block.c @@ -224,15 +224,11 @@ static int run(int argc, char *argv[]) { dissected = dissected_image_unref(dissected); #endif - if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0) { - log_tests_skipped("not running privileged"); - return 0; - } + if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0) + return log_tests_skipped("not running privileged"); - if (detect_container() > 0) { - log_tests_skipped("Test not supported in a container, requires udev/uevent notifications"); - return 0; - } + if (detect_container() > 0) + return log_tests_skipped("Test not supported in a container, requires udev/uevent notifications"); assert_se(loop_device_make(fd, O_RDWR, 0, UINT64_MAX, 0, LO_FLAGS_PARTSCAN, LOCK_EX, &loop) >= 0);