aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/net
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2019-03-05 15:49:30 +0000
committerKristof Provost <kp@FreeBSD.org>2019-03-05 15:49:30 +0000
commit3846e5755f01ff3fa2b4d9a30ba213efd8f52ced (patch)
tree65a9d001e66e07178dcf6b07b599b976011a6cb6 /tests/sys/net
parent3df898baed1e75943432ea30db4a99d85dbf1a4a (diff)
downloadsrc-3846e5755f01ff3fa2b4d9a30ba213efd8f52ced.tar.gz
src-3846e5755f01ff3fa2b4d9a30ba213efd8f52ced.zip
tun tests: Test renaming and destroying a tun interface in a vnet jail
There was a problem destroying renamed tun interfaces in vnet jails. This was fixed in r344794. Test the previously failing scenario. PR: 235704 MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=344797
Diffstat (limited to 'tests/sys/net')
-rw-r--r--tests/sys/net/Makefile1
-rwxr-xr-xtests/sys/net/if_tun_test.sh30
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile
index 681a1408ab17..03e0631f6251 100644
--- a/tests/sys/net/Makefile
+++ b/tests/sys/net/Makefile
@@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR}
ATF_TESTS_SH+= if_lagg_test
ATF_TESTS_SH+= if_clone_test
+ATF_TESTS_SH+= if_tun_test
# The tests are written to be run in parallel, but doing so leads to random
# panics. I think it's because the kernel's list of interfaces isn't properly
diff --git a/tests/sys/net/if_tun_test.sh b/tests/sys/net/if_tun_test.sh
new file mode 100755
index 000000000000..64dc004e3a06
--- /dev/null
+++ b/tests/sys/net/if_tun_test.sh
@@ -0,0 +1,30 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/../common/vnet.subr
+
+atf_test_case "235704" "cleanup"
+235704_head()
+{
+ atf_set descr "Test PR #235704"
+ atf_set require.user root
+}
+
+235704_body()
+{
+ vnet_init
+ vnet_mkjail one
+
+ tun=$(jexec one ifconfig tun create)
+ jexec one ifconfig ${tun} name foo
+ atf_check -s exit:0 jexec one ifconfig foo destroy
+}
+
+235704_cleanup()
+{
+ vnet_cleanup
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "235704"
+}