mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Enhance priv. dev. check
Update test to confirm the negative-case, proving the `--privileged` "option is required" for this character device to be present in a container (including rootless). Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
@ -89,9 +89,13 @@ var _ = Describe("Podman run device", func() {
|
||||
})
|
||||
|
||||
It("podman run device host device with --privileged", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--privileged", ALPINE, "ls", "/dev/kmsg"})
|
||||
session := podmanTest.Podman([]string{"run", "--privileged", ALPINE, "test", "-c", "/dev/kmsg"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
// verify --privileged is required
|
||||
session2 := podmanTest.Podman([]string{"run", ALPINE, "test", "-c", "/dev/kmsg"})
|
||||
session2.WaitWithDefaultTimeout()
|
||||
Expect(session2).Should((Exit(1)))
|
||||
})
|
||||
|
||||
It("podman run CDI device test", func() {
|
||||
|
Reference in New Issue
Block a user