diff options
author | Matthew Heon <mheon@redhat.com> | 2021-02-15 11:58:24 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-02-18 10:14:32 -0500 |
commit | 2fb1511690dba70adf25c36c28ec4bad2af79106 (patch) | |
tree | 75be82e20796715d9a457da22e306ae763239f67 /test | |
parent | 797f1ea8cd0b7f4f85df4cf069bcd64c37a8ed1d (diff) | |
download | podman-2fb1511690dba70adf25c36c28ec4bad2af79106.tar.gz podman-2fb1511690dba70adf25c36c28ec4bad2af79106.tar.bz2 podman-2fb1511690dba70adf25c36c28ec4bad2af79106.zip |
Fix an issue where copyup could fail with ENOENT
This one is rather bizarre because it triggers only on some
systems. I've included a CI test, for example, but I'm 99% sure
we use images in CI that have volumes over empty directories, and
the earlier patch to change copy-up implementation passed CI
without complaint.
I can reproduce this on a stock F33 VM, but that's the only place
I have been able to see it.
Regardless, the issue: under certain as-yet-unidentified
environmental conditions, the copier.Get method will return an
ENOENT attempting to stream a directory that is empty. Work
around this by avoiding the copy altogether in this case.
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_volume_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index 19d82c974..91d8f15f4 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -322,6 +322,18 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"` Expect(outputSession.OutputToString()).To(Equal(baselineOutput)) }) + It("podman named volume copyup empty directory", func() { + baselineSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", ALPINE, "ls", "/srv"}) + baselineSession.WaitWithDefaultTimeout() + Expect(baselineSession.ExitCode()).To(Equal(0)) + baselineOutput := baselineSession.OutputToString() + + outputSession := podmanTest.Podman([]string{"run", "-t", "-i", "-v", "/srv", ALPINE, "ls", "/srv"}) + outputSession.WaitWithDefaultTimeout() + Expect(outputSession.ExitCode()).To(Equal(0)) + Expect(outputSession.OutputToString()).To(Equal(baselineOutput)) + }) + It("podman read-only tmpfs conflict with volume", func() { session := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", "--read-only", "-v", "tmp_volume:" + dest, ALPINE, "touch", dest + "/a"}) session.WaitWithDefaultTimeout() |