mirror of
https://github.com/containers/podman.git
synced 2025-12-11 09:18:34 +08:00
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>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user