summaryrefslogtreecommitdiff
path: root/test/e2e/run_device_test.go
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2021-08-09 10:40:58 -0400
committerChris Evich <cevich@redhat.com>2021-08-11 13:07:00 -0400
commitd0e3b3c3a9a9c89cab120a72e55dd22262c1d004 (patch)
treed2ed7b52060d4011b4e6d0c426d958dfd23a9b4b /test/e2e/run_device_test.go
parentcfbbc38a5b17ed57bd378b755068a24acbcb33a6 (diff)
downloadpodman-d0e3b3c3a9a9c89cab120a72e55dd22262c1d004.tar.gz
podman-d0e3b3c3a9a9c89cab120a72e55dd22262c1d004.tar.bz2
podman-d0e3b3c3a9a9c89cab120a72e55dd22262c1d004.zip
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>
Diffstat (limited to 'test/e2e/run_device_test.go')
-rw-r--r--test/e2e/run_device_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index e65655e84..064c65ce5 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -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() {