mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
pf tests: check that we clean up unused kifs
The previous commit fixed a memory leak, where we'd fail to clean up removed groups (and interfaces). Check that we now clean those up as expected. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D37570
This commit is contained in:
parent
bfeef0d32a
commit
654e8d84ec
|
@ -53,7 +53,51 @@ names_cleanup()
|
|||
pft_cleanup
|
||||
}
|
||||
|
||||
atf_test_case "group" "cleanup"
|
||||
group_head()
|
||||
{
|
||||
atf_set descr 'Test group cleanup, PR257218'
|
||||
atf_set require.user root
|
||||
}
|
||||
|
||||
group_body()
|
||||
{
|
||||
pft_init
|
||||
|
||||
vnet_mkjail alcatraz
|
||||
|
||||
if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ];
|
||||
then
|
||||
atf_fail "Unexpected epair group"
|
||||
fi
|
||||
|
||||
epair=$(vnet_mkepair)
|
||||
if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ];
|
||||
then
|
||||
atf_fail "Unexpected epair group"
|
||||
fi
|
||||
|
||||
ifconfig ${epair}b vnet alcatraz
|
||||
if [ -z "$(jexec alcatraz pfctl -sI | grep '^epair$')" ];
|
||||
then
|
||||
atf_fail "Failed to find epair group"
|
||||
fi
|
||||
|
||||
ifconfig ${epair}a destroy
|
||||
|
||||
if [ -n "$(jexec alcatraz pfctl -sI | grep '^epair$')" ];
|
||||
then
|
||||
atf_fail "Unexpected epair group"
|
||||
fi
|
||||
}
|
||||
|
||||
group_cleanup()
|
||||
{
|
||||
pft_cleanup
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
{
|
||||
atf_add_test_case "names"
|
||||
atf_add_test_case "group"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue