Lines Matching +full:max +full:- +full:cur

2 # SPDX-License-Identifier: BSD-2-Clause
36 origin_max=$(sysctl -n security.jail.children.max)
37 origin_cur=$(sysctl -n security.jail.children.cur)
41 # - the test creates three jails: childfree, maxallowed, maxallowed.family
43 # - maxallowed.family wants to set children.max=4
44 # - it means that its parent (maxallowed) should have at least children.max=5
45 # - it makes the origin (parent of maxallowed) provide children.max=6 minimum
47 test $origin_cur -le $origin_max || atf_fail "Abnormal cur=$origin_cur > max=$origin_max."
48 …test $((origin_max - origin_cur)) -ge 3 || atf_skip "Not enough child jails are allowed for the te…
49 test $origin_max -ge 6 || atf_skip "Not high enough children.max limit for the test."
51 jail -c name=childfree persist
52 atf_check_equal "$((origin_cur + 1))" "$(sysctl -n security.jail.children.cur)"
53 atf_check_equal "0" "$(jexec childfree sysctl -n security.jail.children.max)"
54 atf_check_equal "0" "$(jexec childfree sysctl -n security.jail.children.cur)"
56 jail -c name=maxallowed children.max=$((origin_max - 1)) persist
57 atf_check_equal "$((origin_cur + 2))" "$(sysctl -n security.jail.children.cur)"
58 atf_check_equal "$((origin_max - 1))" "$(jexec maxallowed sysctl -n security.jail.children.max)"
59 atf_check_equal "0" "$(jexec maxallowed sysctl -n security.jail.children.cur)"
61 jexec maxallowed jail -c name=family children.max=4 persist
62 atf_check_equal "$((origin_cur + 3))" "$(sysctl -n security.jail.children.cur)"
63 atf_check_equal "1" "$(jexec maxallowed sysctl -n security.jail.children.cur)"
64 atf_check_equal "4" "$(jexec maxallowed.family sysctl -n security.jail.children.max)"
65 atf_check_equal "0" "$(jexec maxallowed.family sysctl -n security.jail.children.cur)"
69 jail -r maxallowed
70 jail -r childfree