Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add another version of the simple ping test, this time writt...
details: https://anonhg.NetBSD.org/src/rev/0cdaf0539b83
branches: trunk
changeset: 759649:0cdaf0539b83
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Dec 14 11:03:17 2010 +0000
description:
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.
diffstat:
distrib/sets/lists/tests/mi | 3 +-
tests/net/icmp/Makefile | 4 +-
tests/net/icmp/t_ping2.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 80 insertions(+), 2 deletions(-)
diffs (114 lines):
diff -r 23e6f353a130 -r 0cdaf0539b83 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Tue Dec 14 10:51:51 2010 +0000
+++ b/distrib/sets/lists/tests/mi Tue Dec 14 11:03:17 2010 +0000
@@ -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
diff -r 23e6f353a130 -r 0cdaf0539b83 tests/net/icmp/Makefile
--- a/tests/net/icmp/Makefile Tue Dec 14 10:51:51 2010 +0000
+++ b/tests/net/icmp/Makefile Tue Dec 14 11:03:17 2010 +0000
@@ -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
diff -r 23e6f353a130 -r 0cdaf0539b83 tests/net/icmp/t_ping2.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/net/icmp/t_ping2.sh Tue Dec 14 11:03:17 2010 +0000
@@ -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
+}
Home |
Main Index |
Thread Index |
Old Index