summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-07-29 16:42:40 -0400
committerMatthew Heon <mheon@redhat.com>2020-10-20 09:24:32 -0400
commit1b4933376f4e6738ff3a0c42a2e27c6d21c07e7c (patch)
treed2454fab870c9c4ae00e23d54af6049058126001 /test/system
parent3858fc1d019d13fe3378c129d133fd22789ac0dc (diff)
downloadpodman-1b4933376f4e6738ff3a0c42a2e27c6d21c07e7c.tar.gz
podman-1b4933376f4e6738ff3a0c42a2e27c6d21c07e7c.tar.bz2
podman-1b4933376f4e6738ff3a0c42a2e27c6d21c07e7c.zip
Add a system test to verify --runtime is preserved
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/030-run.bats13
-rw-r--r--test/system/helpers.bash10
2 files changed, 23 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 28dc7c7a7..9f4037730 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -460,4 +460,17 @@ json-file | f
is "$output" "$expect" "podman run with --tz=local, matches host"
}
+# run with --runtime should preserve the named runtime
+@test "podman run : full path to --runtime is preserved" {
+ skip_if_cgroupsv1
+ skip_if_remote
+ run_podman run -d --runtime '/usr/bin/crun' $IMAGE sleep 60
+ cid="$output"
+
+ run_podman inspect --format '{{.OCIRuntime}}' $cid
+ is "$output" "/usr/bin/crun"
+
+ run_podman kill $cid
+}
+
# vim: filetype=sh
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 73cf1e5b2..2cced10c2 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -253,6 +253,7 @@ function is_cgroupsv1() {
! is_cgroupsv2
}
+# True if cgroups v2 are enabled
function is_cgroupsv2() {
cgroup_type=$(stat -f -c %T /sys/fs/cgroup)
test "$cgroup_type" = "cgroup2fs"
@@ -305,6 +306,15 @@ function skip_if_no_selinux() {
fi
}
+#######################
+# skip_if_cgroupsv1 # ...with an optional message
+#######################
+function skip_if_cgroupsv1() {
+ if ! is_cgroupsv2; then
+ skip "${1:-test requires cgroupsv2}"
+ fi
+}
+
#########
# die # Abort with helpful message
#########