diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-15 06:19:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-15 06:19:07 -0400 |
commit | ef7f584acf65692a6b2a11a352a8d09d8a604ff6 (patch) | |
tree | 85044a2360ddbb7a7845de11ec1016bf6996baab /test/system/420-cgroups.bats | |
parent | 41eda417fe4565cab26d704daedca0d285327f31 (diff) | |
parent | 1646da834c06d55e7bf56b272f2666659117e6fa (diff) | |
download | podman-ef7f584acf65692a6b2a11a352a8d09d8a604ff6.tar.gz podman-ef7f584acf65692a6b2a11a352a8d09d8a604ff6.tar.bz2 podman-ef7f584acf65692a6b2a11a352a8d09d8a604ff6.zip |
Merge pull request #8025 from edsantiago/bats
System test additions
Diffstat (limited to 'test/system/420-cgroups.bats')
-rw-r--r-- | test/system/420-cgroups.bats | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/system/420-cgroups.bats b/test/system/420-cgroups.bats new file mode 100644 index 000000000..615e43e6c --- /dev/null +++ b/test/system/420-cgroups.bats @@ -0,0 +1,34 @@ +#!/usr/bin/env bats -*- bats -*- +# +# cgroups-related tests +# + +load helpers + +@test "podman run, preserves initial --cgroup-manager" { + skip_if_remote "podman-remote does not support --cgroup-manager" + + if is_rootless && is_cgroupsv1; then + skip "not supported as rootless under cgroups v1" + fi + + # Find out our default cgroup manager, and from that, get the non-default + run_podman info --format '{{.Host.CgroupManager}}' + case "$output" in + systemd) other="cgroupfs" ;; + cgroupfs) other="systemd" ;; + *) die "Unknown CgroupManager '$output'" ;; + esac + + run_podman --cgroup-manager=$other run --name myc $IMAGE true + run_podman container inspect --format '{{.HostConfig.CgroupManager}}' myc + is "$output" "$other" "podman preserved .HostConfig.CgroupManager" + + # Restart the container, without --cgroup-manager option (ie use default) + # Prior to #7970, this would fail with an OCI runtime error + run_podman start myc + + run_podman rm myc +} + +# vim: filetype=sh |