Fix panic in seccomp test on error
It can happen if newContainer is failed. Now test shows real error from newContainer instead of trace. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
f20d95b6f2
commit
5c56d28043
|
@ -812,6 +812,9 @@ func TestSeccompNoChown(t *testing.T) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("running chown in a container should fail")
|
t.Fatal("running chown in a container should fail")
|
||||||
}
|
}
|
||||||
|
if buffers == nil {
|
||||||
|
t.Fatalf("Container wasn't even created: %v", err)
|
||||||
|
}
|
||||||
if s := buffers.String(); !strings.Contains(s, "not permitted") {
|
if s := buffers.String(); !strings.Contains(s, "not permitted") {
|
||||||
t.Fatalf("running chown should result in an EPERM but got %q", s)
|
t.Fatalf("running chown should result in an EPERM but got %q", s)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue