mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: use correct go binary in test
Usually this test is skipped (on builders and when not root), so people are unlikely to see this error. Updates #19296 Change-Id: I3acb81260034dad8776c305f83d7cbac4b718e75 Reviewed-on: https://go-review.googlesource.com/48191 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
4100996676
commit
75f1de8329
1 changed files with 2 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ package syscall_test
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"internal/testenv"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -349,7 +350,7 @@ func TestUnshareMountNameSpaceChroot(t *testing.T) {
|
||||||
// Since we are doing a chroot, we need the binary there,
|
// Since we are doing a chroot, we need the binary there,
|
||||||
// and it must be statically linked.
|
// and it must be statically linked.
|
||||||
x := filepath.Join(d, "syscall.test")
|
x := filepath.Join(d, "syscall.test")
|
||||||
cmd := exec.Command("go", "test", "-c", "-o", x, "syscall")
|
cmd := exec.Command(testenv.GoToolPath(t), "test", "-c", "-o", x, "syscall")
|
||||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||||
if o, err := cmd.CombinedOutput(); err != nil {
|
if o, err := cmd.CombinedOutput(); err != nil {
|
||||||
t.Fatalf("Build of syscall in chroot failed, output %v, err %v", o, err)
|
t.Fatalf("Build of syscall in chroot failed, output %v, err %v", o, err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue