From d5d6e6859286ab9310e4a79082d50c816941f1ae Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Sun, 29 Apr 2018 17:37:51 -0400 Subject: Make ':' a restricted character for file names file names for podman load, save, export, and import cannot contain ":" in them. It is a reserved character for parsing filenames. Signed-off-by: umohnani8 Closes: #694 Approved by: rhatdan --- test/e2e/export_test.go | 13 ++++++++++++- test/e2e/save_test.go | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'test/e2e') diff --git a/test/e2e/export_test.go b/test/e2e/export_test.go index 6746ac769..3acb447f2 100644 --- a/test/e2e/export_test.go +++ b/test/e2e/export_test.go @@ -3,9 +3,10 @@ package integration import ( "os" + "path/filepath" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "path/filepath" ) var _ = Describe("Podman export", func() { @@ -43,4 +44,14 @@ var _ = Describe("Podman export", func() { err = os.Remove(outfile) Expect(err).To(BeNil()) }) + + It("podman export bad filename", func() { + _, ec, cid := podmanTest.RunLsContainer("") + Expect(ec).To(Equal(0)) + + outfile := filepath.Join(podmanTest.TempDir, "container:with:colon.tar") + result := podmanTest.Podman([]string{"export", "-o", outfile, cid}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Not(Equal(0))) + }) }) diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go index 351e57bf5..7009d5648 100644 --- a/test/e2e/save_test.go +++ b/test/e2e/save_test.go @@ -93,4 +93,12 @@ var _ = Describe("Podman save", func() { Expect(save.ExitCode()).To(Equal(0)) }) + It("podman save bad filename", func() { + outdir := filepath.Join(podmanTest.TempDir, "save:colon") + + save := podmanTest.Podman([]string{"save", "--compress", "--format", "docker-dir", "-o", outdir, ALPINE}) + save.WaitWithDefaultTimeout() + Expect(save.ExitCode()).To(Not(Equal(0))) + }) + }) -- cgit v1.2.3-54-g00ecf