Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net Enable IPv6 negative tests



details:   https://anonhg.NetBSD.org/src/rev/1e2abd614ea1
branches:  trunk
changeset: 338253:1e2abd614ea1
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Sat May 16 14:29:37 2015 +0000

description:
Enable IPv6 negative tests

As ping6 timeout feature (-X option) is added, we can do negative
tests without wasting time.

1 sec delay is added after network setup to avoid false positives.

diffstat:

 tests/net/if_bridge/t_bridge.sh |  24 ++++++++++++------------
 tests/net/net/t_forwarding.sh   |  24 +++++++++++-------------
 2 files changed, 23 insertions(+), 25 deletions(-)

diffs (148 lines):

diff -r f209b0049b6b -r 1e2abd614ea1 tests/net/if_bridge/t_bridge.sh
--- a/tests/net/if_bridge/t_bridge.sh   Sat May 16 14:17:28 2015 +0000
+++ b/tests/net/if_bridge/t_bridge.sh   Sat May 16 14:29:37 2015 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/atf-sh
-#      $NetBSD: t_bridge.sh,v 1.3 2015/01/08 06:33:11 ozaki-r Exp $
+#      $NetBSD: t_bridge.sh,v 1.4 2015/05/16 14:29:37 ozaki-r Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -90,7 +90,7 @@
        atf_check -s exit:0 -o match:shmif0 rump.ifconfig
        if [ $mode = "ipv6" ]; then
                export LD_PRELOAD=/usr/lib/librumphijack.so
-               atf_check -s exit:0 -o ignore ping6 -n -c 1 ${addr}
+               atf_check -s exit:0 -o ignore ping6 -n -c 1 -X 1 ${addr}
                unset LD_PRELOAD
        else
                atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 ${addr}
@@ -245,9 +245,9 @@
 {
        export LD_PRELOAD=/usr/lib/librumphijack.so
        export RUMP_SERVER=$SOCK1
-       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP62
+       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP62
        export RUMP_SERVER=$SOCK3
-       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP61
+       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP61
        unset LD_PRELOAD
 }
 
@@ -256,14 +256,14 @@
        export RUMP_SERVER=$SOCK1
        rump.ifconfig -v shmif0
        export LD_PRELOAD=/usr/lib/librumphijack.so
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP62
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP62
        unset LD_PRELOAD
        rump.ifconfig -v shmif0
 
        export RUMP_SERVER=$SOCK3
        rump.ifconfig -v shmif0
        export LD_PRELOAD=/usr/lib/librumphijack.so
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP61
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP61
        unset LD_PRELOAD
        rump.ifconfig -v shmif0
 }
@@ -333,9 +333,11 @@
        setup
        test_setup
 
+       test_ping_failure
+
        setup_bridge
+       sleep 1
        test_setup_bridge
-
        test_ping_success
 
        teardown_bridge
@@ -347,17 +349,15 @@
        setup6
        test_setup6
 
-       # TODO: enable once ping6 implements timeout feature
-       #test_ping6_failure
+       test_ping6_failure
 
        setup_bridge
+       sleep 1
        test_setup_bridge
-
        test_ping6_success
 
        teardown_bridge
-       # TODO: enable once ping6 implements timeout feature
-       #test_ping6_failure
+       test_ping6_failure
 }
 
 rtable_body()
diff -r f209b0049b6b -r 1e2abd614ea1 tests/net/net/t_forwarding.sh
--- a/tests/net/net/t_forwarding.sh     Sat May 16 14:17:28 2015 +0000
+++ b/tests/net/net/t_forwarding.sh     Sat May 16 14:29:37 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_forwarding.sh,v 1.1 2015/05/13 10:04:44 ozaki-r Exp $
+#      $NetBSD: t_forwarding.sh,v 1.2 2015/05/16 14:29:37 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -287,9 +287,9 @@
 {
        export LD_PRELOAD=/usr/lib/librumphijack.so
        export RUMP_SERVER=$SOCKSRC
-       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP6DST
+       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6DST
        export RUMP_SERVER=$SOCKDST
-       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 $IP6SRC
+       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6SRC
        unset LD_PRELOAD
 }
 
@@ -298,16 +298,16 @@
        export RUMP_SERVER=$SOCKSRC
        $DEBUG && rump.ifconfig -v shmif0
        export LD_PRELOAD=/usr/lib/librumphijack.so
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP6SRCGW
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP6DST
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6SRCGW
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6DST
        unset LD_PRELOAD
        $DEBUG && rump.ifconfig -v shmif0
 
        export RUMP_SERVER=$SOCKDST
        $DEBUG && rump.ifconfig -v shmif0
        export LD_PRELOAD=/usr/lib/librumphijack.so
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP6DSTGW
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 $IP6SRC
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6DSTGW
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -X 1 $IP6SRC
        unset LD_PRELOAD
        $DEBUG && rump.ifconfig -v shmif0
 }
@@ -317,10 +317,9 @@
        export RUMP_SERVER=$SOCKSRC
        $DEBUG && rump.ifconfig -v shmif0
        export LD_PRELOAD=/usr/lib/librumphijack.so
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 1 $IP6SRCGW
-       # TODO: enable once ping6 implements timeout feature
-       #atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -h 1 $IP6DST
-       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 2 $IP6DST
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 1 -X 1 $IP6SRCGW
+       atf_check -s not-exit:0 -o ignore ping6 -q -n -c 1 -h 1 -X 1 $IP6DST
+       atf_check -s exit:0 -o ignore ping6 -q -n -c 1 -h 2 -X 1 $IP6DST
        unset LD_PRELOAD
        $DEBUG && rump.ifconfig -v shmif0
 }
@@ -352,8 +351,7 @@
 
        teardown_forwarding6
        test_teardown_forwarding6
-       # TODO: enable once ping6 implements timeout feature
-       #test_ping6_failure
+       test_ping6_failure
 }
 
 basic_cleanup()



Home | Main Index | Thread Index | Old Index