mirror of
https://github.com/containers/podman.git
synced 2025-06-03 20:33:20 +08:00
Privileged containers should inherit host devices
When running a privileged container, it should inherit the same devices the host has. Signed-off-by: baude <bbaude@redhat.com> Closes: #330 Approved by: mheon
This commit is contained in:
@ -73,4 +73,17 @@ var _ = Describe("Podman privileged container tests", func() {
|
||||
Expect(capAmp[1]).To(Equal(capEff[1]))
|
||||
})
|
||||
|
||||
It("podman non-privileged should have very few devices", func() {
|
||||
session := podmanTest.Podman([]string{"run", "busybox", "ls", "-l", "/dev"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(len(session.OutputToStringArray())).To(Equal(18))
|
||||
})
|
||||
|
||||
It("podman privileged should inherit host devices", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--privileged", ALPINE, "ls", "-l", "/dev"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 20))
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user