diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-06-27 12:35:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 12:35:10 +0000 |
commit | 1022ea36dd36cf57a2556f5eac99b30500513e08 (patch) | |
tree | 1cf20f037be01e2bee6c760d8dde3af3e02ad094 /test | |
parent | cc86315455bb9b4fed6318f9e3c4222ba9215e03 (diff) | |
parent | 2eda547dcd597a23ecc2311a7ceca46746a3026e (diff) | |
download | podman-1022ea36dd36cf57a2556f5eac99b30500513e08.tar.gz podman-1022ea36dd36cf57a2556f5eac99b30500513e08.tar.bz2 podman-1022ea36dd36cf57a2556f5eac99b30500513e08.zip |
Merge pull request #14687 from cdoern/vols
podman run/create -v relative filepath support
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_volume_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index f31e62e42..edb657695 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -953,4 +953,32 @@ USER testuser`, fedoraMinimal) Expect(volMount).Should(Exit(0)) Expect(volMount.OutputToString()).To(Equal("1000:1000")) }) + + It("podman run -v with a relative dir", func() { + mountPath := filepath.Join(podmanTest.TempDir, "vol") + err = os.Mkdir(mountPath, 0755) + Expect(err).ToNot(HaveOccurred()) + defer func() { + err := os.RemoveAll(mountPath) + Expect(err).ToNot(HaveOccurred()) + }() + + f, err := os.CreateTemp(mountPath, "podman") + Expect(err).ToNot(HaveOccurred()) + + cwd, err := os.Getwd() + Expect(err).ToNot(HaveOccurred()) + + err = os.Chdir(mountPath) + Expect(err).ToNot(HaveOccurred()) + defer func() { + err := os.Chdir(cwd) + Expect(err).ToNot(HaveOccurred()) + }() + + run := podmanTest.Podman([]string{"run", "-it", "--security-opt", "label=disable", "-v", "./:" + dest, ALPINE, "ls", dest}) + run.WaitWithDefaultTimeout() + Expect(run).Should(Exit(0)) + Expect(run.OutputToString()).Should(ContainSubstring(strings.TrimLeft("/vol/", f.Name()))) + }) }) |