diff options
author | baude <bbaude@redhat.com> | 2018-01-31 18:47:51 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-01 19:04:00 +0000 |
commit | 0387f69d39b7ff15c78ff39ddb350523c73719d6 (patch) | |
tree | d19cbbeeaa105f7ee4dfaa733b0808d76a79f0cb /test/e2e/libpod_suite_test.go | |
parent | 03cfe5ebbee306ee4aa84c74bbff83712e50fb1c (diff) | |
download | podman-0387f69d39b7ff15c78ff39ddb350523c73719d6.tar.gz podman-0387f69d39b7ff15c78ff39ddb350523c73719d6.tar.bz2 podman-0387f69d39b7ff15c78ff39ddb350523c73719d6.zip |
Migrate kill tests to ginkgo
Migrate kill tests to the ginkgo suite and remove the
podman_kill bats.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #281
Approved by: baude
Diffstat (limited to 'test/e2e/libpod_suite_test.go')
-rw-r--r-- | test/e2e/libpod_suite_test.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index aaad97447..be9be93d8 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -345,11 +345,28 @@ func (p *PodmanTest) RunSleepContainer(name string) *PodmanSession { //RunLsContainer runs a simple container in the background that // simply runs ls. If the name passed != "", it will have a name -func (p *PodmanTest) RunLsContainer(name string) *PodmanSession { +func (p *PodmanTest) RunLsContainer(name string) (*PodmanSession, int, string) { var podmanArgs = []string{"run"} if name != "" { podmanArgs = append(podmanArgs, "--name", name) } podmanArgs = append(podmanArgs, "-d", ALPINE, "ls") - return p.Podman(podmanArgs) + session := p.Podman(podmanArgs) + session.WaitWithDefaultTimeout() + return session, session.ExitCode(), session.OutputToString() +} + +//NumberOfContainersRunning returns an int of how many +// containers are currently running. +func (p *PodmanTest) NumberOfContainersRunning() int { + var containers []string + ps := p.Podman([]string{"ps", "-q"}) + ps.WaitWithDefaultTimeout() + Expect(ps.ExitCode()).To(Equal(0)) + for _, i := range ps.OutputToStringArray() { + if i != "" { + containers = append(containers, i) + } + } + return len(containers) } |