1 # $NetBSD: t_vlan.sh,v 1.1 2016/11/26 03:19:49 ozaki-r Exp $
3 # Copyright (c) 2016 Internet Initiative Japan Inc.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
29 SOCK_LOCAL=unix://commsock1
30 SOCK_REMOTE=unix://commsock2
36 atf_test_case vlan_create_destroy cleanup
37 vlan_create_destroy_head()
40 atf_set "descr" "tests of creation and deletion of vlan interface"
41 atf_set "require.progs" "rump_server"
44 vlan_create_destroy_body()
47 rump_server_start $SOCK_LOCAL vlan
49 export RUMP_SERVER=${SOCK_LOCAL}
51 atf_check -s exit:0 rump.ifconfig vlan0 create
52 atf_check -s exit:0 rump.ifconfig vlan0 up
53 atf_check -s exit:0 rump.ifconfig vlan0 down
54 atf_check -s exit:0 rump.ifconfig vlan0 destroy
57 vlan_create_destroy_cleanup()
64 atf_test_case vlan_basic cleanup
68 atf_set "descr" "tests of communications over vlan interfaces"
69 atf_set "require.progs" "rump_server"
75 rump_server_start $SOCK_LOCAL vlan
76 rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
77 rump_server_start $SOCK_REMOTE vlan
78 rump_server_add_iface $SOCK_REMOTE shmif0 $BUS
80 export RUMP_SERVER=$SOCK_LOCAL
81 atf_check -s exit:0 rump.ifconfig shmif0 up
82 export RUMP_SERVER=$SOCK_REMOTE
83 atf_check -s exit:0 rump.ifconfig shmif0 up
85 export RUMP_SERVER=$SOCK_LOCAL
86 atf_check -s exit:0 rump.ifconfig vlan0 create
87 atf_check -s exit:0 rump.ifconfig vlan0 vlan 10 vlanif shmif0
88 atf_check -s exit:0 rump.ifconfig vlan0 $IP_LOCAL/24
89 atf_check -s exit:0 rump.ifconfig vlan0 up
90 atf_check -s exit:0 rump.ifconfig -w 10
92 export RUMP_SERVER=$SOCK_REMOTE
93 atf_check -s exit:0 rump.ifconfig vlan0 create
94 atf_check -s exit:0 rump.ifconfig vlan0 vlan 10 vlanif shmif0
95 atf_check -s exit:0 rump.ifconfig vlan0 $IP_REMOTE/24
96 atf_check -s exit:0 rump.ifconfig vlan0 up
97 atf_check -s exit:0 rump.ifconfig -w 10
99 export RUMP_SERVER=$SOCK_LOCAL
100 atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 $IP_REMOTE
110 atf_init_test_cases()
113 atf_add_test_case vlan_create_destroy
114 atf_add_test_case vlan_basic