diff options
author | Chris Evich <cevich@redhat.com> | 2021-08-09 10:40:58 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2021-08-17 16:16:25 -0400 |
commit | ce7ed33598c54ae4699b03aae8a8b24ae49a683d (patch) | |
tree | a553f4aefd704122b6e79848256d0fd5c40ac820 /test/e2e | |
parent | 1d54315b674d94ff18bd8cd97e2b232a161db261 (diff) | |
download | podman-ce7ed33598c54ae4699b03aae8a8b24ae49a683d.tar.gz podman-ce7ed33598c54ae4699b03aae8a8b24ae49a683d.tar.bz2 podman-ce7ed33598c54ae4699b03aae8a8b24ae49a683d.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')
-rw-r--r-- | test/e2e/run_device_test.go | 6 |
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() { |