diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-05-30 16:48:10 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-05-30 18:10:28 +0200 |
commit | ec576a54917d902df0de2daa1935ca22b102a2b9 (patch) | |
tree | 262c83c92f67862c6e68564d7c8a9ead7561f0c7 /test/e2e | |
parent | a550af260a536aeaa35e4b8810971748a6f16f5f (diff) | |
download | podman-ec576a54917d902df0de2daa1935ca22b102a2b9.tar.gz podman-ec576a54917d902df0de2daa1935ca22b102a2b9.tar.bz2 podman-ec576a54917d902df0de2daa1935ca22b102a2b9.zip |
podman volume export/import: give better error
When the volume does not exist we should output an error stating so and
not some generic one.
Fixes #14411
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/volume_create_test.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/test/e2e/volume_create_test.go b/test/e2e/volume_create_test.go index 0bf5acbf1..499283cab 100644 --- a/test/e2e/volume_create_test.go +++ b/test/e2e/volume_create_test.go @@ -110,15 +110,24 @@ var _ = Describe("Podman volume create", func() { Expect(session.OutputToString()).To(ContainSubstring("hello")) }) - It("podman import volume should fail", func() { + It("podman import/export volume should fail", func() { // try import on volume or source which does not exists - if podmanTest.RemoteTest { - Skip("Volume export check does not work with a remote client") - } + SkipIfRemote("Volume export check does not work with a remote client") session := podmanTest.Podman([]string{"volume", "import", "notfound", "notfound.tar"}) session.WaitWithDefaultTimeout() Expect(session).To(ExitWithError()) + Expect(session.ErrorToString()).To(ContainSubstring("open notfound.tar: no such file or directory")) + + session = podmanTest.Podman([]string{"volume", "import", "notfound", "-"}) + session.WaitWithDefaultTimeout() + Expect(session).To(ExitWithError()) + Expect(session.ErrorToString()).To(ContainSubstring("no such volume notfound")) + + session = podmanTest.Podman([]string{"volume", "export", "notfound"}) + session.WaitWithDefaultTimeout() + Expect(session).To(ExitWithError()) + Expect(session.ErrorToString()).To(ContainSubstring("no such volume notfound")) }) It("podman create volume with bad volume option", func() { |