summaryrefslogtreecommitdiff
path: root/test/e2e/generate_kube_test.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-11-30 13:14:56 -0700
committerEd Santiago <santiago@redhat.com>2021-11-30 15:19:57 -0700
commit9ce7ade8c8dedb6a082614e45aa10d0e37c725cc (patch)
treeaeefee1ec3a9bac7ee92c7d8d88f3d85c1364cef /test/e2e/generate_kube_test.go
parent295a6f7dd086731448a1168a349f62d3035258ca (diff)
downloadpodman-9ce7ade8c8dedb6a082614e45aa10d0e37c725cc.tar.gz
podman-9ce7ade8c8dedb6a082614e45aa10d0e37c725cc.tar.bz2
podman-9ce7ade8c8dedb6a082614e45aa10d0e37c725cc.zip
e2e: yet more cleanup of BeTrue/BeFalse
Thanks to Paul for teaching me about HaveKey() Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/e2e/generate_kube_test.go')
-rw-r--r--test/e2e/generate_kube_test.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index 62482598a..735334eec 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -606,9 +606,7 @@ var _ = Describe("Podman generate kube", func() {
pod := new(v1.Pod)
err = yaml.Unmarshal(b, pod)
Expect(err).To(BeNil())
- val, found := pod.Annotations[define.BindMountPrefix+vol1]
- Expect(found).To(BeTrue(), "pod.Annotations["+vol1+"]")
- Expect(val).To(HaveSuffix("z"))
+ Expect(pod.Annotations).To(HaveKeyWithValue(define.BindMountPrefix+vol1, HaveSuffix("z")))
rm := podmanTest.Podman([]string{"pod", "rm", "-t", "0", "-f", "test1"})
rm.WaitWithDefaultTimeout()
@@ -1071,9 +1069,7 @@ USER test1`
err := yaml.Unmarshal(kube.Out.Contents(), pod)
Expect(err).To(BeNil())
- v, ok := pod.GetAnnotations()["io.containers.autoupdate/top"]
- Expect(ok).To(Equal(true))
- Expect(v).To(Equal("local"))
+ Expect(pod.GetAnnotations()).To(HaveKeyWithValue("io.containers.autoupdate/top", "local"))
})
It("podman generate kube on pod with auto update labels in all containers", func() {
@@ -1100,13 +1096,8 @@ USER test1`
Expect(pod.Spec.Containers[1].WorkingDir).To(Equal("/root"))
for _, ctr := range []string{"top1", "top2"} {
- v, ok := pod.GetAnnotations()["io.containers.autoupdate/"+ctr]
- Expect(ok).To(Equal(true))
- Expect(v).To(Equal("registry"))
-
- v, ok = pod.GetAnnotations()["io.containers.autoupdate.authfile/"+ctr]
- Expect(ok).To(Equal(true))
- Expect(v).To(Equal("/some/authfile.json"))
+ Expect(pod.GetAnnotations()).To(HaveKeyWithValue("io.containers.autoupdate/"+ctr, "registry"))
+ Expect(pod.GetAnnotations()).To(HaveKeyWithValue("io.containers.autoupdate.authfile/"+ctr, "/some/authfile.json"))
}
})
})