diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-12 18:46:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-12 18:46:35 +0100 |
commit | dd5df42be94ee6df9351a45eea563df146e9212e (patch) | |
tree | d70fdf10764daa90f94612a323c53053d2cf24aa /test | |
parent | 0e9c637c42c881588c5a648654dfce42a1e980ee (diff) | |
parent | c140ecdc9b416ab4efd4d21d14acd63b6adbdd42 (diff) | |
download | podman-dd5df42be94ee6df9351a45eea563df146e9212e.tar.gz podman-dd5df42be94ee6df9351a45eea563df146e9212e.tar.bz2 podman-dd5df42be94ee6df9351a45eea563df146e9212e.zip |
Merge pull request #5168 from mheon/do_not_overwrite_volumes
Do not copy up when volume is not empty
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_volume_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index 0c2389e40..46c27dc2e 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -397,4 +397,28 @@ var _ = Describe("Podman run with volumes", func() { volMount.WaitWithDefaultTimeout() Expect(volMount.ExitCode()).To(Not(Equal(0))) }) + + It("Podman fix for CVE-2020-1726", func() { + volName := "testVol" + volCreate := podmanTest.Podman([]string{"volume", "create", volName}) + volCreate.WaitWithDefaultTimeout() + Expect(volCreate.ExitCode()).To(Equal(0)) + + volPath := podmanTest.Podman([]string{"volume", "inspect", "--format", "{{.Mountpoint}}", volName}) + volPath.WaitWithDefaultTimeout() + Expect(volPath.ExitCode()).To(Equal(0)) + path := volPath.OutputToString() + + fileName := "thisIsATestFile" + file, err := os.Create(filepath.Join(path, fileName)) + Expect(err).To(BeNil()) + defer file.Close() + + runLs := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "-v", fmt.Sprintf("%v:/etc/ssl", volName), ALPINE, "ls", "-1", "/etc/ssl"}) + runLs.WaitWithDefaultTimeout() + Expect(runLs.ExitCode()).To(Equal(0)) + outputArr := runLs.OutputToStringArray() + Expect(len(outputArr)).To(Equal(1)) + Expect(strings.Contains(outputArr[0], fileName)).To(BeTrue()) + }) }) |