summaryrefslogtreecommitdiff
path: root/pkg/bindings/test/images_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-14 14:01:20 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-19 09:38:00 -0500
commitd1c26af144b314f30cd69d42e33ab8cbacb080ff (patch)
treec8b2bb6ce98631334e539086b2aa490c7e2bc770 /pkg/bindings/test/images_test.go
parente87fe4dbbbc55be42d7a31f5415f55d2ff99f81b (diff)
downloadpodman-d1c26af144b314f30cd69d42e33ab8cbacb080ff.tar.gz
podman-d1c26af144b314f30cd69d42e33ab8cbacb080ff.tar.bz2
podman-d1c26af144b314f30cd69d42e33ab8cbacb080ff.zip
apiv2 add bindings for logs|events
add go-bindings for logs and events. tests were also added. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/test/images_test.go')
-rw-r--r--pkg/bindings/test/images_test.go26
1 files changed, 12 insertions, 14 deletions
diff --git a/pkg/bindings/test/images_test.go b/pkg/bindings/test/images_test.go
index 17b3b254a..5e4cfe7be 100644
--- a/pkg/bindings/test/images_test.go
+++ b/pkg/bindings/test/images_test.go
@@ -19,11 +19,9 @@ var _ = Describe("Podman images", func() {
//tempdir string
//err error
//podmanTest *PodmanTestIntegration
- bt *bindingTest
- s *gexec.Session
- err error
- falseFlag bool = false
- trueFlag bool = true
+ bt *bindingTest
+ s *gexec.Session
+ err error
)
BeforeEach(func() {
@@ -76,7 +74,7 @@ var _ = Describe("Podman images", func() {
//Expect(data.Size).To(BeZero())
// Enabling the size parameter should result in size being populated
- data, err = images.GetImage(bt.conn, alpine.name, &trueFlag)
+ data, err = images.GetImage(bt.conn, alpine.name, &bindings.PTrue)
Expect(err).To(BeNil())
Expect(data.Size).To(BeNumerically(">", 0))
})
@@ -84,7 +82,7 @@ var _ = Describe("Podman images", func() {
// Test to validate the remove image api
It("remove image", func() {
// Remove invalid image should be a 404
- _, err = images.Remove(bt.conn, "foobar5000", &falseFlag)
+ _, err = images.Remove(bt.conn, "foobar5000", &bindings.PFalse)
Expect(err).ToNot(BeNil())
code, _ := bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusNotFound))
@@ -101,21 +99,21 @@ var _ = Describe("Podman images", func() {
// Start a container with alpine image
var top string = "top"
- _, err = bt.RunTopContainer(&top, &falseFlag, nil)
+ _, err = bt.RunTopContainer(&top, &bindings.PFalse, nil)
Expect(err).To(BeNil())
// we should now have a container called "top" running
- containerResponse, err := containers.Inspect(bt.conn, "top", &falseFlag)
+ containerResponse, err := containers.Inspect(bt.conn, "top", &bindings.PFalse)
Expect(err).To(BeNil())
Expect(containerResponse.Name).To(Equal("top"))
// try to remove the image "alpine". This should fail since we are not force
// deleting hence image cannot be deleted until the container is deleted.
- response, err = images.Remove(bt.conn, alpine.shortName, &falseFlag)
+ response, err = images.Remove(bt.conn, alpine.shortName, &bindings.PFalse)
code, _ = bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusInternalServerError))
// Removing the image "alpine" where force = true
- response, err = images.Remove(bt.conn, alpine.shortName, &trueFlag)
+ response, err = images.Remove(bt.conn, alpine.shortName, &bindings.PTrue)
Expect(err).To(BeNil())
// Checking if both the images are gone as well as the container is deleted
@@ -127,7 +125,7 @@ var _ = Describe("Podman images", func() {
code, _ = bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusNotFound))
- _, err = containers.Inspect(bt.conn, "top", &falseFlag)
+ _, err = containers.Inspect(bt.conn, "top", &bindings.PFalse)
code, _ = bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusNotFound))
})
@@ -178,13 +176,13 @@ var _ = Describe("Podman images", func() {
// List images with a filter
filters := make(map[string][]string)
filters["reference"] = []string{alpine.name}
- filteredImages, err := images.List(bt.conn, &falseFlag, filters)
+ filteredImages, err := images.List(bt.conn, &bindings.PFalse, filters)
Expect(err).To(BeNil())
Expect(len(filteredImages)).To(BeNumerically("==", 1))
// List images with a bad filter
filters["name"] = []string{alpine.name}
- _, err = images.List(bt.conn, &falseFlag, filters)
+ _, err = images.List(bt.conn, &bindings.PFalse, filters)
Expect(err).ToNot(BeNil())
code, _ := bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusInternalServerError))