diff options
author | Kristof Provost <kp@FreeBSD.org> | 2024-01-22 16:35:54 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2024-01-22 17:02:10 +0000 |
commit | 63a5fe834354dc9249388e0805e6ea68dc9f02c7 (patch) | |
tree | 868282c82f466b2c4e1cd65ecbda9de9bbf953b9 /tests | |
parent | 484e977f24418afa848d7ea1531b4379446d6065 (diff) | |
download | src-63a5fe834354dc9249388e0805e6ea68dc9f02c7.tar.gz src-63a5fe834354dc9249388e0805e6ea68dc9f02c7.zip |
pflow: limit to no more than 128 flow exporters
While there are no inherent limits to the number of exporters we're
likely to scale rather badly to very large numbers. There's also no
obvious use case for more than a handful. Limit to 128 exporters to
prevent foot-shooting.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/netpfil/pf/pflow.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh index 10efcbb93ac4..f0552eb061da 100644 --- a/tests/sys/netpfil/pf/pflow.sh +++ b/tests/sys/netpfil/pf/pflow.sh @@ -282,6 +282,37 @@ rule_cleanup() pft_cleanup } +atf_test_case "max_entries" "cleanup" +max_entries_head() +{ + atf_set descr 'Test that we can only create X pflow senders' + atf_set require.user root +} + +max_entries_body() +{ + pflow_init + + vnet_mkjail alcatraz + + for i in `seq 1 128` + do + atf_check -s exit:0 -o ignore \ + jexec alcatraz pflowctl -c + done + + # We cannot create the 129th pflow sender + atf_check -s exit:1 -o ignore -e ignore \ + jexec alcatraz pflowctl -c + + jexec alcatraz pflowctl -l +} + +max_entries_cleanup() +{ + pft_cleanup +} + atf_test_case "obs_dom" "cleanup" obs_dom_head() { @@ -313,5 +344,6 @@ atf_init_test_cases() atf_add_test_case "v6" atf_add_test_case "nat" atf_add_test_case "rule" + atf_add_test_case "max_entries" atf_add_test_case "obs_dom" } |