summaryrefslogtreecommitdiff
path: root/test/e2e/container_clone_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-28 10:25:46 -0400
committerGitHub <noreply@github.com>2022-04-28 10:25:46 -0400
commit87454cf87a36f3cab0a8a613d20011fc896b1ce4 (patch)
tree4428e8213fb04163a1670b15d8a60671aab0adac /test/e2e/container_clone_test.go
parentd0b96a541dc69e98d1923f8b297876f787bdb2db (diff)
parenta5aea8e503e6b2e6226392008c975444c76bc55b (diff)
downloadpodman-87454cf87a36f3cab0a8a613d20011fc896b1ce4.tar.gz
podman-87454cf87a36f3cab0a8a613d20011fc896b1ce4.tar.bz2
podman-87454cf87a36f3cab0a8a613d20011fc896b1ce4.zip
Merge pull request #14040 from edsantiago/gomega_havefield
e2e tests: use HaveField() for better error checking
Diffstat (limited to 'test/e2e/container_clone_test.go')
-rw-r--r--test/e2e/container_clone_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index 42b477da0..c47a89332 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -68,8 +68,8 @@ var _ = Describe("Podman container clone", func() {
ctrInspect := podmanTest.Podman([]string{"inspect", clone.OutputToString()})
ctrInspect.WaitWithDefaultTimeout()
Expect(ctrInspect).To(Exit(0))
- Expect(ctrInspect.InspectContainerToJSON()[0].ImageName).To(Equal(fedoraMinimal))
- Expect(ctrInspect.InspectContainerToJSON()[0].Name).To(Equal("new_name"))
+ Expect(ctrInspect.InspectContainerToJSON()[0]).To(HaveField("ImageName", fedoraMinimal))
+ Expect(ctrInspect.InspectContainerToJSON()[0]).To(HaveField("Name", "new_name"))
})
It("podman container clone name test", func() {
@@ -84,7 +84,7 @@ var _ = Describe("Podman container clone", func() {
cloneInspect.WaitWithDefaultTimeout()
Expect(cloneInspect).To(Exit(0))
cloneData := cloneInspect.InspectContainerToJSON()
- Expect(cloneData[0].Name).To(Equal("testing123"))
+ Expect(cloneData[0]).To(HaveField("Name", "testing123"))
})
It("podman container clone resource limits override", func() {
@@ -104,7 +104,7 @@ var _ = Describe("Podman container clone", func() {
cloneInspect.WaitWithDefaultTimeout()
Expect(cloneInspect).To(Exit(0))
cloneData := cloneInspect.InspectContainerToJSON()
- Expect(createData[0].HostConfig.NanoCpus).To(Equal(cloneData[0].HostConfig.NanoCpus))
+ Expect(createData[0].HostConfig).To(HaveField("NanoCpus", cloneData[0].HostConfig.NanoCpus))
create = podmanTest.Podman([]string{"create", "--memory=5", ALPINE})
create.WaitWithDefaultTimeout()
@@ -122,7 +122,7 @@ var _ = Describe("Podman container clone", func() {
cloneInspect.WaitWithDefaultTimeout()
Expect(cloneInspect).To(Exit(0))
cloneData = cloneInspect.InspectContainerToJSON()
- Expect(createData[0].HostConfig.MemorySwap).To(Equal(cloneData[0].HostConfig.MemorySwap))
+ Expect(createData[0].HostConfig).To(HaveField("MemorySwap", cloneData[0].HostConfig.MemorySwap))
create = podmanTest.Podman([]string{"create", "--cpus=5", ALPINE})
create.WaitWithDefaultTimeout()
@@ -145,7 +145,7 @@ var _ = Describe("Podman container clone", func() {
Expect(cloneInspect).To(Exit(0))
cloneData = cloneInspect.InspectContainerToJSON()
Expect(createData[0].HostConfig.NanoCpus).ToNot(Equal(cloneData[0].HostConfig.NanoCpus))
- Expect(cloneData[0].HostConfig.NanoCpus).To(Equal(nanoCPUs))
+ Expect(cloneData[0].HostConfig).To(HaveField("NanoCpus", nanoCPUs))
create = podmanTest.Podman([]string{"create", ALPINE})
create.WaitWithDefaultTimeout()
@@ -158,7 +158,7 @@ var _ = Describe("Podman container clone", func() {
cloneInspect.WaitWithDefaultTimeout()
Expect(cloneInspect).To(Exit(0))
cloneData = cloneInspect.InspectContainerToJSON()
- Expect(cloneData[0].HostConfig.MemorySwappiness).To(Equal(int64(0)))
+ Expect(cloneData[0].HostConfig).To(HaveField("MemorySwappiness", int64(0)))
})