summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-09-23 09:57:38 +0200
committerMatthew Heon <mheon@redhat.com>2020-09-25 11:17:24 -0400
commit5de9b2b5120780c47fcc15e48796c7656563dda7 (patch)
tree6876c80ff39439cf85849fd47ba7d4263da1e670 /test
parent8cae9b56f7888baeee5f45df09d65ff48b0b2c42 (diff)
downloadpodman-5de9b2b5120780c47fcc15e48796c7656563dda7.tar.gz
podman-5de9b2b5120780c47fcc15e48796c7656563dda7.tar.bz2
podman-5de9b2b5120780c47fcc15e48796c7656563dda7.zip
remote load: check if input is directory
The remote client does not support loading directories yet. To prevent confusing error messages and to make the behaviour more explicit, check if the input points to a directory and throw an error if needed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/load_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go
index 2b401a09d..b719b034e 100644
--- a/test/e2e/load_test.go
+++ b/test/e2e/load_test.go
@@ -139,6 +139,22 @@ var _ = Describe("Podman load", func() {
Expect(result.ExitCode()).To(Equal(0))
})
+ It("podman-remote load directory", func() {
+ // Remote-only test looking for the specific remote error
+ // message when trying to load a directory.
+ if !IsRemote() {
+ Skip("Remote only test")
+ }
+
+ result := podmanTest.Podman([]string{"load", "-i", podmanTest.TempDir})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(125))
+
+ errMsg := fmt.Sprintf("remote client supports archives only but %q is a directory", podmanTest.TempDir)
+ found, _ := result.ErrorGrepString(errMsg)
+ Expect(found).Should(BeTrue())
+ })
+
It("podman load bogus file", func() {
save := podmanTest.PodmanNoCache([]string{"load", "-i", "foobar.tar"})
save.WaitWithDefaultTimeout()