diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-31 12:46:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 12:46:38 -0400 |
commit | d1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8 (patch) | |
tree | 35c4d9910fc9bf56e9a4ddf493d1fb71022e72aa /test | |
parent | 4ba71f955a944790edda6e007e6d074009d437a7 (diff) | |
parent | e5745139a71bd5b894d5fb6a80c04c39fd71540a (diff) | |
download | podman-d1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8.tar.gz podman-d1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8.tar.bz2 podman-d1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8.zip |
Merge pull request #13738 from Luap99/remote-command
cli commands: better error for unsupported commands
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/unshare_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/e2e/unshare_test.go b/test/e2e/unshare_test.go index ac4fa46bf..8b06dd4f5 100644 --- a/test/e2e/unshare_test.go +++ b/test/e2e/unshare_test.go @@ -16,7 +16,6 @@ var _ = Describe("Podman unshare", func() { podmanTest *PodmanTestIntegration ) BeforeEach(func() { - SkipIfRemote("podman-remote unshare is not supported") if _, err := os.Stat("/proc/self/uid_map"); err != nil { Skip("User namespaces not supported.") } @@ -43,6 +42,7 @@ var _ = Describe("Podman unshare", func() { }) It("podman unshare", func() { + SkipIfRemote("podman-remote unshare is not supported") userNS, _ := os.Readlink("/proc/self/ns/user") session := podmanTest.Podman([]string{"unshare", "readlink", "/proc/self/ns/user"}) session.WaitWithDefaultTimeout() @@ -50,7 +50,8 @@ var _ = Describe("Podman unshare", func() { Expect(session.OutputToString()).ToNot(ContainSubstring(userNS)) }) - It("podman unshare --rootles-cni", func() { + It("podman unshare --rootless-cni", func() { + SkipIfRemote("podman-remote unshare is not supported") session := podmanTest.Podman([]string{"unshare", "--rootless-netns", "ip", "addr"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) @@ -58,6 +59,7 @@ var _ = Describe("Podman unshare", func() { }) It("podman unshare exit codes", func() { + SkipIfRemote("podman-remote unshare is not supported") session := podmanTest.Podman([]string{"unshare", "false"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(1)) @@ -88,4 +90,12 @@ var _ = Describe("Podman unshare", func() { Expect(session.OutputToString()).Should(Equal("")) Expect(session.ErrorToString()).Should(ContainSubstring("unknown flag: --bogus")) }) + + It("podman unshare check remote error", func() { + SkipIfNotRemote("check for podman-remote unshare error") + session := podmanTest.Podman([]string{"unshare"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToString()).To(Equal(`Error: cannot use command "podman-remote unshare" with the remote podman client`)) + }) }) |