summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-24 06:09:17 -0400
committerGitHub <noreply@github.com>2021-07-24 06:09:17 -0400
commitec5c7c1f6a1898dacddb6cc35802525c288b61ef (patch)
treefefa2e301353ee5b1055dc1899aa7b3ce33d6e68 /test
parentd956500743829297b43a22e447017fe6319caed5 (diff)
parent3e79296a81ad723c6c3e8ea7d9ca142dfa8fbdf3 (diff)
downloadpodman-ec5c7c1f6a1898dacddb6cc35802525c288b61ef.tar.gz
podman-ec5c7c1f6a1898dacddb6cc35802525c288b61ef.tar.bz2
podman-ec5c7c1f6a1898dacddb6cc35802525c288b61ef.zip
Merge pull request #10895 from rhatdan/devices
Support DeviceCgroupRules to actually get added.
Diffstat (limited to 'test')
-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