pf tests: Test name handling

Provoke a situation where two interfaces have the same name, and verify
pf's reaction to this.
This commit is contained in:
Kristof Provost 2018-12-01 09:59:32 +00:00
parent b2e0b24f76
commit df5ceb3b66
2 changed files with 35 additions and 0 deletions

View File

@ -9,6 +9,7 @@ ATF_TESTS_SH+= anchor \
pass_block \ pass_block \
forward \ forward \
fragmentation \ fragmentation \
names \
set_tos \ set_tos \
route_to \ route_to \
synproxy \ synproxy \

34
tests/sys/netpfil/pf/names.sh Executable file
View File

@ -0,0 +1,34 @@
# $FreeBSD$
. $(atf_get_srcdir)/utils.subr
atf_test_case "names" "cleanup"
names_head()
{
atf_set descr 'Test overlapping names'
atf_set require.user root
}
names_body()
{
pft_init
epair=$(pft_mkepair)
pft_mkjail alcatraz ${epair}b
ifconfig ${epair}a name foo
jexec alcatraz ifconfig ${epair}b name foo
jail -r alcatraz
ifconfig foo destroy
}
names_cleanup()
{
pft_cleanup
}
atf_init_test_cases()
{
atf_add_test_case "names"
}