From a75c94a19573e8bc488b8970ab6bc73b8449158d Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Mon, 28 Mar 2016 16:23:58 -0700 Subject: [PATCH] Update busybox top to check validity of running container list Signed-off-by: Kenfe-Mickael Laventure --- integration-test/start_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/integration-test/start_test.go b/integration-test/start_test.go index 5972a7d..5303499 100644 --- a/integration-test/start_test.go +++ b/integration-test/start_test.go @@ -1,6 +1,7 @@ package main import ( + "path/filepath" "time" "github.com/docker/containerd/api/grpc/types" @@ -52,12 +53,22 @@ func (cs *ContainerdSuite) TestStartBusyboxNoSuchFile(t *check.C) { } func (cs *ContainerdSuite) TestStartBusyboxTop(t *check.C) { - if err := CreateBusyboxBundle("busybox-top", []string{"top"}); err != nil { + bundleName := "busybox-top" + if err := CreateBusyboxBundle(bundleName, []string{"top"}); err != nil { t.Fatal(err) } - _, err := cs.StartContainer("top", "busybox-top") + _, err := cs.StartContainer("top", bundleName) t.Assert(err, checker.Equals, nil) + + containers, err := cs.ListRunningContainers() + if err != nil { + t.Fatal(err) + } + t.Assert(len(containers), checker.Equals, 1) + t.Assert(containers[0].Id, checker.Equals, "top") + t.Assert(containers[0].Status, checker.Equals, "running") + t.Assert(containers[0].BundlePath, check.Equals, filepath.Join(cs.cwd, GetBundle(bundleName).Path)) } func (cs *ContainerdSuite) TestStartBusyboxLsEvents(t *check.C) {