]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fixup TestUseCgroupFD error checking
authorKir Kolyshkin <kolyshkin@gmail.com>
Mon, 4 Sep 2023 07:00:11 +0000 (00:00 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 5 Sep 2023 12:31:06 +0000 (12:31 +0000)
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>

src/syscall/exec_linux_test.go

index 4a6c34e6e62be70e619ccc50e05b4ef7a9e2167f..d192b904d2e34ee096cd605f2613ae96cdc64d75 100644 (file)
@@ -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);