From 75176947d6791e8f2c128e8ae8847f05507b6336 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Thu, 13 Apr 2017 21:22:22 +0000 Subject: [PATCH] syscall: fix TestGroupCleanup{UserNamespace} on Alpine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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í Reviewed-by: Brad Fitzpatrick Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot --- src/syscall/exec_linux_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go index 9551e7ec716d0..83cde96b1fab9 100644 --- a/src/syscall/exec_linux_test.go +++ b/src/syscall/exec_linux_test.go @@ -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) } @@ -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 {