diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-09-23 09:57:38 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-09-24 14:40:54 +0200 |
commit | 1f66a827e892e0133cee6485095e129f0e5047f0 (patch) | |
tree | b5b64ea221e588bfa27a8d7dcbb196987d8ce22e /test | |
parent | 08cc91926db1cd17509f8578e2ff00a94747dbd4 (diff) | |
download | podman-1f66a827e892e0133cee6485095e129f0e5047f0.tar.gz podman-1f66a827e892e0133cee6485095e129f0e5047f0.tar.bz2 podman-1f66a827e892e0133cee6485095e129f0e5047f0.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.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go index c517c90d8..ddffadac0 100644 --- a/test/e2e/load_test.go +++ b/test/e2e/load_test.go @@ -123,7 +123,7 @@ var _ = Describe("Podman load", func() { }) It("podman load directory", func() { - SkipIfRemote("FIXME: Remote Load is broken.") + SkipIfRemote("Remote does not support loading directories") outdir := filepath.Join(podmanTest.TempDir, "alpine") save := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-dir", "-o", outdir, ALPINE}) @@ -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() |