diff options
author | Ashley Cui <acui@redhat.com> | 2022-09-14 15:28:00 -0400 |
---|---|---|
committer | Ashley Cui <acui@redhat.com> | 2022-09-22 14:07:11 -0400 |
commit | dc05d1212c41d34f23d12cf1957917f5ce022f26 (patch) | |
tree | 6d6ad6a294496ffa7632ac2fa0eaa66ee2ff8b62 /test/e2e | |
parent | 828fae12971c5a7b9807c8c4f8e029fe5d0ddc2f (diff) | |
download | podman-dc05d1212c41d34f23d12cf1957917f5ce022f26.tar.gz podman-dc05d1212c41d34f23d12cf1957917f5ce022f26.tar.bz2 podman-dc05d1212c41d34f23d12cf1957917f5ce022f26.zip |
Add --pretty to podman secret inspect
Pretty-print podman secret inspect output in a human-readable format
Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/secret_test.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go index 286815e67..668a4943c 100644 --- a/test/e2e/secret_test.go +++ b/test/e2e/secret_test.go @@ -96,6 +96,23 @@ var _ = Describe("Podman secret", func() { Expect(inspect.OutputToString()).To(Equal(secrID)) }) + It("podman secret inspect with --pretty", func() { + secretFilePath := filepath.Join(podmanTest.TempDir, "secret") + err := os.WriteFile(secretFilePath, []byte("mysecret"), 0755) + Expect(err).To(BeNil()) + + session := podmanTest.Podman([]string{"secret", "create", "a", secretFilePath}) + session.WaitWithDefaultTimeout() + secrID := session.OutputToString() + Expect(session).Should(Exit(0)) + + inspect := podmanTest.Podman([]string{"secret", "inspect", "--pretty", secrID}) + inspect.WaitWithDefaultTimeout() + Expect(inspect).Should(Exit(0)) + Expect(inspect.OutputToString()).To(ContainSubstring("Name:")) + Expect(inspect.OutputToString()).To(ContainSubstring(secrID)) + }) + It("podman secret inspect multiple secrets", func() { secretFilePath := filepath.Join(podmanTest.TempDir, "secret") err := os.WriteFile(secretFilePath, []byte("mysecret"), 0755) @@ -125,7 +142,6 @@ var _ = Describe("Podman secret", func() { inspect := podmanTest.Podman([]string{"secret", "inspect", "bogus"}) inspect.WaitWithDefaultTimeout() Expect(inspect).To(ExitWithError()) - }) It("podman secret ls", func() { |