From f425577a0082ce103fb7caf389fac8c7a82e379a Mon Sep 17 00:00:00 2001 From: kp Date: Sat, 1 Dec 2018 09:59:32 +0000 Subject: [PATCH] pf tests: Test name handling Provoke a situation where two interfaces have the same name, and verify pf's reaction to this. --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/names.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 tests/sys/netpfil/pf/names.sh diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index b9484e0a5c55..3d0f861f0a16 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -9,6 +9,7 @@ ATF_TESTS_SH+= anchor \ pass_block \ forward \ fragmentation \ + names \ set_tos \ route_to \ synproxy \ diff --git a/tests/sys/netpfil/pf/names.sh b/tests/sys/netpfil/pf/names.sh new file mode 100755 index 000000000000..f73a149f8e90 --- /dev/null +++ b/tests/sys/netpfil/pf/names.sh @@ -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" +}