mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: append to environment in tests, don't clobber it
Fixes https://gcc.gnu.org/PR95061 Change-Id: I3cddfe5920b6da572ddeafa201617003c25175e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/233318 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
2cb10d42b7
commit
910fee4ed5
2 changed files with 9 additions and 6 deletions
|
|
@ -355,7 +355,7 @@ func TestUnshareMountNameSpace(t *testing.T) {
|
|||
}
|
||||
|
||||
cmd := exec.Command(os.Args[0], "-test.run=TestUnshareMountNameSpaceHelper", d)
|
||||
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
||||
cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1")
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Unshareflags: syscall.CLONE_NEWNS}
|
||||
|
||||
o, err := cmd.CombinedOutput()
|
||||
|
|
@ -406,7 +406,7 @@ func TestUnshareMountNameSpaceChroot(t *testing.T) {
|
|||
}
|
||||
|
||||
cmd = exec.Command("/syscall.test", "-test.run=TestUnshareMountNameSpaceHelper", "/")
|
||||
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
||||
cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1")
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Chroot: d, Unshareflags: syscall.CLONE_NEWNS}
|
||||
|
||||
o, err := cmd.CombinedOutput()
|
||||
|
|
@ -621,7 +621,7 @@ func testAmbientCaps(t *testing.T, userns bool) {
|
|||
}
|
||||
|
||||
cmd := exec.Command(f.Name(), "-test.run=TestAmbientCapsHelper")
|
||||
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
||||
cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1")
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue