diff options
Diffstat (limited to 'test/e2e/create_test.go')
-rw-r--r-- | test/e2e/create_test.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 4c3b5604a..9b1340a2c 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -268,7 +268,7 @@ var _ = Describe("Podman create", func() { Expect(session).Should(Exit(0)) ctrJSON := podmanTest.InspectContainer(ctrName) - Expect(podData.ID).To(Equal(ctrJSON[0].Pod)) // Make sure the container's pod matches the pod's ID + Expect(podData).To(HaveField("ID", ctrJSON[0].Pod)) // Make sure the container's pod matches the pod's ID }) It("podman run entrypoint and cmd test", func() { @@ -281,7 +281,7 @@ var _ = Describe("Podman create", func() { Expect(ctrJSON).To(HaveLen(1)) Expect(ctrJSON[0].Config.Cmd).To(HaveLen(1)) Expect(ctrJSON[0].Config.Cmd[0]).To(Equal("redis-server")) - Expect(ctrJSON[0].Config.Entrypoint).To(Equal("docker-entrypoint.sh")) + Expect(ctrJSON[0].Config).To(HaveField("Entrypoint", "docker-entrypoint.sh")) }) It("podman create --pull", func() { @@ -413,8 +413,8 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].HostConfig.RestartPolicy.Name).To(Equal("on-failure")) - Expect(data[0].HostConfig.RestartPolicy.MaximumRetryCount).To(Equal(uint(5))) + Expect(data[0].HostConfig.RestartPolicy).To(HaveField("Name", "on-failure")) + Expect(data[0].HostConfig.RestartPolicy).To(HaveField("MaximumRetryCount", uint(5))) }) It("podman create with --restart-policy=always:5 fails", func() { @@ -434,7 +434,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].HostConfig.RestartPolicy.Name).To(Equal(unlessStopped)) + Expect(data[0].HostConfig.RestartPolicy).To(HaveField("Name", unlessStopped)) }) It("podman create with -m 1000000 sets swap to 2000000", func() { @@ -448,7 +448,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].HostConfig.MemorySwap).To(Equal(int64(2 * numMem))) + Expect(data[0].HostConfig).To(HaveField("MemorySwap", int64(2 * numMem))) }) It("podman create --cpus 5 sets nanocpus", func() { @@ -463,7 +463,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].HostConfig.NanoCpus).To(Equal(int64(nanoCPUs))) + Expect(data[0].HostConfig).To(HaveField("NanoCpus", int64(nanoCPUs))) }) It("podman create --replace", func() { @@ -491,7 +491,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.StopSignal).To(Equal(uint(15))) + Expect(data[0].Config).To(HaveField("StopSignal", uint(15))) }) It("podman create --tz", func() { @@ -509,7 +509,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Timezone).To(Equal("Pacific/Honolulu")) + Expect(data[0].Config).To(HaveField("Timezone", "Pacific/Honolulu")) session = podmanTest.Podman([]string{"create", "--tz", "local", "--name", "lcl", ALPINE, "date"}) session.WaitWithDefaultTimeout() @@ -517,7 +517,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data = inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Timezone).To(Equal("local")) + Expect(data[0].Config).To(HaveField("Timezone", "local")) }) It("podman create --umask", func() { @@ -531,7 +531,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data := inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Umask).To(Equal("0022")) + Expect(data[0].Config).To(HaveField("Umask", "0022")) session = podmanTest.Podman([]string{"create", "--umask", "0002", "--name", "umask", ALPINE}) session.WaitWithDefaultTimeout() @@ -539,7 +539,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data = inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Umask).To(Equal("0002")) + Expect(data[0].Config).To(HaveField("Umask", "0002")) session = podmanTest.Podman([]string{"create", "--umask", "0077", "--name", "fedora", fedoraMinimal}) session.WaitWithDefaultTimeout() @@ -547,7 +547,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data = inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Umask).To(Equal("0077")) + Expect(data[0].Config).To(HaveField("Umask", "0077")) session = podmanTest.Podman([]string{"create", "--umask", "22", "--name", "umask-short", ALPINE}) session.WaitWithDefaultTimeout() @@ -555,7 +555,7 @@ var _ = Describe("Podman create", func() { inspect.WaitWithDefaultTimeout() data = inspect.InspectContainerToJSON() Expect(data).To(HaveLen(1)) - Expect(data[0].Config.Umask).To(Equal("0022")) + Expect(data[0].Config).To(HaveField("Umask", "0022")) session = podmanTest.Podman([]string{"create", "--umask", "9999", "--name", "bad", ALPINE}) session.WaitWithDefaultTimeout() @@ -689,8 +689,8 @@ var _ = Describe("Podman create", func() { idata := setup.InspectImageJSON() // returns []inspect.ImageData Expect(idata).To(HaveLen(1)) - Expect(idata[0].Os).To(Equal(runtime.GOOS)) - Expect(idata[0].Architecture).To(Equal("arm64")) + Expect(idata[0]).To(HaveField("Os", runtime.GOOS)) + Expect(idata[0]).To(HaveField("Architecture", "arm64")) }) It("podman create --uid/gidmap --pod conflict test", func() { |