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:
Alexander Morozov 2015-06-22 10:56:27 -07:00
parent f20d95b6f2
commit 5c56d28043
1 changed files with 3 additions and 0 deletions

View File

@ -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)
} }