Source-Changes-HG archive

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

src: Add a test that checks if brconfig flush surely removes all...



details:   https://anonhg.NetBSD.org/src/rev/29d02c6f2f84
branches:  trunk
changeset: 318315:29d02c6f2f84
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Apr 18 04:03:12 2018 +0000
description:
Add a test that checks if brconfig flush surely removes all entries

diffstat:

 tests/net/if_bridge/t_rtable.sh |  31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r 1ebe92f635dd -r 29d02c6f2f84 tests/net/if_bridge/t_rtable.sh
--- a/tests/net/if_bridge/t_rtable.sh   Wed Apr 18 04:01:58 2018 +0000
+++ b/tests/net/if_bridge/t_rtable.sh   Wed Apr 18 04:03:12 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_rtable.sh,v 1.2 2018/04/10 07:09:00 ozaki-r Exp $
+#      $NetBSD: t_rtable.sh,v 1.3 2018/04/18 04:03:12 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -169,6 +169,7 @@
 bridge_rtable_flush_body()
 {
        local addr1= addr3=
+       local n=
 
        setup
        setup_bridge
@@ -195,6 +196,34 @@
        atf_check -s exit:0 -o not-match:"$addr3 shmif1" /sbin/brconfig bridge0
        unset LD_PRELOAD
 
+       # Add extra interfaces and addresses
+       export RUMP_SERVER=$SOCK1
+       rump_server_add_iface $SOCK1 shmif1 bus1
+       atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.11/24
+       atf_check -s exit:0 rump.ifconfig -w 10
+
+       export RUMP_SERVER=$SOCK3
+       rump_server_add_iface $SOCK3 shmif1 bus2
+       atf_check -s exit:0 rump.ifconfig shmif1 10.0.0.12/24
+       atf_check -s exit:0 rump.ifconfig -w 10
+
+       # Let cache entries
+       export RUMP_SERVER=$SOCK1
+       atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.12
+       export RUMP_SERVER=$SOCK3
+       atf_check -s exit:0 -o ignore rump.ping -n -w $TIMEOUT -c 1 10.0.0.11
+
+       export RUMP_SERVER=$SOCK2
+       export LD_PRELOAD=/usr/lib/librumphijack.so
+       $DEBUG && /sbin/brconfig bridge0
+       n=$(get_number_of_caches)
+       atf_check_equal $n 4
+
+       atf_check -s exit:0 -o ignore /sbin/brconfig bridge0 flush
+       n=$(get_number_of_caches)
+       atf_check_equal $n 0
+       unset LD_PRELOAD
+
        rump_server_destroy_ifaces
 }
 



Home | Main Index | Thread Index | Old Index