summaryrefslogtreecommitdiff
path: root/test/e2e/run_device_test.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-08-17 18:17:44 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-20 13:42:07 +0000
commit462c503a4762a0f20023d937a5fb05a55d4183a3 (patch)
tree5c82069a9e41364107f0b7b0134cee2c15d8037c /test/e2e/run_device_test.go
parente40c99a19ecc0edf5d45ea3c861cd48ce2e22448 (diff)
downloadpodman-462c503a4762a0f20023d937a5fb05a55d4183a3.tar.gz
podman-462c503a4762a0f20023d937a5fb05a55d4183a3.tar.bz2
podman-462c503a4762a0f20023d937a5fb05a55d4183a3.zip
Fix handling of devices
Devices are supposed to be able to be passed in via the form of --device /dev/foo --device /dev/foo:/dev/bar --device /dev/foo:rwm --device /dev/foo:/dev/bar:rwm Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1299 Approved by: umohnani8
Diffstat (limited to 'test/e2e/run_device_test.go')
-rw-r--r--test/e2e/run_device_test.go28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index eb1b423dd..fedd696d1 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -8,7 +8,7 @@ import (
. "github.com/onsi/gomega"
)
-var _ = Describe("Podman kill", func() {
+var _ = Describe("Podman run device", func() {
var (
tempdir string
err error
@@ -43,4 +43,30 @@ var _ = Describe("Podman kill", func() {
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Equal("/dev/kmsg"))
})
+
+ It("podman run device rename test", func() {
+ session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/kmsg:/dev/kmsg1", ALPINE, "ls", "--color=never", "/dev/kmsg1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal("/dev/kmsg1"))
+ })
+
+ It("podman run device permission test", func() {
+ session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/kmsg:r", ALPINE, "ls", "--color=never", "/dev/kmsg"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal("/dev/kmsg"))
+ })
+
+ It("podman run device rename and permission test", func() {
+ session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/kmsg:/dev/kmsg1:r", ALPINE, "ls", "--color=never", "/dev/kmsg1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal("/dev/kmsg1"))
+ })
+ It("podman run device rename and bad permission test", func() {
+ session := podmanTest.Podman([]string{"run", "-q", "--device", "/dev/kmsg:/dev/kmsg1:rd", ALPINE, "ls", "--color=never", "/dev/kmsg1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
})