CVS commit: src/tests/net/if

2017-03-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Mar 16 09:43:56 UTC 2017

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Add a test case of ifconfig 

I don't know if  is expected to be accepted instead of
an interface name. Please update the test case if the behavior is
just a bug and ifconfig gets fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.17 src/tests/net/if/t_ifconfig.sh:1.18
--- src/tests/net/if/t_ifconfig.sh:1.17	Fri Feb 17 00:51:52 2017
+++ src/tests/net/if/t_ifconfig.sh	Thu Mar 16 09:43:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.17 2017/02/17 00:51:52 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.18 2017/03/16 09:43:56 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -449,6 +449,35 @@ ifconfig_up_down_ipv6_cleanup()
 	cleanup
 }
 
+atf_test_case ifconfig_number cleanup
+ifconfig_number_head()
+{
+	atf_set "descr" "tests of passing a number (if_index) to ifconfig"
+	atf_set "require.progs" "rump_server"
+}
+
+ifconfig_number_body()
+{
+
+	rump_server_start $RUMP_SERVER1
+	rump_server_add_iface $RUMP_SERVER1 shmif0 bus1
+
+	export RUMP_SERVER=$RUMP_SERVER1
+	atf_check -s not-exit:0 -e match:'Device not configured' rump.ifconfig 0
+	atf_check -s exit:0 rump.ifconfig 1 # lo0
+	atf_check -s exit:0 rump.ifconfig 2 # shmif0
+	atf_check -s not-exit:0 -e match:'Device not configured' rump.ifconfig 3
+
+	rump_server_destroy_ifaces
+}
+
+ifconfig_number_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
 atf_init_test_cases()
 {
 
@@ -457,4 +486,5 @@ atf_init_test_cases()
 	atf_add_test_case ifconfig_parameters
 	atf_add_test_case ifconfig_up_down_ipv4
 	atf_add_test_case ifconfig_up_down_ipv6
+	atf_add_test_case ifconfig_number
 }



CVS commit: src/tests/net/if

2017-02-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Feb 17 00:51:53 UTC 2017

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Make the test more stable


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.16 src/tests/net/if/t_ifconfig.sh:1.17
--- src/tests/net/if/t_ifconfig.sh:1.16	Tue Feb 14 08:43:06 2017
+++ src/tests/net/if/t_ifconfig.sh	Fri Feb 17 00:51:52 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.16 2017/02/14 08:43:06 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.17 2017/02/17 00:51:52 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -343,10 +343,10 @@ ifconfig_up_down_common()
 	# work for both IPv4 and IPv6
 	if [ $family = inet6 ]; then
 		atf_check -s exit:0 -o ignore \
-		rump.sysctl -w net.inet6.ip6.dad_count=3
+		rump.sysctl -w net.inet6.ip6.dad_count=5
 	else
 		atf_check -s exit:0 -o ignore \
-		rump.sysctl -w net.inet.ip.dad_count=3
+		rump.sysctl -w net.inet.ip.dad_count=5
 	fi
 
 	#



CVS commit: src/tests/net/if

2017-02-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb 14 08:43:06 UTC 2017

Modified Files:
src/tests/net/if: Makefile t_ifconfig.sh

Log Message:
Add tests for ifconfig up/down


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/if/Makefile
cvs rdiff -u -r1.15 -r1.16 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/tests/net/if/Makefile
diff -u src/tests/net/if/Makefile:1.6 src/tests/net/if/Makefile:1.7
--- src/tests/net/if/Makefile:1.6	Mon Aug  8 14:54:27 2016
+++ src/tests/net/if/Makefile	Tue Feb 14 08:43:06 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2016/08/08 14:54:27 pgoyette Exp $
+# $NetBSD: Makefile,v 1.7 2017/02/14 08:43:06 ozaki-r Exp $
 #
 
 .include 
@@ -6,8 +6,10 @@
 TESTSDIR=	${TESTSBASE}/net/if
 
 TESTS_C=	t_compat
-TESTS_SH=	t_ifconf
-TESTS_SH+=	t_ifconfig
+.for name in ifconf ifconfig
+TESTS_SH+=		t_${name}
+TESTS_SH_SRC_t_${name}=	../net_common.sh t_${name}.sh
+.endfor
 
 PROGS=		ifconf
 MAN.ifconf=	# empty

Index: src/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.15 src/tests/net/if/t_ifconfig.sh:1.16
--- src/tests/net/if/t_ifconfig.sh:1.15	Fri Jan 20 08:35:33 2017
+++ src/tests/net/if/t_ifconfig.sh	Tue Feb 14 08:43:06 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.15 2017/01/20 08:35:33 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.16 2017/02/14 08:43:06 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -324,10 +324,137 @@ ifconfig_parameters_cleanup()
 	env RUMP_SERVER=${RUMP_SERVER2} rump.halt
 }
 
+ifconfig_up_down_common()
+{
+	local family=$1
+	local ip=$2
+
+	if [ $family = inet6 ]; then
+		rump_server_start $RUMP_SERVER1 netinet6
+	else
+		rump_server_start $RUMP_SERVER1
+	fi
+	rump_server_add_iface $RUMP_SERVER1 shmif0 bus1
+
+	export RUMP_SERVER=$RUMP_SERVER1
+	rump.ifconfig shmif0
+
+	# Set the same number of trials to make the following test
+	# work for both IPv4 and IPv6
+	if [ $family = inet6 ]; then
+		atf_check -s exit:0 -o ignore \
+		rump.sysctl -w net.inet6.ip6.dad_count=3
+	else
+		atf_check -s exit:0 -o ignore \
+		rump.sysctl -w net.inet.ip.dad_count=3
+	fi
+
+	#
+	# Assign an address and up the interface at once
+	#
+	atf_check -s exit:0 rump.ifconfig shmif0 $family $ip/24 up
+	# UP
+	atf_check -s exit:0 \
+	-o match:'shmif0.*UP.*RUNNING' rump.ifconfig shmif0
+	# The address is TENTATIVE
+	atf_check -s exit:0 \
+	-o match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+	# Waiting for DAD completion
+	atf_check -s exit:0 rump.ifconfig -w 10
+	# The address left TENTATIVE
+	atf_check -s exit:0 \
+	-o not-match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+
+	#
+	# ifconfig down
+	#
+	atf_check -s exit:0 rump.ifconfig shmif0 down
+	atf_check -s exit:0 \
+	-o not-match:'shmif0.*UP.*RUNNING' rump.ifconfig shmif0
+	# The address becomes DETATCHED
+	atf_check -s exit:0 \
+	-o match:"$ip.*DETACHED" rump.ifconfig shmif0
+	# ifconfig up
+	atf_check -s exit:0 rump.ifconfig shmif0 up
+	# The address becomes TENTATIVE
+	atf_check -s exit:0 \
+	-o match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+	# Waiting for DAD completion
+	atf_check -s exit:0 rump.ifconfig -w 10
+	# The address left TENTATIVE
+	atf_check -s exit:0 \
+	-o not-match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+
+	# Clean up
+	atf_check -s exit:0 rump.ifconfig shmif0 $family $ip delete
+
+	#
+	# Assign an address
+	#
+	atf_check -s exit:0 rump.ifconfig shmif0 $family $ip/24
+	# UP automatically
+	atf_check -s exit:0 \
+	-o match:'shmif0.*UP.*RUNNING' rump.ifconfig shmif0
+	# Need some delay
+	sleep 1
+	# The IP becomes TENTATIVE
+	atf_check -s exit:0 \
+	-o match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+	# Waiting for DAD completion
+	atf_check -s exit:0 rump.ifconfig -w 10
+	# The address left TENTATIVE
+	atf_check -s exit:0 \
+	-o not-match:"$ip.*TENTATIVE" rump.ifconfig shmif0
+
+	rump_server_destroy_ifaces
+}
+
+atf_test_case ifconfig_up_down_ipv4 cleanup
+ifconfig_up_down_ipv4_head()
+{
+	atf_set "descr" "tests of interface up/down (IPv4)"
+	atf_set "require.progs" "rump_server"
+}
+
+ifconfig_up_down_ipv4_body()
+{
+
+	ifconfig_up_down_common inet 10.0.0.1
+}
+
+ifconfig_up_down_ipv4_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
+atf_test_case ifconfig_up_down_ipv6 cleanup
+ifconfig_up_down_ipv6_head()
+{
+	atf_set "descr" "tests of interface up/down (IPv6)"
+	atf_set "require.progs" "rump_server"
+}
+
+ifconfig_up_down_ipv6_body()
+{
+
+	ifconfig_up_down_common inet6 fc00::1
+}
+
+ifconfig_up_down_ipv6_cleanup()
+{
+
+	$DEBUG && dump
+	cleanup
+}
+
 atf_init_test_cases()
 {
 
 	atf_add_test_case ifconfig_create_destroy
 	atf_add_test_case ifconfig_options
 	atf_add_test_case ifconfig_parameters
+	atf_add_test_case ifconfig_up_down_ipv4
+	atf_add_test_case ifconfig_up_down_ipv6
 }



CVS commit: src/tests/net/if

2016-11-12 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Nov 12 15:12:59 UTC 2016

Modified Files:
src/tests/net/if: t_compat.c

Log Message:
Delete inappropriate \n from atd_tc_expect_fail() message


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if/t_compat.c

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/t_compat.c
diff -u src/tests/net/if/t_compat.c:1.3 src/tests/net/if/t_compat.c:1.4
--- src/tests/net/if/t_compat.c:1.3	Mon Nov  7 21:46:21 2016
+++ src/tests/net/if/t_compat.c	Sat Nov 12 15:12:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_compat.c,v 1.3 2016/11/07 21:46:21 pgoyette Exp $	*/
+/*	$NetBSD: t_compat.c,v 1.4 2016/11/12 15:12:59 kre Exp $	*/
 
 #include 
 #include 
@@ -65,7 +65,7 @@ ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
 	sprintf(ifreq.ifr_name, "shmif%d", ifnum);
 	netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
 
-	atf_tc_expect_fail("PR kern/51610: rump does not include COMPAT_43\n");
+	atf_tc_expect_fail("PR kern/51610: rump does not include COMPAT_43");
 
 	/* query kernel for iface bcast */
 RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));



CVS commit: src/tests/net/if

2016-11-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Nov  7 21:46:21 UTC 2016

Modified Files:
src/tests/net/if: t_compat.c

Log Message:
Add PR number to the expected-fail message


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/net/if/t_compat.c

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/t_compat.c
diff -u src/tests/net/if/t_compat.c:1.2 src/tests/net/if/t_compat.c:1.3
--- src/tests/net/if/t_compat.c:1.2	Mon Nov  7 02:59:29 2016
+++ src/tests/net/if/t_compat.c	Mon Nov  7 21:46:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_compat.c,v 1.2 2016/11/07 02:59:29 pgoyette Exp $	*/
+/*	$NetBSD: t_compat.c,v 1.3 2016/11/07 21:46:21 pgoyette Exp $	*/
 
 #include 
 #include 
@@ -65,7 +65,7 @@ ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
 	sprintf(ifreq.ifr_name, "shmif%d", ifnum);
 	netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
 
-	atf_tc_expect_fail("rump does not include COMPAT_43");
+	atf_tc_expect_fail("PR kern/51610: rump does not include COMPAT_43\n");
 
 	/* query kernel for iface bcast */
 RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));



CVS commit: src/tests/net/if

2016-11-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Nov  7 02:59:29 UTC 2016

Modified Files:
src/tests/net/if: t_compat.c

Log Message:
Mark this test as "expected failure" since rump doesn't include the
COMPAT_43 code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if/t_compat.c

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/t_compat.c
diff -u src/tests/net/if/t_compat.c:1.1 src/tests/net/if/t_compat.c:1.2
--- src/tests/net/if/t_compat.c:1.1	Sun Nov  7 19:53:42 2010
+++ src/tests/net/if/t_compat.c	Mon Nov  7 02:59:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_compat.c,v 1.1 2010/11/07 19:53:42 pooka Exp $	*/
+/*	$NetBSD: t_compat.c,v 1.2 2016/11/07 02:59:29 pgoyette Exp $	*/
 
 #include 
 #include 
@@ -65,6 +65,8 @@ ATF_TC_BODY(OOSIOCGIFBRDADDR, tc)
 	sprintf(ifreq.ifr_name, "shmif%d", ifnum);
 	netcfg_rump_if(ifreq.ifr_name, "1.7.64.10", "255.255.0.0");
 
+	atf_tc_expect_fail("rump does not include COMPAT_43");
+
 	/* query kernel for iface bcast */
 RL(fd = rump_sys_socket(AF_INET, SOCK_DGRAM, 0));
 RL(rump_sys_ioctl(fd, OOSIOCGIFBRDADDR, &ifreq));



CVS commit: src/tests/net/if

2016-10-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Oct  1 22:15:04 UTC 2016

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Don't expect ping to complain about sending to a local address
assigned to an interface that's down - instead it just attempts
to send, and the interface never responds (as it would if it were
a remote address).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.13 src/tests/net/if/t_ifconfig.sh:1.14
--- src/tests/net/if/t_ifconfig.sh:1.13	Sat Oct  1 15:35:22 2016
+++ src/tests/net/if/t_ifconfig.sh	Sat Oct  1 22:15:04 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.13 2016/10/01 15:35:22 roy Exp $
+# $NetBSD: t_ifconfig.sh,v 1.14 2016/10/01 22:15:04 kre Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -230,7 +230,7 @@ ifconfig_parameters_body()
 	rump.ifconfig shmif0
 	# down, up
 	atf_check -s exit:0 rump.ifconfig shmif0 down
-	atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 \
+	atf_check -s not-exit:0 -o ignore -e ignore rump.ping -c 1 \
 	-w $TIMEOUT -n 192.168.0.2
 	atf_check -s exit:0 rump.ifconfig shmif0 up
 	atf_check -s exit:0 rump.ifconfig -w 10



CVS commit: src/tests/net/if

2016-10-01 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Oct  1 15:35:22 UTC 2016

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Adjust tests to new output. Wait for DaD to finish before pinging.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.12 src/tests/net/if/t_ifconfig.sh:1.13
--- src/tests/net/if/t_ifconfig.sh:1.12	Wed Sep 14 16:18:31 2016
+++ src/tests/net/if/t_ifconfig.sh	Sat Oct  1 15:35:22 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.12 2016/09/14 16:18:31 christos Exp $
+# $NetBSD: t_ifconfig.sh,v 1.13 2016/10/01 15:35:22 roy Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -233,13 +233,14 @@ ifconfig_parameters_body()
 	atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 \
 	-w $TIMEOUT -n 192.168.0.2
 	atf_check -s exit:0 rump.ifconfig shmif0 up
+	atf_check -s exit:0 rump.ifconfig -w 10
 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT -n 192.168.0.2
 
 	# alias
 	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
-	atf_check -s exit:0 -o match:'alias 192.168.1.1' rump.ifconfig shmif0
+	atf_check -s exit:0 -o match:'192.168.1.1/24' rump.ifconfig shmif0
 	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 -alias
-	atf_check -s exit:0 -o not-match:'192.168.1.1' rump.ifconfig shmif0
+	atf_check -s exit:0 -o not-match:'192.168.1.1/24' rump.ifconfig shmif0
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2
 	atf_check -s exit:0 -o match:'fc00::1' rump.ifconfig shmif0 inet6



CVS commit: src/tests/net/if

2016-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 14 16:18:31 UTC 2016

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Ignore case in deprecated/anycast


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.11 src/tests/net/if/t_ifconfig.sh:1.12
--- src/tests/net/if/t_ifconfig.sh:1.11	Wed Aug 10 18:30:02 2016
+++ src/tests/net/if/t_ifconfig.sh	Wed Sep 14 12:18:31 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.11 2016/08/10 22:30:02 kre Exp $
+# $NetBSD: t_ifconfig.sh,v 1.12 2016/09/14 16:18:31 christos Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,6 +34,9 @@ RUMP_FLAGS="${RUMP_FLAGS} -lrumpdev"
 
 TIMEOUT=3
 
+anycast="[Aa][Nn][Yy][Cc][Aa][Ss][Tt]"
+deprecated="[Dd][Ee][Pp][Rr][Ee][Cc][Aa][Tt][Ee][Dd]"
+
 atf_test_case ifconfig_create_destroy cleanup
 ifconfig_create_destroy_head()
 {
@@ -290,22 +293,22 @@ ifconfig_parameters_body()
 
 	# anycast
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
-	atf_check -s exit:0 -o match:'fc00::2.+anycast' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o match:"fc00::2.+$anycast" rump.ifconfig shmif0 inet6
 
 	# deprecated
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
 	# Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
 	interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
 	atf_check -s exit:0 sleep $((interval + 1))
-	atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
-	atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
 
 	# pltime
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 pltime 3
-	atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o not-match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
 	atf_check -s exit:0 sleep 5
-	atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o match:"fc00::3.+$deprecated" rump.ifconfig shmif0 inet6
 
 	# eui64
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00:1::0 eui64



CVS commit: src/tests/net/if

2016-08-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Aug 10 22:30:02 UTC 2016

Modified Files:
src/tests/net/if: t_ifconf.sh t_ifconfig.sh

Log Message:
+ -lrumpdev


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/net/if/t_ifconf.sh
cvs rdiff -u -r1.10 -r1.11 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/tests/net/if/t_ifconf.sh
diff -u src/tests/net/if/t_ifconf.sh:1.2 src/tests/net/if/t_ifconf.sh:1.3
--- src/tests/net/if/t_ifconf.sh:1.2	Thu Apr 28 01:57:45 2016
+++ src/tests/net/if/t_ifconf.sh	Wed Aug 10 22:30:02 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconf.sh,v 1.2 2016/04/28 01:57:45 ozaki-r Exp $
+# $NetBSD: t_ifconf.sh,v 1.3 2016/08/10 22:30:02 kre Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,7 +28,7 @@
 RUMP_SERVER1=unix://./r1
 
 RUMP_FLAGS=\
-"-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif"
+"-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpdev"
 
 atf_test_case basic cleanup
 basic_head()

Index: src/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.10 src/tests/net/if/t_ifconfig.sh:1.11
--- src/tests/net/if/t_ifconfig.sh:1.10	Tue Jun 21 05:04:16 2016
+++ src/tests/net/if/t_ifconfig.sh	Wed Aug 10 22:30:02 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.10 2016/06/21 05:04:16 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.11 2016/08/10 22:30:02 kre Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,6 +30,7 @@ RUMP_SERVER2=unix://./r2
 
 RUMP_FLAGS=\
 "-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
+RUMP_FLAGS="${RUMP_FLAGS} -lrumpdev"
 
 TIMEOUT=3
 



CVS commit: src/tests/net/if

2016-08-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Aug  8 14:54:28 UTC 2016

Modified Files:
src/tests/net/if: Makefile

Log Message:
This one needs librump dev (and librumpvfs) too


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/net/if/Makefile

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/Makefile
diff -u src/tests/net/if/Makefile:1.5 src/tests/net/if/Makefile:1.6
--- src/tests/net/if/Makefile:1.5	Wed Jul  1 08:33:31 2015
+++ src/tests/net/if/Makefile	Mon Aug  8 14:54:27 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2015/07/01 08:33:31 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.6 2016/08/08 14:54:27 pgoyette Exp $
 #
 
 .include 
@@ -14,6 +14,6 @@ MAN.ifconf=	# empty
 BINDIR.ifconf=	${TESTSDIR}
 
 LDADD.t_compat=		-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump
-LDADD.t_compat+=	-lrumpuser -lrump -lpthread
+LDADD.t_compat+=	-lrumpuser -lrump -lpthread -lrumpdev -lrumpvfs
 
 .include 



CVS commit: src/tests/net/if

2016-04-27 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Apr 28 01:57:45 UTC 2016

Modified Files:
src/tests/net/if: t_ifconf.sh

Log Message:
Don't depend on the order of interfaces

Instead add tests of querying varying number of interfaces
and tests of checking if removing interfaces is reflected.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if/t_ifconf.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/t_ifconf.sh
diff -u src/tests/net/if/t_ifconf.sh:1.1 src/tests/net/if/t_ifconf.sh:1.2
--- src/tests/net/if/t_ifconf.sh:1.1	Mon Dec  8 04:23:03 2014
+++ src/tests/net/if/t_ifconf.sh	Thu Apr 28 01:57:45 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconf.sh,v 1.1 2014/12/08 04:23:03 ozaki-r Exp $
+# $NetBSD: t_ifconf.sh,v 1.2 2016/04/28 01:57:45 ozaki-r Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -66,8 +66,22 @@ basic_body()
 	atf_check -s exit:0 rump.ifconfig shmif0 192.168.0.1/24
 	atf_check -s exit:0 -o match:'^5$' "$ifconf" total
 
-	# Get only first two entries (lo0's)
-	atf_check -s exit:0 -o not-match:'shmif' "$ifconf" list 2
+	# Vary the number of requesting interfaces
+	atf_check -s exit:0 -o match:1 -x "$ifconf list 1 | wc -l"
+	atf_check -s exit:0 -o match:2 -x "$ifconf list 2 | wc -l"
+	atf_check -s exit:0 -o match:3 -x "$ifconf list 3 | wc -l"
+	atf_check -s exit:0 -o match:4 -x "$ifconf list 4 | wc -l"
+	atf_check -s exit:0 -o match:5 -x "$ifconf list 5 | wc -l"
+	atf_check -s exit:0 -o match:5 -x "$ifconf list 6 | wc -l"
+
+	# Check if removing an interface is reflected
+	atf_check -s exit:0 rump.ifconfig shmif0 destroy
+	atf_check -s exit:0 -o match:'^3$' "$ifconf" total
+	atf_check -s exit:0 -o not-match:'shmif0' "$ifconf" list
+	atf_check -s exit:0 -o match:1 -x "$ifconf list 1 | wc -l"
+	atf_check -s exit:0 -o match:2 -x "$ifconf list 2 | wc -l"
+	atf_check -s exit:0 -o match:3 -x "$ifconf list 3 | wc -l"
+	atf_check -s exit:0 -o match:3 -x "$ifconf list 4 | wc -l"
 
 	unset LD_PRELOAD
 	unset RUMP_SERVER



CVS commit: src/tests/net/if

2016-04-27 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Apr 28 01:20:31 UTC 2016

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Don't depend on the order of interfaces

The kernel guarantees nothing about it.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.8 src/tests/net/if/t_ifconfig.sh:1.9
--- src/tests/net/if/t_ifconfig.sh:1.8	Mon Apr  4 07:37:08 2016
+++ src/tests/net/if/t_ifconfig.sh	Thu Apr 28 01:20:31 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.8 2016/04/04 07:37:08 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.9 2016/04/28 01:20:31 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -160,11 +160,15 @@ options_body()
 
 	# ifconfig -l [-bdsu]
 	#   -l shows only inteface names
-	atf_check -s exit:0 -o match:'lo0 shmif0' rump.ifconfig -l
+	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l
 	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -b
+	atf_check -s exit:0 -o not-match:'lo0' rump.ifconfig -l -b
 	atf_check -s exit:0 -o ignore rump.ifconfig -l -d
-	atf_check -s exit:0 -o match:'lo0 shmif0' rump.ifconfig -l -s
-	atf_check -s exit:0 -o match:'lo0 shmif0' rump.ifconfig -l -u
+	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l -s
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -s
+	atf_check -s exit:0 -o match:'lo0' rump.ifconfig -l -u
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -u
 
 	# ifconfig -s interface
 	#   -s interface exists with 0 / 1 if connected / disconnected



CVS commit: src/tests/net/if

2016-02-29 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Feb 29 08:13:41 UTC 2016

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Add tests deleting active/inactive links


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.6 src/tests/net/if/t_ifconfig.sh:1.7
--- src/tests/net/if/t_ifconfig.sh:1.6	Fri Nov 20 05:05:40 2015
+++ src/tests/net/if/t_ifconfig.sh	Mon Feb 29 08:13:41 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.6 2015/11/20 05:05:40 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.7 2016/02/29 08:13:41 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -247,6 +247,12 @@ parameters_body()
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 delete
 	atf_check -s exit:0 -o not-match:'fc00::1' rump.ifconfig shmif0 inet6
 	atf_check -s exit:0 -o not-match:'fc00::2' rump.ifconfig shmif0 inet6
+	# can delete inactive link
+	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:02
+	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:02 delete
+	# cannot delete active link
+	atf_check -s not-exit:0 -e match:'SIOCDLIFADDR: Device busy' \
+	rump.ifconfig shmif0 link b2:a0:75:00:00:01 delete
 
 	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.1/24
 



CVS commit: src/tests/net/if

2015-11-19 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Nov 20 05:05:40 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Set timeout of ping to reduce execution time


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.5 src/tests/net/if/t_ifconfig.sh:1.6
--- src/tests/net/if/t_ifconfig.sh:1.5	Fri Nov  6 02:54:37 2015
+++ src/tests/net/if/t_ifconfig.sh	Fri Nov 20 05:05:40 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.5 2015/11/06 02:54:37 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.6 2015/11/20 05:05:40 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,6 +31,8 @@ RUMP_SERVER2=unix://./r2
 RUMP_FLAGS=\
 "-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
 
+TIMEOUT=3
+
 atf_test_case create_destroy cleanup
 create_destroy_head()
 {
@@ -119,7 +121,7 @@ options_body()
 	atf_check -s exit:0 -o ignore rump.ifconfig -m shmif0
 	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -N lo0
 	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
-	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT localhost
 	#   -z clears and shows statistics at that point
 	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -z lo0
 	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
@@ -149,7 +151,7 @@ options_body()
 	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -u
 	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
 	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
-	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT localhost
 	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
 	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -a -z
 	atf_check -s exit:0 -o not-match:'2 packets' rump.ifconfig -a -v
@@ -220,9 +222,10 @@ parameters_body()
 	rump.ifconfig shmif0
 	# down, up
 	atf_check -s exit:0 rump.ifconfig shmif0 down
-	atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 -n 192.168.0.2
+	atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 \
+	-w $TIMEOUT -n 192.168.0.2
 	atf_check -s exit:0 rump.ifconfig shmif0 up
-	atf_check -s exit:0 -o ignore rump.ping -c 1 -n 192.168.0.2
+	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT -n 192.168.0.2
 
 	# alias
 	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
@@ -250,7 +253,7 @@ parameters_body()
 	# arp
 	atf_check -s exit:0 rump.ifconfig shmif0 -arp
 	atf_check -s not-exit:0 -o ignore -e ignore \
-	rump.ping -c 1 -n 192.168.0.3
+	rump.ping -c 1 -w $TIMEOUT -n 192.168.0.3
 	atf_check -s exit:0 -o not-match:'192.168.0.3' rump.arp -an
 
 	# netmask



CVS commit: src/tests/net/if

2015-11-05 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Nov  6 02:54:37 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Improve test stability

"deprecated" flag may not be reflected immediately. We need to add some
delay before checking the result.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.4 src/tests/net/if/t_ifconfig.sh:1.5
--- src/tests/net/if/t_ifconfig.sh:1.4	Thu Nov  5 02:57:36 2015
+++ src/tests/net/if/t_ifconfig.sh	Fri Nov  6 02:54:37 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.4 2015/11/05 02:57:36 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.5 2015/11/06 02:54:37 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -192,6 +192,8 @@ parameters_head()
 
 parameters_body()
 {
+	local interval=
+
 	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
 	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
 
@@ -276,6 +278,9 @@ parameters_body()
 
 	# deprecated
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
+	# Not deprecated immediately. Need to wait nd6_timer that does it is scheduled.
+	interval=$(sysctl -n net.inet6.icmp6.nd6_prune)
+	atf_check -s exit:0 sleep $((interval + 1))
 	atf_check -s exit:0 -o match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6
 	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 -deprecated
 	atf_check -s exit:0 -o not-match:'fc00::3.+deprecated' rump.ifconfig shmif0 inet6



CVS commit: src/tests/net/if

2015-11-04 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Nov  5 02:57:36 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Add tests for ifconfig parameters

>From s-yamaguchi@IIJ


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.3 src/tests/net/if/t_ifconfig.sh:1.4
--- src/tests/net/if/t_ifconfig.sh:1.3	Tue Sep 15 09:51:01 2015
+++ src/tests/net/if/t_ifconfig.sh	Thu Nov  5 02:57:36 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.3 2015/09/15 09:51:01 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.4 2015/11/05 02:57:36 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -26,6 +26,7 @@
 #
 
 RUMP_SERVER1=unix://./r1
+RUMP_SERVER2=unix://./r2
 
 RUMP_FLAGS=\
 "-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 -lrumpnet_shmif"
@@ -181,9 +182,127 @@ options_cleanup()
 	env RUMP_SERVER=${RUMP_SERVER1} rump.halt
 }
 
+
+atf_test_case parameters cleanup
+parameters_head()
+{
+	atf_set "descr" "tests of interface parametors"
+	atf_set "require.progs" "rump_server"
+}
+
+parameters_body()
+{
+	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
+	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
+
+	export RUMP_SERVER=${RUMP_SERVER1}
+	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
+	unset RUMP_SERVER
+
+	export RUMP_SERVER=${RUMP_SERVER2}
+	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.2/24
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.3/24 alias
+	atf_check -s exit:0 rump.ifconfig shmif0 up
+	unset RUMP_SERVER
+
+	export RUMP_SERVER=${RUMP_SERVER1}
+
+	# active
+	atf_check -s exit:0 rump.ifconfig shmif0 link b2:a0:75:00:00:01 active
+	atf_check -s exit:0 -o match:'address:.b2:a0:75:00:00:01' \
+	rump.ifconfig shmif0
+	# down, up
+	atf_check -s exit:0 rump.ifconfig shmif0 down
+	atf_check -s ignore -o ignore -e match:'down' rump.ping -c 1 -n 192.168.0.2
+	atf_check -s exit:0 rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o ignore rump.ping -c 1 -n 192.168.0.2
+
+	# alias
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 alias
+	atf_check -s exit:0 -o match:'alias 192.168.1.1' rump.ifconfig shmif0
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1/24 -alias
+	atf_check -s exit:0 -o not-match:'192.168.1.1' rump.ifconfig shmif0
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2
+	atf_check -s exit:0 -o match:'fc00::1' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o match:'fc00::2' rump.ifconfig shmif0 inet6
+
+	# delete
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1 alias
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.1.1 delete
+	atf_check -s exit:0 -o not-match:'192.168.1.1' rump.ifconfig shmif0 inet
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.1 delete
+	atf_check -s exit:0 -o not-match:'192.168.0.1' rump.ifconfig shmif0 inet
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 delete
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 delete
+	atf_check -s exit:0 -o not-match:'fc00::1' rump.ifconfig shmif0 inet6
+	atf_check -s exit:0 -o not-match:'fc00::2' rump.ifconfig shmif0 inet6
+
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 192.168.0.1/24
+
+	# arp
+	atf_check -s exit:0 rump.ifconfig shmif0 -arp
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	rump.ping -c 1 -n 192.168.0.3
+	atf_check -s exit:0 -o not-match:'192.168.0.3' rump.arp -an
+
+	# netmask
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 netmask 255.255.255.0 alias
+	atf_check -s exit:0 -o match:'172.16.0/24' rump.netstat -rn -f inet
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 delete
+
+	# broadcast (does it not work?)
+	atf_check -s exit:0 rump.ifconfig shmif0 inet 172.16.0.1 \
+	broadcast 255.255.255.255 alias
+	atf_check -s exit:0 -o match:'broadcast 255.255.255.255' \
+	rump.ifconfig shmif0 inet
+
+	# metric (external only)
+	atf_check -s exit:0 rump.ifconfig shmif0 metric 10
+	atf_check -s exit:0 rump.ifconfig shmif0 metric 0
+
+	# prefixlen
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::1 prefixlen 70
+	atf_check -s exit:0 -o match:'fc00::/70' rump.netstat -rn -f inet6
+
+	# anycast
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::2 anycast
+	atf_check -s exit:0 -o match:'fc00::2.+anycast' rump.ifconfig shmif0 inet6
+
+	# deprecated
+	atf_check -s exit:0 rump.ifconfig shmif0 inet6 fc00::3 deprecated
+	atf_check -s ex

CVS commit: src/tests/net/if

2015-09-15 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Sep 15 09:51:01 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Improve test stability

ifconfig -a -v after ifconfig -a -z is expected to show '0 packets' for
all interface. However, shmif0 can receive packets between the two
operations. So we have to keep shmif0 down during such tests.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.2 src/tests/net/if/t_ifconfig.sh:1.3
--- src/tests/net/if/t_ifconfig.sh:1.2	Thu Sep  3 10:22:52 2015
+++ src/tests/net/if/t_ifconfig.sh	Tue Sep 15 09:51:01 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.2 2015/09/03 10:22:52 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.3 2015/09/15 09:51:01 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -149,8 +149,11 @@ options_body()
 	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
 	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
 	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
 	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -a -z
 	atf_check -s exit:0 -o not-match:'2 packets' rump.ifconfig -a -v
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
 
 	# ifconfig -l [-bdsu]
 	#   -l shows only inteface names



CVS commit: src/tests/net/if

2015-09-03 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Sep  3 10:22:52 UTC 2015

Modified Files:
src/tests/net/if: t_ifconfig.sh

Log Message:
Add tests for ifconfig options

>From s-yamaguchi@IIJ (with some tweaks by me)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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/tests/net/if/t_ifconfig.sh
diff -u src/tests/net/if/t_ifconfig.sh:1.1 src/tests/net/if/t_ifconfig.sh:1.2
--- src/tests/net/if/t_ifconfig.sh:1.1	Wed Jul  1 08:33:31 2015
+++ src/tests/net/if/t_ifconfig.sh	Thu Sep  3 10:22:52 2015
@@ -1,4 +1,4 @@
-# $NetBSD: t_ifconfig.sh,v 1.1 2015/07/01 08:33:31 ozaki-r Exp $
+# $NetBSD: t_ifconfig.sh,v 1.2 2015/09/03 10:22:52 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -71,8 +71,116 @@ create_destroy_cleanup()
 	RUMP_SERVER=${RUMP_SERVER1} rump.halt
 }
 
+atf_test_case options cleanup
+options_head()
+{
+
+	atf_set "descr" "tests of ifconfig options"
+	atf_set "require.progs" "rump_server"
+}
+
+options_body()
+{
+
+	export RUMP_SERVER=${RUMP_SERVER1}
+	atf_check -s exit:0 rump_server $RUMP_FLAGS $RUMP_SERVER1
+
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 create
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 linkstr bus1
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet 10.0.0.1/24
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::1/64
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
+	$DEBUG && rump.ifconfig shmif0
+
+	# ifconfig [-N] interface address_family
+	#   -N resolves hostnames
+	atf_check -s exit:0 -o match:'inet 127.0.0.1' rump.ifconfig lo0 inet
+	atf_check -s exit:0 -o match:'inet localhost' rump.ifconfig -N lo0 inet
+	atf_check -s exit:0 -o match:'inet6 ::1' rump.ifconfig lo0 inet6
+	atf_check -s exit:0 -o match:'inet6 localhost' rump.ifconfig -N lo0 inet6
+	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig lo0 atalk
+	atf_check -s not-exit:0 -e match:'not supported' rump.ifconfig -N lo0 atalk
+	atf_check -s exit:0 -o ignore rump.ifconfig lo0 link
+	atf_check -s exit:0 -o ignore rump.ifconfig -N lo0 link
+
+	# ifconfig [-hLmNvz] interface
+	#   -h -v shows statistics in human readable format
+	atf_check -s exit:0 -o ignore rump.ifconfig -h -v lo0
+	#   -L shows IPv6 lifetime
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 inet6 fc00::2 \
+	pltime 100
+	$DEBUG && rump.ifconfig -L shmif0
+	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -L shmif0
+	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -L shmif0
+	#   -m shows all of the supported media (not supported in shmif)
+	$DEBUG && rump.ifconfig -m shmif0
+	atf_check -s exit:0 -o ignore rump.ifconfig -m shmif0
+	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -N lo0
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
+	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	#   -z clears and shows statistics at that point
+	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -z lo0
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -v lo0
+
+	# ifconfig -a [-bdhLNmsuvz]
+	#   -a shows all interfaces in the system
+	$DEBUG && rump.ifconfig -a
+	atf_check -s exit:0 -o match:'shmif0' -o match:'lo0' rump.ifconfig -a
+	#   -a -b shows only broadcast interfaces
+	atf_check -s exit:0 -o match:'shmif0' -o not-match:'lo0' rump.ifconfig -a -b
+	#   -a -d shows only down interfaces
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -d
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -d
+	atf_check -s exit:0 -o match:'pltime' rump.ifconfig -a -L
+	atf_check -s exit:0 -o match:'vltime' rump.ifconfig -a -L
+	atf_check -s exit:0 -o match:'localhost' rump.ifconfig -a -N
+	atf_check -s exit:0 -o ignore rump.ifconfig -a -m
+	#   -a -s shows only interfaces connected to a network
+	#   (shmif is always connected)
+	$DEBUG && rump.ifconfig -a -s
+	atf_check -s exit:0 -o ignore rump.ifconfig -a -s
+	#   -a -u shows only up interfaces
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -a -u
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 down
+	atf_check -s exit:0 -o not-match:'shmif0' rump.ifconfig -a -u
+	atf_check -s exit:0 -o ignore rump.ifconfig shmif0 up
+	atf_check -s exit:0 -o match:'0 packets' rump.ifconfig -a -v
+	atf_check -s exit:0 -o ignore rump.ping -c 1 localhost
+	atf_check -s exit:0 -o match:'2 packets' rump.ifconfig -a -z
+	atf_check -s exit:0 -o not-match:'2 packets' rump.ifconfig -a -v
+
+	# ifconfig -l [-bdsu]
+	#   -l shows only inteface names
+	atf_check -s exit:0 -o match:'lo0 shmif0' rump.ifconfig -l
+	atf_check -s exit:0 -o match:'shmif0' rump.ifconfig -l -b
+	atf_check -s exit:0 -o ignore rump.ifconfi

CVS commit: src/tests/net/if

2014-12-07 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Mon Dec  8 07:34:31 UTC 2014

Modified Files:
src/tests/net/if: Makefile

Log Message:
Fix LDADD.t_compat

This unbreaks the build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if/Makefile

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/Makefile
diff -u src/tests/net/if/Makefile:1.3 src/tests/net/if/Makefile:1.4
--- src/tests/net/if/Makefile:1.3	Mon Dec  8 04:23:03 2014
+++ src/tests/net/if/Makefile	Mon Dec  8 07:34:31 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2014/12/08 04:23:03 ozaki-r Exp $
+# $NetBSD: Makefile,v 1.4 2014/12/08 07:34:31 ozaki-r Exp $
 #
 
 .include 
@@ -12,7 +12,7 @@ PROGS=		ifconf
 MAN.ifconf=	# empty
 BINDIR.ifconf=	${TESTSDIR}
 
-LDADD.t_compat=	-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump
-LDADD.t_compat=	-lrumpuser -lrump -lpthread
+LDADD.t_compat=		-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump
+LDADD.t_compat+=	-lrumpuser -lrump -lpthread
 
 .include