summaryrefslogtreecommitdiff
path: root/test/system/030-run.bats
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-07-09 16:01:35 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-07-21 16:10:09 -0400
commit3e79296a81ad723c6c3e8ea7d9ca142dfa8fbdf3 (patch)
treee8bd1f72e0f4a3fdaf290375e75b31e00bab8d56 /test/system/030-run.bats
parent6370622444676db812cbc54aef56e691ea7788d0 (diff)
downloadpodman-3e79296a81ad723c6c3e8ea7d9ca142dfa8fbdf3.tar.gz
podman-3e79296a81ad723c6c3e8ea7d9ca142dfa8fbdf3.tar.bz2
podman-3e79296a81ad723c6c3e8ea7d9ca142dfa8fbdf3.zip
Support DeviceCgroupRules to actually get added.
Fixes: https://github.com/containers/podman/issues/10302 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r--test/system/030-run.bats17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 32fc85c4e..3d9d834b3 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -706,4 +706,21 @@ EOF
run_podman rmi nomtab
}
+@test "podman run --device-cgroup-rule tests" {
+ skip_if_rootless "cannot add devices in rootless mode"
+
+ run_podman run --device-cgroup-rule="b 7:* rmw" --rm $IMAGE
+ run_podman run --device-cgroup-rule="c 7:* rmw" --rm $IMAGE
+ run_podman run --device-cgroup-rule="a 7:1 rmw" --rm $IMAGE
+ run_podman run --device-cgroup-rule="a 7 rmw" --rm $IMAGE
+ run_podman 125 run --device-cgroup-rule="b 7:* rmX" --rm $IMAGE
+ is "$output" "Error: invalid device access in device-access-add: X"
+ run_podman 125 run --device-cgroup-rule="b 7:2" --rm $IMAGE
+ is "$output" 'Error: invalid device cgroup rule requires type, major:Minor, and access rules: "b 7:2"'
+ run_podman 125 run --device-cgroup-rule="x 7:* rmw" --rm $IMAGE
+ is "$output" "Error: invalid device type in device-access-add:"
+ run_podman 125 run --device-cgroup-rule="a a:* rmw" --rm $IMAGE
+ is "$output" "Error: strconv.ParseInt: parsing \"a\": invalid syntax"
+}
+
# vim: filetype=sh