diff options
author | Ed Santiago <santiago@redhat.com> | 2021-12-01 08:19:55 -0700 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2021-12-02 07:54:53 -0700 |
commit | 478f2da5d6bedf6390be1c0f3928f9ec13894d6d (patch) | |
tree | 03b762f70d3ba918d378da0552e720a55731d2fa /test | |
parent | 6b5ecde76ebb177b1ab1dd9e9555fc198ad90858 (diff) | |
download | podman-478f2da5d6bedf6390be1c0f3928f9ec13894d6d.tar.gz podman-478f2da5d6bedf6390be1c0f3928f9ec13894d6d.tar.bz2 podman-478f2da5d6bedf6390be1c0f3928f9ec13894d6d.zip |
e2e tests: a little more minor cleanup
sed -i -e 's/Expect(\(.*\)\[\(\".*\"\)\])\.To(Equal(/Expect(\1).To(HaveKeyWithValue(\2, /' test/e2e/*_test.go
...with two manual tweaks, because this converted:
Expect(foo["bar"]).To(Equal(""))
-> Expect(foo).To(HaveKeyWithValue("bar",""))
It looks like the intention of the test was, instead:
...To(Not(HaveKey("bar")))
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/image_scp_test.go | 2 | ||||
-rw-r--r-- | test/e2e/play_build_test.go | 12 | ||||
-rw-r--r-- | test/e2e/run_test.go | 6 | ||||
-rw-r--r-- | test/e2e/trust_test.go | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/test/e2e/image_scp_test.go b/test/e2e/image_scp_test.go index 6c6c85bc3..6651a04b5 100644 --- a/test/e2e/image_scp_test.go +++ b/test/e2e/image_scp_test.go @@ -109,7 +109,7 @@ var _ = Describe("podman image scp", func() { cfg, err := config.ReadCustomConfig() Expect(err).ShouldNot(HaveOccurred()) Expect(cfg.Engine.ActiveService).To(Equal("QA")) - Expect(cfg.Engine.ServiceDestinations["QA"]).To(Equal( + Expect(cfg.Engine.ServiceDestinations).To(HaveKeyWithValue("QA", config.Destination{ URI: "ssh://root@server.fubar.com:2222/run/podman/podman.sock", }, diff --git a/test/e2e/play_build_test.go b/test/e2e/play_build_test.go index 9bdf9d06b..a56560634 100644 --- a/test/e2e/play_build_test.go +++ b/test/e2e/play_build_test.go @@ -125,7 +125,7 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) }) It("Check that image is built using Containerfile", func() { @@ -162,7 +162,7 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) }) It("Do not build image if already in the local store", func() { @@ -208,8 +208,8 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("")) - Expect(inspectData[0].Config.Labels["marge"]).To(Equal("mom")) + Expect(inspectData[0].Config.Labels).To(Not(HaveKey("homer"))) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("marge", "mom")) }) It("--build should override image in store", func() { @@ -255,8 +255,8 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) - Expect(inspectData[0].Config.Labels["marge"]).To(Equal("")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) + Expect(inspectData[0].Config.Labels).To(Not(HaveKey("marge"))) }) }) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 3d4c1240e..5a08a39f7 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -289,7 +289,7 @@ var _ = Describe("Podman run", func() { Expect(result).Should(Exit(0)) conData := result.InspectContainerToJSON() Expect(conData[0].Path).To(Equal("/dev/init")) - Expect(conData[0].Config.Annotations["io.podman.annotations.init"]).To(Equal("TRUE")) + Expect(conData[0].Config.Annotations).To(HaveKeyWithValue("io.podman.annotations.init", "TRUE")) }) It("podman run a container with --init and --init-path", func() { @@ -301,7 +301,7 @@ var _ = Describe("Podman run", func() { Expect(result).Should(Exit(0)) conData := result.InspectContainerToJSON() Expect(conData[0].Path).To(Equal("/dev/init")) - Expect(conData[0].Config.Annotations["io.podman.annotations.init"]).To(Equal("TRUE")) + Expect(conData[0].Config.Annotations).To(HaveKeyWithValue("io.podman.annotations.init", "TRUE")) }) It("podman run a container without --init", func() { @@ -313,7 +313,7 @@ var _ = Describe("Podman run", func() { Expect(result).Should(Exit(0)) conData := result.InspectContainerToJSON() Expect(conData[0].Path).To(Equal("ls")) - Expect(conData[0].Config.Annotations["io.podman.annotations.init"]).To(Equal("FALSE")) + Expect(conData[0].Config.Annotations).To(HaveKeyWithValue("io.podman.annotations.init", "FALSE")) }) forbidGetCWDSeccompProfile := func() string { diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go index 9a0d57d7a..e02bfa7f2 100644 --- a/test/e2e/trust_test.go +++ b/test/e2e/trust_test.go @@ -69,7 +69,7 @@ var _ = Describe("Podman trust", func() { if err != nil { os.Exit(1) } - Expect(teststruct["default"][0]["type"]).To(Equal("insecureAcceptAnything")) + Expect(teststruct["default"][0]).To(HaveKeyWithValue("type", "insecureAcceptAnything")) }) It("podman image trust show --json", func() { |