From 5c56d2804362a27d4e307c5bb345e1eb3a0a88dc Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 22 Jun 2015 10:56:27 -0700 Subject: [PATCH] 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 --- libcontainer/integration/exec_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcontainer/integration/exec_test.go b/libcontainer/integration/exec_test.go index 5effa20a..c14c659f 100644 --- a/libcontainer/integration/exec_test.go +++ b/libcontainer/integration/exec_test.go @@ -812,6 +812,9 @@ func TestSeccompNoChown(t *testing.T) { if err == nil { 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") { t.Fatalf("running chown should result in an EPERM but got %q", s) }