mirror of
https://github.com/containers/podman.git
synced 2025-10-12 16:56:32 +08:00
Fix Mount Propagation
Default mount propagation inside of containes should be private Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1305 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
90e93e66b0
commit
663ee91eec
@ -566,4 +566,34 @@ USER mail`
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman run findmnt nothing shared", func() {
|
||||
vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
|
||||
err := os.MkdirAll(vol1, 0755)
|
||||
Expect(err).To(BeNil())
|
||||
vol2 := filepath.Join(podmanTest.TempDir, "vol-test2")
|
||||
err = os.MkdirAll(vol2, 0755)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
session := podmanTest.Podman([]string{"run", "--volume", vol1 + ":/myvol1:z", "--volume", vol2 + ":/myvol2:z", fedoraMinimal, "findmnt", "-o", "TARGET,PROPAGATION"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
match, _ := session.GrepString("shared")
|
||||
Expect(match).Should(BeFalse())
|
||||
})
|
||||
|
||||
It("podman run findmnt shared", func() {
|
||||
vol1 := filepath.Join(podmanTest.TempDir, "vol-test1")
|
||||
err := os.MkdirAll(vol1, 0755)
|
||||
Expect(err).To(BeNil())
|
||||
vol2 := filepath.Join(podmanTest.TempDir, "vol-test2")
|
||||
err = os.MkdirAll(vol2, 0755)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
session := podmanTest.Podman([]string{"run", "--volume", vol1 + ":/myvol1:z", "--volume", vol2 + ":/myvol2:shared,z", fedoraMinimal, "findmnt", "-o", "TARGET,PROPAGATION"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
match, _ := session.GrepString("shared")
|
||||
Expect(match).Should(BeTrue())
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user