Skip to content

Commit

Permalink
syscall: fix TestGroupCleanup{UserNamespace} on Alpine
Browse files Browse the repository at this point in the history
This updates TestGroupCleanup and TestGroupCleanupUserNamespace to pass in the
Alpine builder.

Updates #19938

Change-Id: Iacbfd73782eccd57f872f9e85726c6024529c277
Reviewed-on: https://go-review.googlesource.com/40692
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
jessfraz authored and bradfitz committed Apr 13, 2017
1 parent f75b5e9 commit 7517694
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/syscall/exec_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ func TestGroupCleanup(t *testing.T) {
t.Fatalf("Cmd failed with err %v, output: %s", err, out)
}
strOut := strings.TrimSpace(string(out))
expected := "uid=0(root) gid=0(root) groups=0(root)"
expected := "uid=0(root) gid=0(root)"
// Just check prefix because some distros reportedly output a
// context parameter; see https://golang.org/issue/16224.
// Alpine does not output groups; see https://golang.org/issue/19938.
if !strings.HasPrefix(strOut, expected) {
t.Errorf("id command output: %q, expected prefix: %q", strOut, expected)
}
Expand Down Expand Up @@ -247,6 +248,7 @@ func TestGroupCleanupUserNamespace(t *testing.T) {
"uid=0(root) gid=0(root) groups=0(root),65534(nobody)",
"uid=0(root) gid=0(root) groups=0(root),65534(nogroup)",
"uid=0(root) gid=0(root) groups=0(root),65534",
"uid=0(root) gid=0(root) groups=0(root),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody),65534(nobody)", // Alpine; see https://golang.org/issue/19938
}
for _, e := range expected {
if strOut == e {
Expand Down

0 comments on commit 7517694

Please sign in to comment.