aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-21 08:40:40 -0400
committerGitHub <noreply@github.com>2021-09-21 08:40:40 -0400
commit9b5522d9adff9e8b2413e626bfc62d1df28ce534 (patch)
tree6d3b482de0ef857f8956c35c35788238f706c303 /test
parentb925d707fa768245b3bd50d570b91992c1814dba (diff)
parent8fac34b8ff05314fe6996567af9336cf034b2d03 (diff)
downloadpodman-9b5522d9adff9e8b2413e626bfc62d1df28ce534.tar.gz
podman-9b5522d9adff9e8b2413e626bfc62d1df28ce534.tar.bz2
podman-9b5522d9adff9e8b2413e626bfc62d1df28ce534.zip
Merge pull request #11518 from cdoern/podDevice
Pod Devices support
Diffstat (limited to 'test')
-rw-r--r--test/e2e/pod_create_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index 7d40d36dd..76a05fa0f 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -881,6 +881,25 @@ ENTRYPOINT ["sleep","99999"]
ctr3 := podmanTest.Podman([]string{"run", "--pod", podName, ALPINE, "cat", "/tmp1/test"})
ctr3.WaitWithDefaultTimeout()
Expect(ctr3.OutputToString()).To(ContainSubstring("hello"))
+ })
+
+ It("podman pod create --device", func() {
+ SkipIfRootless("Cannot create devices in /dev in rootless mode")
+ Expect(os.MkdirAll("/dev/foodevdir", os.ModePerm)).To(BeNil())
+ defer os.RemoveAll("/dev/foodevdir")
+
+ mknod := SystemExec("mknod", []string{"/dev/foodevdir/null", "c", "1", "3"})
+ mknod.WaitWithDefaultTimeout()
+ Expect(mknod).Should(Exit(0))
+
+ podName := "testPod"
+ session := podmanTest.Podman([]string{"pod", "create", "--device", "/dev/foodevdir:/dev/bar", "--name", podName})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ session = podmanTest.Podman([]string{"run", "-q", "--pod", podName, ALPINE, "stat", "-c%t:%T", "/dev/bar/null"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal("1:3"))
})