summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-09-05 23:22:17 -0400
committercdoern <cdoern@redhat.com>2021-09-28 21:20:01 -0400
commit2d86051893fc2e813f26c16d13786bb377c26d48 (patch)
tree32059566515a61e938b6eaf1ae397f128bd8ff67 /test
parent8e2d25e93706190acf25bcf74bd18cdf98fb3a12 (diff)
downloadpodman-2d86051893fc2e813f26c16d13786bb377c26d48.tar.gz
podman-2d86051893fc2e813f26c16d13786bb377c26d48.tar.bz2
podman-2d86051893fc2e813f26c16d13786bb377c26d48.zip
Pod Device-Read-BPS support
added the option for the user to specify a rate, in bytes, at which they would like to be able to read from the device being added to the pod. This is the first in a line of pod device options. WARNING: changed pod name json tag to pod_name to avoid confusion when marshaling with the containerspec's name Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/pod_create_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index 76a05fa0f..67bd28da6 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -903,4 +903,25 @@ ENTRYPOINT ["sleep","99999"]
})
+ It("podman pod create --device-read-bps", func() {
+ SkipIfRootless("Cannot create devices in /dev in rootless mode")
+ SkipIfRootlessCgroupsV1("Setting device-read-bps not supported on cgroupv1 for rootless users")
+
+ podName := "testPod"
+ session := podmanTest.Podman([]string{"pod", "create", "--device-read-bps", "/dev/zero:1mb", "--name", podName})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ if CGROUPSV2 {
+ session = podmanTest.Podman([]string{"run", "--rm", "--pod", podName, ALPINE, "sh", "-c", "cat /sys/fs/cgroup/$(sed -e 's|0::||' < /proc/self/cgroup)/io.max"})
+ } else {
+ session = podmanTest.Podman([]string{"run", "--rm", "--pod", podName, ALPINE, "cat", "/sys/fs/cgroup/blkio/blkio.throttle.read_bps_device"})
+ }
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ if !CGROUPSV2 {
+ Expect(session.OutputToString()).To(ContainSubstring("1048576"))
+ }
+ })
+
})