| 1 |
# Check the ulimit command |
| 2 |
|
| 3 |
# ulimit does not work on non-POSIX platforms. |
| 4 |
# Solaris for some reason does not respect ulimit -n, so mark it unsupported |
| 5 |
# as well. |
| 6 |
# UNSUPPORTED: system-windows, system-cygwin, system-solaris |
| 7 |
|
| 8 |
# RUN: %{python} %S/Inputs/shtest-ulimit/print_limits.py | grep RLIMIT_NOFILE \ |
| 9 |
# RUN: | sed -n -e 's/.*=//p' | tr -d '\n' > %t.nofile_limit |
| 10 |
|
| 11 |
# RUN: not %{lit} -v %{inputs}/shtest-ulimit --order=lexical \ |
| 12 |
# RUN: | FileCheck -DBASE_NOFILE_LIMIT=%{readfile:%t.nofile_limit} %s |
| 13 |
|
| 14 |
# CHECK: -- Testing: 3 tests{{.*}} |
| 15 |
|
| 16 |
# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit-bad-arg.txt ({{[^)]*}}) |
| 17 |
# CHECK: ulimit -n |
| 18 |
# CHECK: 'ulimit' requires two arguments |
| 19 |
|
| 20 |
# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit_okay.txt ({{[^)]*}}) |
| 21 |
# CHECK: ulimit -n 50 |
| 22 |
# CHECK: ulimit -f 5 |
| 23 |
# CHECK: RLIMIT_NOFILE=50 |
| 24 |
# CHECK: RLIMIT_FSIZE=5 |
| 25 |
|
| 26 |
# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit_reset.txt ({{[^)]*}}) |
| 27 |
# CHECK: RLIMIT_NOFILE=[[BASE_NOFILE_LIMIT]] |