diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-13 16:04:05 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-13 19:51:20 -0500 |
commit | d8d1aa49d27d51f914a0858ab99c57d7dc929926 (patch) | |
tree | 715f035f049b161b55932fa9586f24c1876f11a5 /pkg/bindings/test/containers_test.go | |
parent | 5cf64aee11063bc8e7ff22f1365b0bf6b3ab0900 (diff) | |
download | podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.tar.gz podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.tar.bz2 podman-d8d1aa49d27d51f914a0858ab99c57d7dc929926.zip |
v2podman add container init
add the ability to init a container both local and remote
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/test/containers_test.go')
-rw-r--r-- | pkg/bindings/test/containers_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go index a8e2fd071..c6501ac9e 100644 --- a/pkg/bindings/test/containers_test.go +++ b/pkg/bindings/test/containers_test.go @@ -513,4 +513,22 @@ var _ = Describe("Podman containers ", func() { Expect(err).To(BeNil()) }) + It("container init on a bogus container", func() { + err := containers.ContainerInit(bt.conn, "doesnotexist") + Expect(err).ToNot(BeNil()) + code, _ := bindings.CheckResponseCode(err) + Expect(code).To(BeNumerically("==", http.StatusNotFound)) + }) + + It("container init", func() { + s := specgen.NewSpecGenerator(alpine.name) + ctr, err := containers.CreateWithSpec(bt.conn, s) + Expect(err).To(BeNil()) + err = containers.ContainerInit(bt.conn, ctr.ID) + Expect(err).To(BeNil()) + // trying to init again should be an error + err = containers.ContainerInit(bt.conn, ctr.ID) + Expect(err).ToNot(BeNil()) + }) + }) |