aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-08-23 11:54:31 +0900
committerToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-08-23 11:54:31 +0900
commit64339d47c105373557248d45fddf7ab2db435180 (patch)
treec9d1cf02f99b58e5e49f5aefbdda67ff45ca9de1 /test/system
parent51d4b88ce976708de88ce041a03d6d65dd4c8d0e (diff)
downloadpodman-64339d47c105373557248d45fddf7ab2db435180.tar.gz
podman-64339d47c105373557248d45fddf7ab2db435180.tar.bz2
podman-64339d47c105373557248d45fddf7ab2db435180.zip
Warning messages are printed and ignored if we use an unsupported option
When an unsupported limit on cgroups V1 rootless systems is requested, podman prints an warning message and ignores the option/flag. ``` Target options/flags: --cpu-period, --cpu-quota, --cpu-rt-period, --cpu-rt-runtime, --cpus, --cpu-shares, --cpuset-cpus, --cpuset-mems, --memory, --memory-reservation, --memory-swap, --memory-swappiness, --blkio-weight, --device-read-bps, --device-write-bps, --device-read-iops, --device-write-iops, --blkio-weight-device ``` Related to https://github.com/containers/podman/discussions/10152 Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/030-run.bats7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 908c169ee..a3bfe5780 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -56,7 +56,12 @@ echo $rand | 0 | $rand
@test "podman run --memory=0 runtime option" {
run_podman run --memory=0 --rm $IMAGE echo hello
- is "$output" "hello" "failed to run when --memory is set to 0"
+ if is_rootless && ! is_cgroupsv2; then
+ is "${lines[0]}" "Resource limits are not supported and ignored on cgroups V1 rootless systems" "--memory is not supported"
+ is "${lines[1]}" "hello" "--memory is ignored"
+ else
+ is "$output" "hello" "failed to run when --memory is set to 0"
+ fi
}
# 'run --preserve-fds' passes a number of additional file descriptors into the container