]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop error conditions for old kernels (<3.2)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 13:31:53 +0000 (22:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 18:41:40 +0000 (03:41 +0900)
Now our baseline on the kernel is 5.4.

src/test/test-capability.c

index 314c92fe3ce43a9273a83fd16fb7161cecc389cd..9d863daf2b4e6582f590cab4635df1d7ae3073ad 100644 (file)
@@ -39,8 +39,8 @@ static void test_last_cap_file(void) {
         int r;
 
         r = read_one_line_file("/proc/sys/kernel/cap_last_cap", &content);
-        if (r == -ENOENT || ERRNO_IS_NEG_PRIVILEGE(r)) /* kernel pre 3.2 or no access */
-                return;
+        if (ERRNO_IS_NEG_PRIVILEGE(r))
+                return (void) log_tests_skipped_errno(r, "Failed to /proc/sys/kernel/cap_last_cap");
         ASSERT_OK(r);
 
         r = safe_atolu(content, &val);
@@ -235,8 +235,8 @@ static void test_ensure_cap_64_bit(void) {
         int r;
 
         r = read_one_line_file("/proc/sys/kernel/cap_last_cap", &content);
-        if (r == -ENOENT || ERRNO_IS_NEG_PRIVILEGE(r)) /* kernel pre 3.2 or no access */
-                return;
+        if (ERRNO_IS_NEG_PRIVILEGE(r))
+                return (void) log_tests_skipped_errno(r, "Failed to /proc/sys/kernel/cap_last_cap");
         ASSERT_OK(r);
 
         ASSERT_OK(safe_atolu(content, &p));