Commit c40d7a9
fix: skip TestHostnameByPid when setns is not permitted
setns(2) requires CAP_SYS_ADMIN. Probe with self PID before running
the test cases and skip the whole test when EPERM is returned, so the
suite passes in unprivileged environments such as OrbStack on
Apple Silicon.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c822327 commit c40d7a9
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
0 commit comments