fcd69db27d
Set up two jails connected by an epair. Create VLAN interfaces in both jails and check connectivity. This is a very basic test, but exposed panics during the network stack epoch work, so this is worth testing.
43 lines
799 B
Bash
Executable File
43 lines
799 B
Bash
Executable File
# $FreeBSD$
|
|
|
|
. $(atf_get_srcdir)/../common/vnet.subr
|
|
|
|
atf_test_case "basic" "cleanup"
|
|
basic_head()
|
|
{
|
|
atf_set descr 'Basic VLAN test'
|
|
atf_set require.user root
|
|
}
|
|
|
|
basic_body()
|
|
{
|
|
vnet_init
|
|
|
|
epair_vlan=$(vnet_mkepair)
|
|
|
|
vnet_mkjail alcatraz ${epair_vlan}a
|
|
vnet_mkjail singsing ${epair_vlan}b
|
|
|
|
vlan0=$(jexec alcatraz ifconfig vlan create vlandev ${epair_vlan}a \
|
|
vlan 42)
|
|
jexec alcatraz ifconfig ${epair_vlan}a up
|
|
jexec alcatraz ifconfig ${vlan0} 10.0.0.1/24 up
|
|
|
|
vlan1=$(jexec singsing ifconfig vlan create vlandev ${epair_vlan}b \
|
|
vlan 42)
|
|
jexec singsing ifconfig ${epair_vlan}b up
|
|
jexec singsing ifconfig ${vlan1} 10.0.0.2/24 up
|
|
|
|
atf_check -s exit:0 -o ignore jexec singsing ping -c 1 10.0.0.1
|
|
}
|
|
|
|
basic_cleanup()
|
|
{
|
|
vnet_cleanup
|
|
}
|
|
|
|
atf_init_test_cases()
|
|
{
|
|
atf_add_test_case "basic"
|
|
}
|