diff options
author | baude <bbaude@redhat.com> | 2018-01-30 13:19:01 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-31 20:23:31 +0000 |
commit | 3c044f9267f62b8f7f88c7395ad325df3bf420f5 (patch) | |
tree | d868f625ff78b5403fa82b9e7f51ffdaa953356a /test/e2e/libpod_suite_test.go | |
parent | ecb74aa40641cd322112401a593eaf26458e9d24 (diff) | |
download | podman-3c044f9267f62b8f7f88c7395ad325df3bf420f5.tar.gz podman-3c044f9267f62b8f7f88c7395ad325df3bf420f5.tar.bz2 podman-3c044f9267f62b8f7f88c7395ad325df3bf420f5.zip |
Ginkgo Tests: ps, pull, push and rm
Migrate ps, pull, push, and rm from bats to ginkgo.
Also, fixed a conditional issue with adding ports
when an image defines the port and the user wants
to override it.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #277
Approved by: baude
Diffstat (limited to 'test/e2e/libpod_suite_test.go')
-rw-r--r-- | test/e2e/libpod_suite_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index c83105325..95b9def77 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -205,6 +205,13 @@ func (s *PodmanSession) OutputToString() string { return strings.Join(fields, " ") } +// OutputToStringArray returns the output as a []string +// where each array item is a line split by newline +func (s *PodmanSession) OutputToStringArray() []string { + output := fmt.Sprintf("%s", s.Out.Contents()) + return strings.Split(output, "\n") +} + // IsJSONOutputValid attempts to unmarshall the session buffer // and if successful, returns true, else false func (s *PodmanSession) IsJSONOutputValid() bool { @@ -335,3 +342,14 @@ func (p *PodmanTest) RunSleepContainer(name string) *PodmanSession { podmanArgs = append(podmanArgs, "-d", ALPINE, "sleep", "90") return p.Podman(podmanArgs) } + +//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 { + var podmanArgs = []string{"run"} + if name != "" { + podmanArgs = append(podmanArgs, "--name", name) + } + podmanArgs = append(podmanArgs, "-d", ALPINE, "ls") + return p.Podman(podmanArgs) +} |