aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_linux_test.go
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2023-09-04 00:00:11 -0700
committerGopher Robot <gobot@golang.org>2023-09-05 12:31:06 +0000
commit0e1a9e18671a1ba171cda9d681cacaf91bd2c0bb (patch)
tree4807a8927b9b2b4c80532a381b9328101c523990 /src/syscall/exec_linux_test.go
parent1d84b02b228cbd35660e168d26fd2801daed08fe (diff)
downloadgo-0e1a9e18671a1ba171cda9d681cacaf91bd2c0bb.tar.xz
syscall: fixup TestUseCgroupFD error checking
Fixup for CL 520265; of course errors returned from os/exec are wrapped. While at it, change the order -- it seems more readable this way. Change-Id: Ifb5d0c113f4fb2b3cc4be922021dbd2a8a886b7b Reviewed-on: https://go-review.googlesource.com/c/go/+/524959 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/syscall/exec_linux_test.go')
-rw-r--r--src/syscall/exec_linux_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go
index 4a6c34e6e6..d192b904d2 100644
--- a/src/syscall/exec_linux_test.go
+++ b/src/syscall/exec_linux_test.go
@@ -8,6 +8,7 @@ package syscall_test
import (
"bytes"
+ "errors"
"flag"
"fmt"
"internal/platform"
@@ -460,7 +461,7 @@ func TestUseCgroupFD(t *testing.T) {
}
out, err := cmd.CombinedOutput()
if err != nil {
- if err != syscall.EINVAL && testenv.SyscallIsNotSupported(err) {
+ if testenv.SyscallIsNotSupported(err) && !errors.Is(err, syscall.EINVAL) {
// Can be one of:
// - clone3 not supported (old kernel);
// - clone3 not allowed (by e.g. seccomp);