Module Name:    src
Committed By:   ozaki-r
Date:           Wed Jul  1 08:33:31 UTC 2015

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/net/if: Makefile
Added Files:
        src/tests/net/if: t_ifconfig.sh

Log Message:
Add tests of interface creation/destruction


To generate a diff of this commit:
cvs rdiff -u -r1.630 -r1.631 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/if/t_ifconfig.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.630 src/distrib/sets/lists/tests/mi:1.631
--- src/distrib/sets/lists/tests/mi:1.630	Wed Jun 24 01:39:24 2015
+++ src/distrib/sets/lists/tests/mi	Wed Jul  1 08:33:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.630 2015/06/24 01:39:24 matt Exp $
+# $NetBSD: mi,v 1.631 2015/07/01 08:33:31 ozaki-r Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3138,6 +3138,7 @@
 ./usr/tests/net/if/ifconf			tests-net-tests		atf,rump
 ./usr/tests/net/if/t_compat			tests-net-tests		atf,rump
 ./usr/tests/net/if/t_ifconf			tests-net-tests		atf,rump
+./usr/tests/net/if/t_ifconfig			tests-net-tests		atf,rump
 ./usr/tests/net/if_bridge			tests-net-tests		compattestfile,atf
 ./usr/tests/net/if_bridge/Atffile		tests-net-tests		atf,rump
 ./usr/tests/net/if_bridge/Kyuafile		tests-net-tests		atf,rump,kyua

Index: src/tests/net/if/Makefile
diff -u src/tests/net/if/Makefile:1.4 src/tests/net/if/Makefile:1.5
--- src/tests/net/if/Makefile:1.4	Mon Dec  8 07:34:31 2014
+++ src/tests/net/if/Makefile	Wed Jul  1 08:33:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2014/12/08 07:34:31 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.5 2015/07/01 08:33:31 ozaki-r Exp $
 #
 
 .include <bsd.own.mk>
@@ -7,6 +7,7 @@ TESTSDIR=	${TESTSBASE}/net/if
 
 TESTS_C=	t_compat
 TESTS_SH=	t_ifconf
+TESTS_SH+=	t_ifconfig
 
 PROGS=		ifconf
 MAN.ifconf=	# empty

Added files:

Index: src/tests/net/if/t_ifconfig.sh
diff -u /dev/null src/tests/net/if/t_ifconfig.sh:1.1
--- /dev/null	Wed Jul  1 08:33:31 2015
+++ src/tests/net/if/t_ifconfig.sh	Wed Jul  1 08:33:31 2015
@@ -0,0 +1,78 @@
+# $NetBSD: t_ifconfig.sh,v 1.1 2015/07/01 08:33:31 ozaki-r Exp $
+#
+# Copyright (c) 2015 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.
+#
+
+RUMP_SERVER1=unix://./r1
+
+RUMP_FLAGS=\
+"-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
+
+atf_test_case create_destroy cleanup
+create_destroy_head()
+{
+
+	atf_set "descr" "tests of ifconfig create and destroy"
+	atf_set "require.progs" "rump_server"
+}
+
+create_destroy_body()
+{
+	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
+
+	export RUMP_SERVER=${RUMP_SERVER1}
+
+	# Create and destroy (no address)
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 destroy
+
+	# Create and destroy (with an IPv4 address)
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+	atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24
+	atf_check -s exit:0 rump.ifconfig shmif0 up
+	atf_check -s exit:0 rump.ifconfig shmif0 destroy
+
+	# Create and destroy (with an IPv6 address)
+	atf_check -s exit:0 rump.ifconfig shmif0 create
+	atf_check -s exit:0 rump.ifconfig shmif0 linkstr shmbus
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
+	atf_check -s exit:0 rump.ifconfig shmif0 up
+	atf_check -s exit:0 rump.ifconfig shmif0 destroy
+
+	unset RUMP_SERVER
+}
+
+create_destroy_cleanup()
+{
+
+	RUMP_SERVER=${RUMP_SERVER1} rump.halt
+}
+
+atf_init_test_cases()
+{
+
+	atf_add_test_case create_destroy
+}

Reply via email to