diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-09-06 13:52:13 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-09-09 17:17:39 -0400 |
commit | b6106341fb3a749ec37e59ee3290257a1729def1 (patch) | |
tree | 071d7849967793d1d57af0921e24ad71f8e1ac96 /test/e2e | |
parent | 290def5b921ca4b557e051e79963de7f429cfcd7 (diff) | |
download | podman-b6106341fb3a749ec37e59ee3290257a1729def1.tar.gz podman-b6106341fb3a749ec37e59ee3290257a1729def1.tar.bz2 podman-b6106341fb3a749ec37e59ee3290257a1729def1.zip |
When first mounting any named volume, copy up
Previously, we only did this for volumes created at the same time
as the container. However, this is not correct behavior - Docker
does so for all named volumes, even those made with
'podman volume create' and mounted into a container later.
Fixes #3945
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/run_volume_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index 551e86b93..fc1998ab2 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -249,4 +249,25 @@ var _ = Describe("Podman run with volumes", func() { fmt.Printf("Output: %s", mountOut3) Expect(strings.Contains(mountOut3, volName)).To(BeFalse()) }) + + It("podman named volume copyup", func() { + baselineSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", ALPINE, "ls", "/etc/apk/"}) + baselineSession.WaitWithDefaultTimeout() + Expect(baselineSession.ExitCode()).To(Equal(0)) + baselineOutput := baselineSession.OutputToString() + + inlineVolumeSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "-v", "testvol1:/etc/apk", ALPINE, "ls", "/etc/apk/"}) + inlineVolumeSession.WaitWithDefaultTimeout() + Expect(inlineVolumeSession.ExitCode()).To(Equal(0)) + Expect(inlineVolumeSession.OutputToString()).To(Equal(baselineOutput)) + + makeVolumeSession := podmanTest.Podman([]string{"volume", "create", "testvol2"}) + makeVolumeSession.WaitWithDefaultTimeout() + Expect(makeVolumeSession.ExitCode()).To(Equal(0)) + + separateVolumeSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "-v", "testvol2:/etc/apk", ALPINE, "ls", "/etc/apk/"}) + separateVolumeSession.WaitWithDefaultTimeout() + Expect(separateVolumeSession.ExitCode()).To(Equal(0)) + Expect(separateVolumeSession.OutputToString()).To(Equal(baselineOutput)) + }) }) |