Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net Test routing messages emitted on operations of ARP...
details: https://anonhg.NetBSD.org/src/rev/8a37b6c74b4c
branches: trunk
changeset: 824734:8a37b6c74b4c
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Jun 16 04:41:02 2017 +0000
description:
Test routing messages emitted on operations of ARP/NDP entries
diffstat:
tests/net/arp/t_arp.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++++++-
tests/net/ndp/t_ndp.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 145 insertions(+), 2 deletions(-)
diffs (185 lines):
diff -r 1d85cfbcdd24 -r 8a37b6c74b4c tests/net/arp/t_arp.sh
--- a/tests/net/arp/t_arp.sh Fri Jun 16 04:40:16 2017 +0000
+++ b/tests/net/arp/t_arp.sh Fri Jun 16 04:41:02 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_arp.sh,v 1.22 2016/11/25 08:51:16 ozaki-r Exp $
+# $NetBSD: t_arp.sh,v 1.23 2017/06/16 04:41:02 ozaki-r Exp $
#
# Copyright (c) 2015 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -598,6 +598,77 @@
cleanup
}
+arp_rtm_head()
+{
+
+ atf_set "descr" "Tests for routing messages on operations of ARP entries"
+ atf_set "require.progs" "rump_server"
+}
+
+arp_rtm_body()
+{
+ local arp_keep=5
+ local macaddr_src= macaddr_dst=
+ local file=./tmp
+ local pid= str=
+
+ rump_server_start $SOCKSRC
+ rump_server_start $SOCKDST
+
+ setup_dst_server
+ setup_src_server $arp_keep
+
+ macaddr_src=$(get_macaddr $SOCKSRC shmif0)
+ macaddr_dst=$(get_macaddr $SOCKDST shmif0)
+
+ export RUMP_SERVER=$SOCKSRC
+
+ # Test ping and a resulting routing message (RTM_ADD)
+ rump.route -n monitor -c 1 > $file &
+ pid=$?
+ sleep 1
+ atf_check -s exit:0 -o ignore rump.ping -n -w 1 -c 1 $IP4DST
+ wait $pid
+ $DEBUG && cat $file
+
+ str="RTM_ADD.+<UP,HOST,DONE,LLINFO,CLONED>"
+ atf_check -s exit:0 -o match:"$str" cat $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" cat $file
+ str="$IP4DST link#2 $macaddr_src $IP4SRC"
+ atf_check -s exit:0 -o match:"$str" cat $file
+
+ # Test arp -d and resulting routing messages (RTM_GET and RTM_DELETE)
+ rump.route -n monitor -c 2 > $file &
+ pid=$?
+ sleep 1
+ atf_check -s exit:0 -o ignore rump.arp -d $IP4DST
+ wait $pid
+ $DEBUG && cat $file
+
+ str="RTM_GET.+<UP,DONE,LLINFO>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="$IP4DST $macaddr_dst $macaddr_src $IP4SRC"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="RTM_DELETE.+<UP,DONE,LLINFO>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+ str="$IP4DST $macaddr_dst $macaddr_src $IP4SRC"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+
+ rump_server_destroy_ifaces
+}
+
+arp_rtm_cleanup()
+{
+
+ $DEBUG && dump
+ cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case arp_cache_expiration_5s
@@ -609,4 +680,5 @@
atf_add_test_case arp_proxy_arp_pubproxy
atf_add_test_case arp_link_activation
atf_add_test_case arp_static
+ atf_add_test_case arp_rtm
}
diff -r 1d85cfbcdd24 -r 8a37b6c74b4c tests/net/ndp/t_ndp.sh
--- a/tests/net/ndp/t_ndp.sh Fri Jun 16 04:40:16 2017 +0000
+++ b/tests/net/ndp/t_ndp.sh Fri Jun 16 04:41:02 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_ndp.sh,v 1.19 2017/05/26 01:14:38 ozaki-r Exp $
+# $NetBSD: t_ndp.sh,v 1.20 2017/06/16 04:41:02 ozaki-r Exp $
#
# Copyright (c) 2015 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -396,6 +396,76 @@
cleanup
}
+ndp_rtm_head()
+{
+
+ atf_set "descr" "Tests for routing messages on operations of ARP entries"
+ atf_set "require.progs" "rump_server"
+}
+
+ndp_rtm_body()
+{
+ local macaddr_src= macaddr_dst=
+ local file=./tmp
+ local pid= str=
+
+ rump_server_start $SOCKSRC netinet6
+ rump_server_start $SOCKDST netinet6
+
+ setup_dst_server
+ setup_src_server
+
+ macaddr_src=$(get_macaddr $SOCKSRC shmif0)
+ macaddr_dst=$(get_macaddr $SOCKDST shmif0)
+
+ export RUMP_SERVER=$SOCKSRC
+
+ # Test ping and a resulting routing message (RTM_ADD)
+ rump.route -n monitor -c 1 > $file &
+ pid=$?
+ sleep 1
+ atf_check -s exit:0 -o ignore rump.ping6 -n -X 1 -c 1 $IP6DST
+ wait $pid
+ $DEBUG && cat $file
+
+ str="RTM_ADD.+<UP,HOST,DONE,LLINFO,CLONED>"
+ atf_check -s exit:0 -o match:"$str" cat $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" cat $file
+ str="$IP6DST link#2 $macaddr_src $IP6SRC"
+ atf_check -s exit:0 -o match:"$str" cat $file
+
+ # Test ndp -d and resulting routing messages (RTM_GET and RTM_DELETE)
+ rump.route -n monitor -c 2 > $file &
+ pid=$?
+ sleep 1
+ atf_check -s exit:0 -o ignore rump.ndp -d $IP6DST
+ wait $pid
+ $DEBUG && cat $file
+
+ str="RTM_GET.+<UP,DONE,LLINFO>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="$IP6DST $macaddr_dst $macaddr_src $IP6SRC"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_GET $file
+ str="RTM_DELETE.+<UP,DONE,LLINFO>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+ str="<DST,GATEWAY,IFP,IFA>"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+ str="$IP6DST $macaddr_dst $macaddr_src $IP6SRC"
+ atf_check -s exit:0 -o match:"$str" grep -A 3 RTM_DELETE $file
+
+ rump_server_destroy_ifaces
+}
+
+ndp_rtm_cleanup()
+{
+
+ $DEBUG && dump
+ cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case ndp_cache_expiration
@@ -403,4 +473,5 @@
atf_add_test_case ndp_cache_overwriting
atf_add_test_case ndp_neighborgcthresh
atf_add_test_case ndp_link_activation
+ atf_add_test_case ndp_rtm
}
Home |
Main Index |
Thread Index |
Old Index