Commit 9adcb36d authored by Kirill Smelkov's avatar Kirill Smelkov

syscall: tests: Fix TestSCMCredentials for `unshare -Umc`

parent 46cb0161
......@@ -76,8 +76,10 @@ func TestSCMCredentials(t *testing.T) {
if sys, ok := err.(*os.SyscallError); ok {
err = sys.Err
}
if err != syscall.EPERM {
t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err)
// can get EINVAL instead of EPERM under `unshare -Umc` because uid0 is not mapped and maps to -1
// see also https://github.com/golang/go/issues/42525
if !(err == syscall.EPERM || err == syscall.EINVAL) {
t.Fatalf("WriteMsgUnix failed with %v, want EPERM/EINVAL", err)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment