mirror of
https://github.com/containers/podman.git
synced 2025-08-02 01:09:21 +08:00
Support passing of Ulimits as -1 to mean max
Docker allows the passing of -1 to indicate the maximum limit allowed for the current process. Fixes: https://github.com/containers/podman/issues/19319 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -1149,6 +1149,23 @@ EOF
|
||||
assert "$output" =~ " ${nofile2} * ${nofile2} * files"
|
||||
}
|
||||
|
||||
@test "podman run ulimit with -1" {
|
||||
max=unlimited
|
||||
if is_rootless; then
|
||||
run ulimit -c -H
|
||||
max=$output
|
||||
fi
|
||||
|
||||
run_podman run --ulimit core=-1:-1 --rm $IMAGE grep core /proc/self/limits
|
||||
assert "$output" =~ " ${max} * ${max} * bytes"
|
||||
|
||||
run_podman run --ulimit core=1000:-1 --rm $IMAGE grep core /proc/self/limits
|
||||
assert "$output" =~ " 1000 * ${max} * bytes"
|
||||
|
||||
run_podman 125 run --ulimit core=-1:1000 --rm $IMAGE grep core /proc/self/limits
|
||||
is "$output" "Error: ulimit option \"core=-1:1000\" requires name=SOFT:HARD, failed to be parsed: ulimit soft limit must be less than or equal to hard limit: soft: -1 (unlimited), hard: 1000"
|
||||
}
|
||||
|
||||
@test "podman run bad --name" {
|
||||
randomname=$(random_string 30)
|
||||
run_podman 125 create --name "$randomname/bad" $IMAGE
|
||||
|
Reference in New Issue
Block a user