test-namespace: namespace_open_by_id() may return -ESTALE for permission reasons

As commented in namespace_open_by_id().

Follow-up for 23f2204718.
This commit is contained in:
Yu Watanabe
2026-06-05 04:57:53 +09:00
parent 8dc1de8b3f
commit e0f02425ae
+1 -1
View 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");