diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-22 15:46:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 15:46:47 -0400 |
commit | 51d4b88ce976708de88ce041a03d6d65dd4c8d0e (patch) | |
tree | 8f358e694b159f48352d3fd3df39696c98177999 /test/e2e | |
parent | aefd0aed3990848e77b706d673c23108092594a0 (diff) | |
parent | eee0ec97e8eb7436208b7852e7e9ee5974384395 (diff) | |
download | podman-51d4b88ce976708de88ce041a03d6d65dd4c8d0e.tar.gz podman-51d4b88ce976708de88ce041a03d6d65dd4c8d0e.tar.bz2 podman-51d4b88ce976708de88ce041a03d6d65dd4c8d0e.zip |
Merge pull request #15392 from ashley-cui/quiet
Add quiet/q flag to podman secret ls
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/secret_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go index 3410c0af5..c6d5e6391 100644 --- a/test/e2e/secret_test.go +++ b/test/e2e/secret_test.go @@ -145,6 +145,36 @@ var _ = Describe("Podman secret", func() { }) + It("podman secret ls --quiet", func() { + secretFilePath := filepath.Join(podmanTest.TempDir, "secret") + err := ioutil.WriteFile(secretFilePath, []byte("mysecret"), 0755) + Expect(err).To(BeNil()) + + secretName := "a" + + session := podmanTest.Podman([]string{"secret", "create", secretName, secretFilePath}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + secretID := session.OutputToString() + + list := podmanTest.Podman([]string{"secret", "ls", "-q"}) + list.WaitWithDefaultTimeout() + Expect(list).Should(Exit(0)) + Expect(list.OutputToString()).To(Equal(secretID)) + + list = podmanTest.Podman([]string{"secret", "ls", "--quiet"}) + list.WaitWithDefaultTimeout() + Expect(list).Should(Exit(0)) + Expect(list.OutputToString()).To(Equal(secretID)) + + // Prefer format over quiet + list = podmanTest.Podman([]string{"secret", "ls", "-q", "--format", "{{.Name}}"}) + list.WaitWithDefaultTimeout() + Expect(list).Should(Exit(0)) + Expect(list.OutputToString()).To(Equal(secretName)) + + }) + It("podman secret ls with filters", func() { secretFilePath := filepath.Join(podmanTest.TempDir, "secret") err := ioutil.WriteFile(secretFilePath, []byte("mysecret"), 0755) |