]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tests/sys/net/if_vlan.sh
Import DTS files for arm, arm64, riscv from Linux 5.8
[FreeBSD/FreeBSD.git] / tests / sys / net / if_vlan.sh
1 # $FreeBSD$
2
3 . $(atf_get_srcdir)/../common/vnet.subr
4
5 atf_test_case "basic" "cleanup"
6 basic_head()
7 {
8         atf_set descr 'Basic VLAN test'
9         atf_set require.user root
10 }
11
12 basic_body()
13 {
14         vnet_init
15
16         epair_vlan=$(vnet_mkepair)
17
18         vnet_mkjail alcatraz ${epair_vlan}a
19         vnet_mkjail singsing ${epair_vlan}b
20
21         vlan0=$(jexec alcatraz ifconfig vlan create vlandev ${epair_vlan}a \
22                 vlan 42)
23         jexec alcatraz ifconfig ${epair_vlan}a up
24         jexec alcatraz ifconfig ${vlan0} 10.0.0.1/24 up
25
26         vlan1=$(jexec singsing ifconfig vlan create vlandev ${epair_vlan}b \
27                 vlan 42)
28         jexec singsing ifconfig ${epair_vlan}b up
29         jexec singsing ifconfig ${vlan1} 10.0.0.2/24 up
30
31         atf_check -s exit:0 -o ignore jexec singsing ping -c 1 10.0.0.1
32 }
33
34 basic_cleanup()
35 {
36         vnet_cleanup
37 }
38
39 atf_init_test_cases()
40 {
41         atf_add_test_case "basic"
42 }