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>
This commit is contained in:
Ed Santiago 2021-12-01 08:19:55 -07:00
parent 6b5ecde76e
commit 478f2da5d6
4 changed files with 11 additions and 11 deletions

View file

@ -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",
},

View file

@ -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")))
})
})

View file

@ -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 {

View file

@ -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() {