]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-cgroup: Ignore ENOENT from cg_create(); test-cgroup-util: Ignore ENXIO in one...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jul 2025 01:38:04 +0000 (10:38 +0900)
committerGitHub <noreply@github.com>
Fri, 11 Jul 2025 01:38:04 +0000 (10:38 +0900)
This was the only test failure building systemd-252-51.el9 in a
container, also previously reported against 252-rc1 under Gentoo in
#25015

This is a forward-port of the patch we actually started using for CIQ's
builds of the EL9-derived package, which was:

```diff
--- systemd-252/src/test/test-cgroup.c 2022-10-31 18:59:18.000000000 +0000
+++ systemd-252-test/src/test/test-cgroup.c 2025-07-10 00:47:07.541000000 +0000
@@ -62,7 +62,7 @@
         log_info("Paths for test:\n%s\n%s", test_a, test_b);

         r = cg_create(SYSTEMD_CGROUP_CONTROLLER, test_a);
-        if (IN_SET(r, -EPERM, -EACCES, -EROFS)) {
+        if (IN_SET(r, -EPERM, -EACCES, -EROFS, -ENOENT)) {
                 log_info_errno(r, "Skipping %s: %m", __func__);
                 return;
         }
```

I confirmed that the `ERRNO_IS_NEG_FS_WRITE_REFUSED` macro is equivalent
to checking the first 3 error codes above, so the addition of the check
for `ENOENT` is still just as relevant as it was in 252, but adding it
into the macro would be inconsistent with its name, description, and
possible other uses. Hence, in this PR I'm adding the extra check into
the `if`.


Trivial merge