3 . $(atf_get_srcdir)/../common/vnet.subr
5 atf_test_case "235704" "cleanup"
8 atf_set descr "Test PR #235704"
9 atf_set require.user root
16 tun=$(jexec one ifconfig tun create)
17 jexec one ifconfig ${tun} name foo
18 atf_check -s exit:0 jexec one ifconfig foo destroy
25 atf_test_case "basic" "cleanup"
28 atf_set descr "Test if_tun using nc"
29 atf_set require.user root
37 tun_duke=$(ifconfig tun create)
38 tun_bass=$(ifconfig tun create)
40 vnet_mkjail duke ${epair}a ${tun_duke}
41 vnet_mkjail bass ${epair}b ${tun_bass}
43 jexec duke ifconfig ${epair}a inet 10.0.0.1/24 up
44 jexec bass ifconfig ${epair}b inet 10.0.0.2/24 up
46 jexec duke nc -u -l --tun /dev/${tun_duke} 10.0.0.1 2600 &
47 jexec bass nc -u --tun /dev/${tun_bass} 10.0.0.1 2600 &
49 jexec duke ifconfig ${tun_duke} inet 10.100.0.1/24 10.100.0.2 up
50 jexec bass ifconfig ${tun_bass} inet 10.100.0.2/24 10.100.0.1 up
52 atf_check -s exit:0 -o ignore \
53 jexec bass ping -c 1 10.100.0.1
62 atf_add_test_case "235704"
63 atf_add_test_case "basic"