Module Name:    src
Committed By:   pooka
Date:           Tue Dec 14 11:03:17 UTC 2010

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/net/icmp: Makefile
Added Files:
        src/tests/net/icmp: t_ping2.sh

Log Message:
Add another version of the simple ping test, this time written as a
shell script and using rump_server, rump.ifconfig and rump.ping.

XXX: uses rump_allserver for now, though, since i noticed a problem
where the rump kernel syscall vector does not get updated for
dlopen()'d libraries (and hence if you dlopen librumpnet.so, socket()
still gives ENOSYS).  Me be fixink it later.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/net/icmp/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/icmp/t_ping2.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.174 src/distrib/sets/lists/tests/mi:1.175
--- src/distrib/sets/lists/tests/mi:1.174	Tue Dec 14 10:02:02 2010
+++ src/distrib/sets/lists/tests/mi	Tue Dec 14 11:03:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.174 2010/12/14 10:02:02 skrll Exp $
+# $NetBSD: mi,v 1.175 2010/12/14 11:03:17 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1628,6 +1628,7 @@
 ./usr/tests/net/icmp/Atffile			tests-net-tests		atf
 ./usr/tests/net/icmp/t_forward		tests-net-tests		atf
 ./usr/tests/net/icmp/t_ping		tests-net-tests		atf
+./usr/tests/net/icmp/t_ping2		tests-net-tests		atf
 ./usr/tests/net/if			tests-net-tests
 ./usr/tests/net/if/Atffile			tests-net-tests		atf
 ./usr/tests/net/if/t_compat		tests-net-tests		atf

Index: src/tests/net/icmp/Makefile
diff -u src/tests/net/icmp/Makefile:1.2 src/tests/net/icmp/Makefile:1.3
--- src/tests/net/icmp/Makefile:1.2	Mon Aug  9 15:08:43 2010
+++ src/tests/net/icmp/Makefile	Tue Dec 14 11:03:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2010/08/09 15:08:43 pooka Exp $
+# $NetBSD: Makefile,v 1.3 2010/12/14 11:03:17 pooka Exp $
 #
 
 .include <bsd.own.mk>
@@ -8,6 +8,8 @@
 TESTS_C=	t_forward
 TESTS_C+=	t_ping
 
+TESTS_SH=	t_ping2
+
 LDADD+=		-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet
 LDADD+=		-lrump -lrumpuser -lpthread
 

Added files:

Index: src/tests/net/icmp/t_ping2.sh
diff -u /dev/null src/tests/net/icmp/t_ping2.sh:1.1
--- /dev/null	Tue Dec 14 11:03:17 2010
+++ src/tests/net/icmp/t_ping2.sh	Tue Dec 14 11:03:17 2010
@@ -0,0 +1,75 @@
+#	$NetBSD: t_ping2.sh,v 1.1 2010/12/14 11:03:17 pooka Exp $
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+atf_test_case basic cleanup
+basic_head()
+{
+
+	atf_set "descr" "Checks that a simple ping works"
+}
+
+docfg ()
+{
+
+	sock=${1}
+	addr=${2}
+
+	atf-check -s exit:0 \
+	    env RUMP_SERVER=${sock} rump.ifconfig shmif0 create
+	atf-check -s exit:0 \
+	    env RUMP_SERVER=${sock} rump.ifconfig shmif0 linkstr bus
+	atf-check -s exit:0 \
+	    env RUMP_SERVER=${sock} rump.ifconfig shmif0 inet ${addr}
+}
+
+basic_body()
+{
+
+	atf-check -s exit:0 rump_allserver unix://commsock1
+	atf-check -s exit:0 rump_allserver unix://commsock2
+
+	docfg unix://commsock1 1.2.3.4
+	docfg unix://commsock2 1.2.3.5
+
+	atf-check -s exit:0 -o ignore \
+	    env RUMP_SERVER=unix://commsock1 rump.ping -c 1 1.2.3.5
+	atf-check -s exit:0 -o ignore \
+	    env RUMP_SERVER=unix://commsock2 rump.ping -c 1 1.2.3.5
+}
+
+basic_cleanup()
+{
+
+	env RUMP_SERVER=unix://commsock1 rump.halt
+	env RUMP_SERVER=unix://commsock2 rump.halt
+}
+
+atf_init_test_cases()
+{
+
+	atf_add_test_case basic
+}

Reply via email to