From fe014a8e6cfe4d2a338736e4c685bcf1b7685200 Mon Sep 17 00:00:00 2001 From: Louis Opter Date: Thu, 27 Jun 2013 17:53:57 -0700 Subject: [PATCH] Always return the correct test image. And not a *random* one from its history. --- runtime_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime_test.go b/runtime_test.go index 61a8f346f7..f6235e8c56 100644 --- a/runtime_test.go +++ b/runtime_test.go @@ -135,10 +135,13 @@ func GetTestImage(runtime *Runtime) *Image { imgs, err := runtime.graph.All() if err != nil { panic(err) - } else if len(imgs) < 1 { - panic("GASP") } - return imgs[0] + for i := range imgs { + if imgs[i].ID == unitTestImageId { + return imgs[i] + } + } + panic(fmt.Errorf("Test image %v not found", unitTestImageId)) } func TestRuntimeCreate(t *testing.T) {