2 . $(atf_get_srcdir)/../common/vnet.subr
4 atf_test_case "235704" "cleanup"
7 atf_set descr "Test PR #235704"
8 atf_set require.user root
15 tun=$(jexec one ifconfig tun create)
16 jexec one ifconfig ${tun} name foo
17 atf_check -s exit:0 jexec one ifconfig foo destroy
24 atf_test_case "basic" "cleanup"
27 atf_set descr "Test if_tun using nc"
28 atf_set require.user root
36 tun_duke=$(ifconfig tun create)
37 tun_bass=$(ifconfig tun create)
39 vnet_mkjail duke ${epair}a ${tun_duke}
40 vnet_mkjail bass ${epair}b ${tun_bass}
42 jexec duke ifconfig ${epair}a inet 10.0.0.1/24 up
43 jexec bass ifconfig ${epair}b inet 10.0.0.2/24 up
45 jexec duke nc -u -l --tun /dev/${tun_duke} 10.0.0.1 2600 &
46 jexec bass nc -u --tun /dev/${tun_bass} 10.0.0.1 2600 &
48 jexec duke ifconfig ${tun_duke} inet 10.100.0.1/24 10.100.0.2 up
49 jexec bass ifconfig ${tun_bass} inet 10.100.0.2/24 10.100.0.1 up
51 atf_check -s exit:0 -o ignore \
52 jexec bass ping -c 1 10.100.0.1
61 atf_add_test_case "235704"
62 atf_add_test_case "basic"