]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-namespace: namespace_open_by_id() may return -ESTALE for permission reasons
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jun 2026 16:40:06 +0000 (01:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Jun 2026 19:57:53 +0000 (04:57 +0900)
As commented in namespace_open_by_id().

Follow-up for 23f22047189a291b9ba19185a24264771ab8c467.

src/test/test-namespace.c

index 96272bc7623d4051bba593be30c175e16a6ec3b5..41c67a3cf958bd75914ff34dc57fc1920ee0d021 100644 (file)
@@ -298,7 +298,7 @@ TEST(namespace_open_by_id) {
          * the kernel restricts open_by_handle_at() on nsfs to the initial userns and pidns and to
          * CAP_SYS_ADMIN. */
         _cleanup_close_ int opened = namespace_open_by_id(ns_id);
-        if (opened == -EPERM)
+        if (IN_SET(opened, -EPERM, -ESTALE))
                 return (void) log_tests_skipped("not in initial user namespace or missing CAP_SYS_ADMIN");
         if (IN_SET(opened, -EOPNOTSUPP, -EINVAL))
                 return (void) log_tests_skipped("nsfs lookup by ns_id is not supported by this kernel");