test: set soft ulimit

when the current soft limit is higher than the new value, ulimit fails
to set the hard limit as (tested on Rawhide):

[root@rawhide ~]# ulimit -n -H 1048575
-bash: ulimit: open files: cannot modify limit: Invalid argument

to avoid the problem, set also the soft limit:

[root@rawhide ~]# ulimit -n -H
12345678
[root@rawhide ~]# ulimit -n -H 1048575
-bash: ulimit: open files: cannot modify limit: Invalid argument
[root@rawhide ~]# ulimit -n -SH 1048575
[root@rawhide ~]# ulimit -n -H
1048575

commit 71d5ee0e04 introduced the issue.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2024-10-22 12:04:58 +02:00
parent 4319fac0a7
commit 94878af151
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 1 additions and 1 deletions

View File

@ -1315,7 +1315,7 @@ EOF
default_value=$output
# Set the current ulimit smaller than the default value
ulimit -n -H $((default_value - 1))
ulimit -n -SH $((default_value - 1))
run_podman run --rm $IMAGE sh -c 'ulimit -n -H'