Skip to content

Commit 55dcc9a

Browse files
committed
WIP: adjust test to handle musl
1 parent 5d17904 commit 55dcc9a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

libcontainer/integration/seccomp_test.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,23 @@ func TestSeccompMultipleConditionSameArgDeniesStdout(t *testing.T) {
335335
},
336336
}
337337

338-
buffers := runContainerOk(t, config, "ls", "/")
338+
buffers, exitCode, err := runContainer(t, config, "echo", "hey")
339339
// Verify that nothing was printed
340-
if len(buffers.Stdout.String()) != 0 {
341-
t.Fatalf("Something was written to stdout, write call succeeded!\n")
340+
if out := buffers.Stdout.String(); out != "" {
341+
t.Fatalf("want empty stdout, got %q", out)
342+
}
343+
if outErr := buffers.Stderr.String(); outErr != "" {
344+
t.Fatalf("want empty stderr, got %q", outErr)
345+
}
346+
if exitCode == 0 {
347+
t.Fatalf("want non-zero exit code, got 0")
348+
}
349+
if err == nil {
350+
t.Fatalf("want error, got nil")
351+
}
352+
// TODO for some reason, exitCode from "runContainer" is -1 when it should probably be 1?
353+
if errStr := err.Error(); errStr != "exit status 1" {
354+
t.Fatalf("want exit status 1, got %q", errStr)
342355
}
343356
}
344357

0 commit comments

Comments
 (0)