From 0e1a9e18671a1ba171cda9d681cacaf91bd2c0bb Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 4 Sep 2023 00:00:11 -0700 Subject: [PATCH] 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 Reviewed-by: Tobias Klauser Reviewed-by: Ian Lance Taylor Reviewed-by: Bryan Mills Auto-Submit: Ian Lance Taylor --- src/syscall/exec_linux_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.50.0