xref: /freebsd/contrib/netbsd-tests/net/if/t_ifconfig.sh (revision 1a36faad54665288ed4eb839d2a4699ae2ead45e)
1*dd66b5baSEnji Cooper# $NetBSD: t_ifconfig.sh,v 1.15 2017/01/20 08:35:33 ozaki-r Exp $
2640235e2SEnji Cooper#
3640235e2SEnji Cooper# Copyright (c) 2015 The NetBSD Foundation, Inc.
4640235e2SEnji Cooper# All rights reserved.
5640235e2SEnji Cooper#
6640235e2SEnji Cooper# Redistribution and use in source and binary forms, with or without
7640235e2SEnji Cooper# modification, are permitted provided that the following conditions
8640235e2SEnji Cooper# are met:
9640235e2SEnji Cooper# 1. Redistributions of source code must retain the above copyright
10640235e2SEnji Cooper#    notice, this list of conditions and the following disclaimer.
11640235e2SEnji Cooper# 2. Redistributions in binary form must reproduce the above copyright
12640235e2SEnji Cooper#    notice, this list of conditions and the following disclaimer in the
13640235e2SEnji Cooper#    documentation and/or other materials provided with the distribution.
14640235e2SEnji Cooper#
15640235e2SEnji Cooper# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16640235e2SEnji Cooper# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17640235e2SEnji Cooper# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18640235e2SEnji Cooper# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19640235e2SEnji Cooper# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20640235e2SEnji Cooper# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21640235e2SEnji Cooper# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22640235e2SEnji Cooper# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23640235e2SEnji Cooper# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24640235e2SEnji Cooper# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25640235e2SEnji Cooper# POSSIBILITY OF SUCH DAMAGE.
26640235e2SEnji Cooper#
27640235e2SEnji Cooper
28640235e2SEnji CooperRUMP_SERVER1=unix://./r1
29640235e2SEnji CooperRUMP_SERVER2=unix://./r2
30640235e2SEnji Cooper
31640235e2SEnji CooperRUMP_FLAGS=\
32640235e2SEnji Cooper"-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
33640235e2SEnji CooperRUMP_FLAGS="${RUMP_FLAGS} -lrumpdev"
34640235e2SEnji Cooper
35640235e2SEnji CooperTIMEOUT=3
36640235e2SEnji Cooper
37cdebaff8SEnji Cooperanycast="[Aa][Nn][Yy][Cc][Aa][Ss][Tt]"
38cdebaff8SEnji Cooperdeprecated="[Dd][Ee][Pp][Rr][Ee][Cc][Aa][Tt][Ee][Dd]"
39cdebaff8SEnji Cooper
40640235e2SEnji Cooperatf_test_case ifconfig_create_destroy cleanup
41640235e2SEnji Cooperifconfig_create_destroy_head()
42640235e2SEnji Cooper{
43640235e2SEnji Cooper
44640235e2SEnji Cooper	atf_set "descr" "tests of ifconfig create and destroy"
45640235e2SEnji Cooper	atf_set "require.progs" "rump_server"
46640235e2SEnji Cooper}
47640235e2SEnji Cooper
48640235e2SEnji Cooperifconfig_create_destroy_body()
49640235e2SEnji Cooper{
50640235e2SEnji Cooper	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
51640235e2SEnji Cooper
52640235e2SEnji Cooper	export RUMP_SERVER=${RUMP_SERVER1}
53640235e2SEnji Cooper
54640235e2SEnji Cooper	# Create and destroy (no address)
55640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 create
56640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 destroy
57640235e2SEnji Cooper
58640235e2SEnji Cooper	# Create and destroy (with an IPv4 address)
59640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 create
60640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
61640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24
62640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 up
63640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 destroy
64640235e2SEnji Cooper
65640235e2SEnji Cooper	# Create and destroy (with an IPv6 address)
66640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 create
67640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
68640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
69640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 up
70640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 destroy
71640235e2SEnji Cooper
72640235e2SEnji Cooper	unset RUMP_SERVER
73640235e2SEnji Cooper}
74640235e2SEnji Cooper
75640235e2SEnji Cooperifconfig_create_destroy_cleanup()
76640235e2SEnji Cooper{
77640235e2SEnji Cooper
78640235e2SEnji Cooper	RUMP_SERVER=${RUMP_SERVER1} rump.halt
79640235e2SEnji Cooper}
80640235e2SEnji Cooper
81640235e2SEnji Cooperatf_test_case ifconfig_options cleanup
82640235e2SEnji Cooperifconfig_options_head()
83640235e2SEnji Cooper{
84640235e2SEnji Cooper
85640235e2SEnji Cooper	atf_set "descr" "tests of ifconfig options"
86640235e2SEnji Cooper	atf_set "require.progs" "rump_server"
87640235e2SEnji Cooper}
88640235e2SEnji Cooper
89640235e2SEnji Cooperifconfig_options_body()
90640235e2SEnji Cooper{
91640235e2SEnji Cooper
92640235e2SEnji Cooper	export RUMP_SERVER=${RUMP_SERVER1}
93640235e2SEnji Cooper	atf_check -s exit:0 rump_server $RUMP_FLAGS $RUMP_SERVER1
94640235e2SEnji Cooper
95640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
96640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr bus1
97640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet 10.0.0.1/24
98640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::1/64
99640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
100640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
101640235e2SEnji Cooper	$DEBUG && rump.ifconfig shmif0
102640235e2SEnji Cooper
103640235e2SEnji Cooper	# ifconfig [-N] interface address_family
104640235e2SEnji Cooper	#   -N resolves hostnames
105640235e2SEnji Cooper	atf_check -s exit:0 -o match:'inet 127.0.0.1' rump.ifconfig lo0 inet
106640235e2SEnji Cooper	atf_check -s exit:0 -o match:'inet localhost' rump.ifconfig -N lo0 inet
107640235e2SEnji Cooper	atf_check -s exit:0 -o match:'inet6 ::1' rump.ifconfig lo0 inet6
108640235e2SEnji Cooper	atf_check -s exit:0 -o match:'inet6 localhost' rump.ifconfig -N lo0 inet6
109640235e2SEnji Cooper	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig lo0 atalk
110640235e2SEnji Cooper	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig -N lo0 atalk
111640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig lo0 link
112640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -N lo0 link
113640235e2SEnji Cooper
114640235e2SEnji Cooper	# ifconfig [-hLmNvz] interface
115640235e2SEnji Cooper	#   -h -v shows statistics in human readable format
116640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -h -v lo0
117640235e2SEnji Cooper	#   -L shows IPv6 lifetime
118640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::2 \
119640235e2SEnji Cooper	    pltime 100
120640235e2SEnji Cooper	$DEBUG && rump.ifconfig -L shmif0
121640235e2SEnji Cooper	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -L shmif0
122640235e2SEnji Cooper	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -L shmif0
123640235e2SEnji Cooper	#   -m shows all of the supported media (not supported in shmif)
124640235e2SEnji Cooper	$DEBUG && rump.ifconfig -m shmif0
125640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -m shmif0
126640235e2SEnji Cooper	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -N lo0
127640235e2SEnji Cooper	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
128640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT localhost
129640235e2SEnji Cooper	#   -z clears and shows statistics at that point
130640235e2SEnji Cooper	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -z lo0
131640235e2SEnji Cooper	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
132640235e2SEnji Cooper
133640235e2SEnji Cooper	# ifconfig -a [-bdhLNmsuvz]
134640235e2SEnji Cooper	#   -a shows all interfaces in the system
135640235e2SEnji Cooper	$DEBUG && rump.ifconfig -a
136640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' -o match:'lo0' rump.ifconfig -a
137640235e2SEnji Cooper	#   -a -b shows only broadcast interfaces
138640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' -o not-match:'lo0' rump.ifconfig -a -b
139640235e2SEnji Cooper	#   -a -d shows only down interfaces
140640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
141640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -d
142640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
143640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -d
144640235e2SEnji Cooper	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -a -L
145640235e2SEnji Cooper	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -a -L
146640235e2SEnji Cooper	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -a -N
147640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -a -m
148640235e2SEnji Cooper	#   -a -s shows only interfaces connected to a network
149640235e2SEnji Cooper	#   (shmif is always connected)
150640235e2SEnji Cooper	$DEBUG && rump.ifconfig -a -s
151640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -a -s
152640235e2SEnji Cooper	#   -a -u shows only up interfaces
153640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -u
154640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
155640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -u
156640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
157640235e2SEnji Cooper	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
158640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT localhost
159640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
160640235e2SEnji Cooper	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -a -z
161640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'2 packets' rump.ifconfig -a -v
162640235e2SEnji Cooper	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
163640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
164640235e2SEnji Cooper
165640235e2SEnji Cooper	# ifconfig -l [-bdsu]
166640235e2SEnji Cooper	#   -l shows only inteface names
167640235e2SEnji Cooper	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l
168640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l
169640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -b
170640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'lo0' rump.ifconfig -l -b
171640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ifconfig -l -d
172640235e2SEnji Cooper	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l -s
173640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -s
174640235e2SEnji Cooper	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l -u
175640235e2SEnji Cooper	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -u
176640235e2SEnji Cooper
177640235e2SEnji Cooper	# ifconfig -s interface
178640235e2SEnji Cooper	#   -s interface exists with 0 / 1 if connected / disconnected
179640235e2SEnji Cooper	atf_check -s exit:0 -o empty rump.ifconfig -s lo0
180640235e2SEnji Cooper	atf_check -s exit:0 -o empty rump.ifconfig -s shmif0
181640235e2SEnji Cooper
182640235e2SEnji Cooper	# ifconfig -C
183640235e2SEnji Cooper	#   -C shows all of the interface cloners available on the system
184*dd66b5baSEnji Cooper	atf_check -s exit:0 -o match:'shmif carp lo' rump.ifconfig -C
185640235e2SEnji Cooper
186640235e2SEnji Cooper	unset RUMP_SERVER
187640235e2SEnji Cooper}
188640235e2SEnji Cooper
189640235e2SEnji Cooperifconfig_options_cleanup()
190640235e2SEnji Cooper{
191640235e2SEnji Cooper
192640235e2SEnji Cooper	env RUMP_SERVER=${RUMP_SERVER1} rump.halt
193640235e2SEnji Cooper}
194640235e2SEnji Cooper
195640235e2SEnji Cooper
196640235e2SEnji Cooperatf_test_case ifconfig_parameters cleanup
197640235e2SEnji Cooperifconfig_parameters_head()
198640235e2SEnji Cooper{
199640235e2SEnji Cooper	atf_set "descr" "tests of interface parameters"
200640235e2SEnji Cooper	atf_set "require.progs" "rump_server"
201640235e2SEnji Cooper}
202640235e2SEnji Cooper
203640235e2SEnji Cooperifconfig_parameters_body()
204640235e2SEnji Cooper{
205640235e2SEnji Cooper	local interval=
206640235e2SEnji Cooper
207640235e2SEnji Cooper	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
208640235e2SEnji Cooper	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
209640235e2SEnji Cooper
210640235e2SEnji Cooper	export RUMP_SERVER=${RUMP_SERVER1}
211640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 create
212640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
213640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24
214640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 up
215640235e2SEnji Cooper	unset RUMP_SERVER
216640235e2SEnji Cooper
217640235e2SEnji Cooper	export RUMP_SERVER=${RUMP_SERVER2}
218640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 create
219640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
220640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.2/24
221640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.3/24 alias
222640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 up
223640235e2SEnji Cooper	unset RUMP_SERVER
224640235e2SEnji Cooper
225640235e2SEnji Cooper	export RUMP_SERVER=${RUMP_SERVER1}
226640235e2SEnji Cooper
227640235e2SEnji Cooper	# active
228640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:01 active
229640235e2SEnji Cooper	atf_check -s exit:0 -o match:'address:.b2:a0:75:00:00:01' \
230640235e2SEnji Cooper	    rump.ifconfig shmif0
231640235e2SEnji Cooper	# down, up
232640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 down
233cdebaff8SEnji Cooper	atf_check -s not-exit:0 -o ignore -e ignore rump.ping -c 1 \
234640235e2SEnji Cooper	    -w $TIMEOUT -n 192.168.0.2
235640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 up
236cdebaff8SEnji Cooper	atf_check -s exit:0 rump.ifconfig -w 10
237640235e2SEnji Cooper	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT -n 192.168.0.2
238640235e2SEnji Cooper
239640235e2SEnji Cooper	# alias
240640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
241cdebaff8SEnji Cooper	atf_check -s exit:0 -o match:'192.168.1.1/24' rump.ifconfig shmif0
242640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 -alias
243cdebaff8SEnji Cooper	atf_check -s exit:0 -o not-match:'192.168.1.1/24' rump.ifconfig shmif0
244640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
245640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2
246640235e2SEnji Cooper	atf_check -s exit:0 -o match:'fc00::1' rump.ifconfig shmif0 inet6
247640235e2SEnji Cooper	atf_check -s exit:0 -o match:'fc00::2' rump.ifconfig shmif0 inet6
248640235e2SEnji Cooper
249640235e2SEnji Cooper	# delete
250640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1 alias
251640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1 delete
252640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'192.168.1.1' rump.ifconfig shmif0 inet
253640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.1 delete
254640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'192.168.0.1' rump.ifconfig shmif0 inet
255640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 delete
256640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 delete
257640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'fc00::1' rump.ifconfig shmif0 inet6
258640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'fc00::2' rump.ifconfig shmif0 inet6
259640235e2SEnji Cooper	# can delete inactive link
260640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:02
261640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:02 delete
262640235e2SEnji Cooper	# cannot delete active link
263640235e2SEnji Cooper	atf_check -s not-exit:0 -e match:'SIOCDLIFADDR: Device busy' \
264640235e2SEnji Cooper	    rump.ifconfig shmif0 link b2:a0:75:00:00:01 delete
265640235e2SEnji Cooper
266640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.1/24
267640235e2SEnji Cooper
268640235e2SEnji Cooper	# arp
269640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 -arp
270640235e2SEnji Cooper	atf_check -s not-exit:0 -o ignore -e ignore \
271640235e2SEnji Cooper	    rump.ping -c 1 -w $TIMEOUT -n 192.168.0.3
272640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'192.168.0.3' rump.arp -an
273640235e2SEnji Cooper	# The entry shouldn't appear in the routing table anymore
274640235e2SEnji Cooper	atf_check -s exit:0 -o not-match:'192.168.0.3' rump.netstat -nr
275640235e2SEnji Cooper
276640235e2SEnji Cooper	# netmask
277640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 netmask 255.255.255.0 alias
278640235e2SEnji Cooper	atf_check -s exit:0 -o match:'172.16.0/24' rump.netstat -rn -f inet
279640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 delete
280640235e2SEnji Cooper
281640235e2SEnji Cooper	# broadcast (does it not work?)
282640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 \
283640235e2SEnji Cooper	    broadcast 255.255.255.255 alias
284640235e2SEnji Cooper	atf_check -s exit:0 -o match:'broadcast 255.255.255.255' \
285640235e2SEnji Cooper	    rump.ifconfig shmif0 inet
286640235e2SEnji Cooper
287640235e2SEnji Cooper	# metric (external only)
288640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 metric 10
289640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 metric 0
290640235e2SEnji Cooper
291640235e2SEnji Cooper	# prefixlen
292640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 prefixlen 70
293640235e2SEnji Cooper	atf_check -s exit:0 -o match:'fc00::/70' rump.netstat -rn -f inet6
294640235e2SEnji Cooper
295640235e2SEnji Cooper	# anycast
296640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
297cdebaff8SEnji Cooper	atf_check -s exit:0 -o match:"fc00::2.+$anycast" rump.ifconfig shmif0 inet6
298640235e2SEnji Cooper
299640235e2SEnji Cooper	# deprecated
300640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
301640235e2SEnji Cooper	# Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
302640235e2SEnji Cooper	interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
303640235e2SEnji Cooper	atf_check -s exit:0 sleep $((interval + 1))
304cdebaff8SEnji Cooper	atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
305640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
306cdebaff8SEnji Cooper	atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
307640235e2SEnji Cooper
308640235e2SEnji Cooper	# pltime
309640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3
310cdebaff8SEnji Cooper	atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
311640235e2SEnji Cooper	atf_check -s exit:0 sleep 5
312cdebaff8SEnji Cooper	atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
313640235e2SEnji Cooper
314640235e2SEnji Cooper	# eui64
315640235e2SEnji Cooper	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64
316640235e2SEnji Cooper	atf_check -s exit:0 -o match:'fc00:1::' rump.ifconfig shmif0 inet6
317640235e2SEnji Cooper
318640235e2SEnji Cooper	unset RUMP_SERVER
319640235e2SEnji Cooper}
320640235e2SEnji Cooper
321640235e2SEnji Cooperifconfig_parameters_cleanup()
322640235e2SEnji Cooper{
323640235e2SEnji Cooper	env RUMP_SERVER=${RUMP_SERVER1} rump.halt
324640235e2SEnji Cooper	env RUMP_SERVER=${RUMP_SERVER2} rump.halt
325640235e2SEnji Cooper}
326640235e2SEnji Cooper
327640235e2SEnji Cooperatf_init_test_cases()
328640235e2SEnji Cooper{
329640235e2SEnji Cooper
330640235e2SEnji Cooper	atf_add_test_case ifconfig_create_destroy
331640235e2SEnji Cooper	atf_add_test_case ifconfig_options
332640235e2SEnji Cooper	atf_add_test_case ifconfig_parameters
333640235e2SEnji Cooper}
334