summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-30 11:52:15 +0530
committerAditya Rajan <arajan@redhat.com>2021-08-30 19:49:26 +0530
commitec1f350ee5a3776f6fac6e96e1277d0ab36d130a (patch)
treecc164fe140719648be064a223236976bc8f9eb70 /test
parenta2acd04447a66027dc02a210d2961fcde6868985 (diff)
downloadpodman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.tar.gz
podman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.tar.bz2
podman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.zip
container: resolve workdir after all the mounts happen.
There are use-cases where users would want to use overlay-mounts as workdir. For such cases workdir should be resolved after all the mounts are completed during the container init process. Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_volume_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index d1f6ea80e..59937b6c0 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -222,6 +222,26 @@ var _ = Describe("Podman run with volumes", func() {
Expect(matches[0]).To(Not(ContainSubstring("nosuid")))
})
+ // Container should start when workdir is overlayed volume
+ It("podman run with volume mounted as overlay and used as workdir", func() {
+ SkipIfRemote("Overlay volumes only work locally")
+ if os.Getenv("container") != "" {
+ Skip("Overlay mounts not supported when running in a container")
+ }
+ if rootless.IsRootless() {
+ if _, err := exec.LookPath("fuse-overlayfs"); err != nil {
+ Skip("Fuse-Overlayfs required for rootless overlay mount test")
+ }
+ }
+ mountPath := filepath.Join(podmanTest.TempDir, "secrets")
+ os.Mkdir(mountPath, 0755)
+
+ //Container should be able to start with custom overlayed volume
+ session := podmanTest.Podman([]string{"run", "--rm", "-v", mountPath + ":/data:O", "--workdir=/data", ALPINE, "echo", "hello"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ })
+
It("podman run with noexec can't exec", func() {
session := podmanTest.Podman([]string{"run", "--rm", "-v", "/bin:/hostbin:noexec", ALPINE, "/hostbin/ls", "/"})
session.WaitWithDefaultTimeout()