Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/if Add a test case of ifconfig <if_index>



details:   https://anonhg.NetBSD.org/src/rev/9b11c51dca8f
branches:  trunk
changeset: 822360:9b11c51dca8f
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Mar 16 09:43:56 2017 +0000

description:
Add a test case of ifconfig <if_index>

I don't know if <if_index> 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.

diffstat:

 tests/net/if/t_ifconfig.sh |  32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (51 lines):

diff -r 1a93a90c0345 -r 9b11c51dca8f tests/net/if/t_ifconfig.sh
--- a/tests/net/if/t_ifconfig.sh        Thu Mar 16 09:40:48 2017 +0000
+++ b/tests/net/if/t_ifconfig.sh        Thu Mar 16 09:43:56 2017 +0000
@@ -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 @@
        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_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
 }



Home | Main Index | Thread Index | Old Index