]> Cypherpunks repositories - gostls13.git/commit
runtime/testdata/testprog: use testenv.SyscallIsNotSupported to check syscall.Unshare
authorBryan C. Mills <bcmills@google.com>
Wed, 16 Aug 2023 14:46:11 +0000 (10:46 -0400)
committerBryan Mills <bcmills@google.com>
Wed, 16 Aug 2023 16:39:01 +0000 (16:39 +0000)
commit9cf209f6b87f46795c3eadbeaceeeca7d429752b
tree4f4bffa2ac337b702a2d23c5dc52505ca0439191
parent9049d77dbeb3e5fb3134e88fd5686438f054cb2f
runtime/testdata/testprog: use testenv.SyscallIsNotSupported to check syscall.Unshare

syscall.Unshare is the sort of system call that may be blocked in a
container environment, and experience has shown that different
container implementations choose from a variety of different error
codes for blocked syscalls.

In particular, the patch in
https://git.alpinelinux.org/aports/tree/community/go/tests-unshare-enosys.patch
seems to suggest that the container environment used to test the Go
distribution on Alpine Linux returns ENOSYS instead of EPERM.

The existing testenv.SyscallIsNotSupported helper checks for
the kinds of error codes we have seen from containers in practice, so
let's use that here.

For #62053.
Updates #29366.

Change-Id: Ic6755f7224fcdc0cb8b25dde2d6047ceb5c3ffdf
Reviewed-on: https://go-review.googlesource.com/c/go/+/520057
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
src/runtime/testdata/testprog/syscalls_linux.go