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>
This commit is contained in:
Kir Kolyshkin 2023-09-04 00:00:11 -07:00 committed by Gopher Robot
parent 1d84b02b22
commit 0e1a9e1867

View 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);