]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-cgroup-util: Skip test on ESTALE
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 6 Nov 2025 19:56:53 +0000 (20:56 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 14 Nov 2025 08:19:01 +0000 (09:19 +0100)
The kernel converts a bunch of errors to ESTALE in the open_by_handle_at()
codepath so we treat it as missing privs but it could be absolutely
anything really.

src/test/test-cgroup-util.c

index fea0733173f869b5c773881dc1a66d097315746e..997bcf2215569e007942f6ebc9f3abcc72e41183 100644 (file)
@@ -527,7 +527,9 @@ TEST(cgroupid) {
 
         fd2 = cg_cgroupid_open(fd, id);
 
-        if (ERRNO_IS_NEG_PRIVILEGE(fd2))
+        /* The kernel converts a bunch of errors to ESTALE in the open_by_handle_at() codepath so we treat
+         * it as missing privs but it could be absolutely anything really. */
+        if (ERRNO_IS_NEG_PRIVILEGE(fd2) || fd2 == -ESTALE)
                 log_notice("Skipping open-by-cgroup-id test because lacking privs.");
         else if (ERRNO_IS_NEG_NOT_SUPPORTED(fd2))
                 log_notice("Skipping open-by-cgroup-id test because syscall is missing or blocked.");