summaryrefslogtreecommitdiff
path: root/test/e2e/secret_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/secret_test.go')
-rw-r--r--test/e2e/secret_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go
index 902f422bd..91135b958 100644
--- a/test/e2e/secret_test.go
+++ b/test/e2e/secret_test.go
@@ -310,4 +310,41 @@ var _ = Describe("Podman secret", func() {
Expect(inspect.OutputToString()).To(Equal(secrID))
})
+ It("podman secret with labels", func() {
+ secretFilePath := filepath.Join(podmanTest.TempDir, "secret")
+ err := ioutil.WriteFile(secretFilePath, []byte("mysecret"), 0755)
+ Expect(err).To(BeNil())
+
+ session := podmanTest.Podman([]string{"secret", "create", "--label", "foo=bar", "a", secretFilePath})
+ session.WaitWithDefaultTimeout()
+ secrID := session.OutputToString()
+ Expect(session).Should(Exit(0))
+
+ inspect := podmanTest.Podman([]string{"secret", "inspect", "--format", "{{.Spec.Labels}}", secrID})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).Should(Exit(0))
+ Expect(inspect.OutputToString()).To(ContainSubstring("foo:bar"))
+
+ session = podmanTest.Podman([]string{"secret", "create", "--label", "foo=bar", "--label", "a:b", "b", secretFilePath})
+ session.WaitWithDefaultTimeout()
+ secrID = session.OutputToString()
+ Expect(session).Should(Exit(0))
+
+ inspect = podmanTest.Podman([]string{"secret", "inspect", "--format", "{{.Spec.Labels}}", secrID})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).Should(Exit(0))
+ Expect(inspect.OutputToString()).To(ContainSubstring("foo:bar"))
+ Expect(inspect.OutputToString()).To(ContainSubstring("a:b"))
+
+ session = podmanTest.Podman([]string{"secret", "create", "c", secretFilePath})
+ session.WaitWithDefaultTimeout()
+ secrID = session.OutputToString()
+ Expect(session).Should(Exit(0))
+
+ inspect = podmanTest.Podman([]string{"secret", "inspect", "--format", "{{.Spec.Labels}}", secrID})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).Should(Exit(0))
+ Expect(inspect.OutputToString()).To(Equal("map[]"))
+
+ })
})