summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-01-09 13:23:01 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2019-01-10 10:27:39 -0500
commitf2ff550967660a611f8f28e9bd79d39bc007c104 (patch)
treecf3ff1cc346322d62de3c284b462adb539248152 /test/e2e
parent64627d910b2113fa2de6b949d846af379e75e305 (diff)
downloadpodman-f2ff550967660a611f8f28e9bd79d39bc007c104.tar.gz
podman-f2ff550967660a611f8f28e9bd79d39bc007c104.tar.bz2
podman-f2ff550967660a611f8f28e9bd79d39bc007c104.zip
Fix handling of nil volumes
Currently if a user passes in a -v with -v $bogus:/foobar We crash. This will throw a proper error. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index a0b16a254..1e7f4f0f4 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -596,6 +596,21 @@ USER mail`
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run --volumes flag with empty host dir", func() {
+ vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
+ err := os.MkdirAll(vol1, 0755)
+ Expect(err).To(BeNil())
+
+ session := podmanTest.Podman([]string{"run", "--volume", ":/myvol1:z", ALPINE, "touch", "/myvol2/foo.txt"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(Equal(0))
+ Expect(session.ErrorToString()).To(ContainSubstring("directory cannot be empty"))
+ session = podmanTest.Podman([]string{"run", "--volume", vol1 + ":", ALPINE, "touch", "/myvol2/foo.txt"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).ToNot(Equal(0))
+ Expect(session.ErrorToString()).To(ContainSubstring("directory cannot be empty"))
+ })
+
It("podman run --mount flag with multiple mounts", func() {
vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
err := os.MkdirAll(vol1, 0755)