Fri Nov 6 02:54:37 2015 UTC ()
Improve test stability

"deprecated" flag may not be reflected immediately. We need to add some
delay before checking the result.


(ozaki-r)
diff -r1.4 -r1.5 src/tests/net/if/t_ifconfig.sh

cvs diff -r1.4 -r1.5 src/tests/net/if/t_ifconfig.sh (expand / switch to unified diff)

--- src/tests/net/if/t_ifconfig.sh 2015/11/05 02:57:36 1.4
+++ src/tests/net/if/t_ifconfig.sh 2015/11/06 02:54:37 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: t_ifconfig.sh,v 1.4 2015/11/05 02:57:36 ozaki-r Exp $ 1# $NetBSD: t_ifconfig.sh,v 1.5 2015/11/06 02:54:37 ozaki-r Exp $
2# 2#
3# Copyright (c) 2015 The NetBSD Foundation, Inc. 3# Copyright (c) 2015 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 14#
@@ -182,26 +182,28 @@ options_cleanup() @@ -182,26 +182,28 @@ options_cleanup()
182 env RUMP_SERVER=${RUMP_SERVER1} rump.halt 182 env RUMP_SERVER=${RUMP_SERVER1} rump.halt
183} 183}
184 184
185 185
186atf_test_case parameters cleanup 186atf_test_case parameters cleanup
187parameters_head() 187parameters_head()
188{ 188{
189 atf_set "descr" "tests of interface parametors" 189 atf_set "descr" "tests of interface parametors"
190 atf_set "require.progs" "rump_server" 190 atf_set "require.progs" "rump_server"
191} 191}
192 192
193parameters_body() 193parameters_body()
194{ 194{
 195 local interval=
 196
195 atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1} 197 atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
196 atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2} 198 atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
197 199
198 export RUMP_SERVER=${RUMP_SERVER1} 200 export RUMP_SERVER=${RUMP_SERVER1}
199 atf_check -s exit:0 rump.ifconfig shmif0 create 201 atf_check -s exit:0 rump.ifconfig shmif0 create
200 atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus 202 atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
201 atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24 203 atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24
202 atf_check -s exit:0 rump.ifconfig shmif0 up 204 atf_check -s exit:0 rump.ifconfig shmif0 up
203 unset RUMP_SERVER 205 unset RUMP_SERVER
204 206
205 export RUMP_SERVER=${RUMP_SERVER2} 207 export RUMP_SERVER=${RUMP_SERVER2}
206 atf_check -s exit:0 rump.ifconfig shmif0 create 208 atf_check -s exit:0 rump.ifconfig shmif0 create
207 atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus 209 atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
@@ -266,26 +268,29 @@ parameters_body() @@ -266,26 +268,29 @@ parameters_body()
266 atf_check -s exit:0 rump.ifconfig shmif0 metric 10 268 atf_check -s exit:0 rump.ifconfig shmif0 metric 10
267 atf_check -s exit:0 rump.ifconfig shmif0 metric 0 269 atf_check -s exit:0 rump.ifconfig shmif0 metric 0
268 270
269 # prefixlen 271 # prefixlen
270 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 prefixlen 70 272 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 prefixlen 70
271 atf_check -s exit:0 -o match:'fc00::/70' rump.netstat -rn -f inet6 273 atf_check -s exit:0 -o match:'fc00::/70' rump.netstat -rn -f inet6
272 274
273 # anycast 275 # anycast
274 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast 276 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
275 atf_check -s exit:0 -o match:'fc00::2.+anycast' rump.ifconfig shmif0 inet6 277 atf_check -s exit:0 -o match:'fc00::2.+anycast' rump.ifconfig shmif0 inet6
276 278
277 # deprecated 279 # deprecated
278 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated 280 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
 281 # Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
 282 interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
 283 atf_check -s exit:0 sleep $((interval + 1))
279 atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6 284 atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
280 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated 285 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
281 atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6 286 atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
282 287
283 # pltime 288 # pltime
284 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3 289 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3
285 atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6 290 atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
286 atf_check -s exit:0 sleep 5 291 atf_check -s exit:0 sleep 5
287 atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6 292 atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
288 293
289 # eui64 294 # eui64
290 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64 295 atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64
291 atf_check -s exit:0 -o match:'fc00:1::' rump.ifconfig shmif0 inet6 296 atf_check -s exit:0 -o match:'fc00:1::' rump.ifconfig shmif0 inet6