Source-Changes-HG archive

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

[src/trunk]: src/tests/net tests: enable to create interfaces other than shmi...



details:   https://anonhg.NetBSD.org/src/rev/42ffa3cb5efd
branches:  trunk
changeset: 458969:42ffa3cb5efd
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Aug 19 03:21:13 2019 +0000

description:
tests: enable to create interfaces other than shmif with rump_server_add_iface

For this change interfaces are destroyed in the reverse order of their
creations in case there are dependencies between interfaces.

diffstat:

 tests/net/net_common.sh |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 9352e9f8e18d -r 42ffa3cb5efd tests/net/net_common.sh
--- a/tests/net/net_common.sh   Mon Aug 19 03:20:27 2019 +0000
+++ b/tests/net/net_common.sh   Mon Aug 19 03:21:13 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: net_common.sh,v 1.32 2019/07/18 04:22:22 ozaki-r Exp $
+#      $NetBSD: net_common.sh,v 1.33 2019/08/19 03:21:13 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -321,7 +321,9 @@
 
        export RUMP_SERVER=$sock
        atf_check -s exit:0 rump.ifconfig $ifname create
-       atf_check -s exit:0 rump.ifconfig $ifname linkstr $bus
+       if [ -n "$bus" ]; then
+               atf_check -s exit:0 rump.ifconfig $ifname linkstr $bus
+       fi
        export RUMP_SERVER=$backup
 
        echo $sock $ifname >> $_rump_server_ifaces
@@ -359,13 +361,17 @@
 
        # XXX using pipe doesn't work. See PR bin/51667
        #cat $_rump_server_ifaces | while read sock ifname; do
+       # Destroy interfaces in the reverse order
+       tac $_rump_server_ifaces > __ifaces
        while read sock ifname; do
                export RUMP_SERVER=$sock
                if rump.ifconfig -l |grep -q $ifname; then
                        atf_check -s exit:0 rump.ifconfig $ifname destroy
                fi
                atf_check -s exit:0 -o ignore rump.ifconfig
-       done < $_rump_server_ifaces
+       done < __ifaces
+       rm -f __ifaces
+
        export RUMP_SERVER=$backup
 
        return 0



Home | Main Index | Thread Index | Old Index