Skip to content

Commit 7517694

Browse files
jessfrazbradfitz
authored andcommitted
syscall: fix TestGroupCleanup{UserNamespace} on Alpine
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í <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent f75b5e9 commit 7517694

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/syscall/exec_linux_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ func TestGroupCleanup(t *testing.T) {
207207
t.Fatalf("Cmd failed with err %v, output: %s", err, out)
208208
}
209209
strOut := strings.TrimSpace(string(out))
210-
expected := "uid=0(root) gid=0(root) groups=0(root)"
210+
expected := "uid=0(root) gid=0(root)"
211211
// Just check prefix because some distros reportedly output a
212212
// context parameter; see https://golang.org/issue/16224.
213+
// Alpine does not output groups; see https://golang.org/issue/19938.
213214
if !strings.HasPrefix(strOut, expected) {
214215
t.Errorf("id command output: %q, expected prefix: %q", strOut, expected)
215216
}
@@ -247,6 +248,7 @@ func TestGroupCleanupUserNamespace(t *testing.T) {
247248
"uid=0(root) gid=0(root) groups=0(root),65534(nobody)",
248249
"uid=0(root) gid=0(root) groups=0(root),65534(nogroup)",
249250
"uid=0(root) gid=0(root) groups=0(root),65534",
251+
"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
250252
}
251253
for _, e := range expected {
252254
if strOut == e {

0 commit comments

Comments
 (0)