Module Name: src
Committed By: ozaki-r
Date: Sat May 16 14:29:37 UTC 2015
Modified Files:
src/tests/net/if_bridge: t_bridge.sh
src/tests/net/net: t_forwarding.sh
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if_bridge/t_bridge.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/net/net/t_forwarding.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/net/if_bridge/t_bridge.sh
diff -u src/tests/net/if_bridge/t_bridge.sh:1.3 src/tests/net/if_bridge/t_bridge.sh:1.4
--- src/tests/net/if_bridge/t_bridge.sh:1.3 Thu Jan 8 06:33:11 2015
+++ src/tests/net/if_bridge/t_bridge.sh Sat May 16 14:29:37 2015
@@ -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 @@ test_endpoint()
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 @@ test_ping6_failure()
{
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 @@ test_ping6_success()
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 @@ basic_body()
setup
test_setup
+ test_ping_failure
+
setup_bridge
+ sleep 1
test_setup_bridge
-
test_ping_success
teardown_bridge
@@ -347,17 +349,15 @@ basic6_body()
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()
Index: src/tests/net/net/t_forwarding.sh
diff -u src/tests/net/net/t_forwarding.sh:1.1 src/tests/net/net/t_forwarding.sh:1.2
--- src/tests/net/net/t_forwarding.sh:1.1 Wed May 13 10:04:44 2015
+++ src/tests/net/net/t_forwarding.sh Sat May 16 14:29:37 2015
@@ -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 @@ test_ping6_failure()
{
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 @@ test_ping6_success()
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 @@ test_hoplimit()
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 @@ basic6_body()
teardown_forwarding6
test_teardown_forwarding6
- # TODO: enable once ping6 implements timeout feature
- #test_ping6_failure
+ test_ping6_failure
}
basic_cleanup()