syscall: allow EINVAL in TestSCMCredentials

This can occur on NixOS.

Change-Id: I0571b0cc5345d01396dca6a4116aa1024c390a5a
Reviewed-on: https://go-review.googlesource.com/c/go/+/393437
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2022-03-16 14:25:50 -07:00
parent 66865363f0
commit f839aaa22b
1 changed files with 4 additions and 2 deletions

View File

@ -77,8 +77,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)
switch err {
case syscall.EPERM, syscall.EINVAL:
default:
t.Fatalf("WriteMsgUnix failed with %v, want EPERM or EINVAL", err)
}
}