Always destroy all interfaces before starting a new test.
authormpi <mpi@openbsd.org>
Mon, 12 Feb 2018 15:48:58 +0000 (15:48 +0000)
committermpi <mpi@openbsd.org>
Mon, 12 Feb 2018 15:48:58 +0000 (15:48 +0000)
This should make tests following a failing test pass.

regress/sbin/route/Makefile
regress/sbin/route/rttest30.ok
regress/sbin/route/rttest32.ok

index 7467b85..1394b47 100644 (file)
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.25 2018/02/12 15:36:40 mpi Exp $
+# $OpenBSD: Makefile,v 1.26 2018/02/12 15:48:58 mpi Exp $
 
 RDOMAIN?=      5
 
@@ -10,6 +10,9 @@ RDOMAIN?=     5
 .SILENT: .BEGIN .END
 
 .BEGIN:
+.for itf in lo10001 lo10002 lo10003 lo10004 vlan99 vether99
+       -${SUDO} ifconfig ${itf} destroy 2>/dev/null || true
+.endfor
        -${SUDO} ifconfig lo${RDOMAIN} -inet6 down
        -${SUDO} ifconfig lo10001 up rdomain ${RDOMAIN} 192.0.2.1/32
        -${SUDO} ifconfig lo10002 up rdomain ${RDOMAIN} 192.0.2.2/32
@@ -17,10 +20,9 @@ RDOMAIN?=    5
        -${SUDO} ifconfig lo10004 up rdomain ${RDOMAIN} 192.0.2.4/32
 
 .END:
-       -${SUDO} ifconfig lo10001 destroy
-       -${SUDO} ifconfig lo10002 destroy
-       -${SUDO} ifconfig lo10003 destroy
-       -${SUDO} ifconfig lo10004 destroy
+.for itf in lo10001 lo10002 lo10003 lo10004 vlan99 vether99
+       -${SUDO} ifconfig ${itf} destroy 2>/dev/null || true
+.endfor
 
 .endif
 .endif
@@ -122,7 +124,7 @@ rttest${n}:
        ${SUDO} ifconfig lo10002 down
        ! ${RCMD} add -priority 17 10.8.1/24 192.0.2.2
        # Wait until SRP reference count are dropped
-       sleep .1
+       sleep .5
        ${RCMD} show -inet 2>&1 | \
                diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
 
@@ -343,11 +345,9 @@ rttest${n}:
        ${SUDO} ifconfig vlan99 inet alias 10.1.255.3/14
        ${SUDO} ifconfig vlan99 down
        # Wait until SRP reference count are dropped
-       sleep .1
+       sleep .5
        ${RCMD} show -inet 2>&1 | \
                diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
-       ${SUDO} ifconfig vlan99 destroy
-       ${SUDO} ifconfig vether99 destroy
 
 # Check that routes are inserted respecting their priority order
 n=     31
@@ -377,8 +377,6 @@ rttest${n}:
        ${RCMD} show -inet 2>&1 | \
                sed -e "s,link\#[0-9 ]*U,link#              U," | \
                cat > ${.CURDIR}/${.TARGET}.ok
-       ${SUDO} ifconfig vlan99 destroy
-       ${SUDO} ifconfig vether99 destroy
 
 REGRESS_TARGETS=netmask ${RTTEST_TARGETS}
 REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}
index 14391dc..7600f58 100644 (file)
@@ -2,7 +2,7 @@ Routing tables
 
 Internet:
 Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
-10.0/14            10.1.254.56        UCPn       0        1     -     4 vether99
+10.0/14            10.1.254.56        UCPn       0        3     -     4 vether99
 10.0/14            10.1.255.1         CPn        0        0     -     4 vlan99
 10.0/14            10.1.255.2         CPn        0        0     -     4 vlan99
 10.0/14            10.1.255.3         CPn        0        0     -     4 vlan99
index 2b4ac13..64ed660 100644 (file)
@@ -2,12 +2,6 @@ Routing tables
 
 Internet:
 Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
-10.0/14            10.1.255.2         UCPn       0        0     -     4 vlan99
-10.0/14            10.1.255.3         UCPn       0        0     -     4 vlan99
-10.1.255.2         fe:e1:ba:d4:c8:1d  UHLl       0        0     -     1 vlan99
-10.1.255.3         fe:e1:ba:d4:c8:1d  UHLl       0        0     -     1 vlan99
-10.3.255.255       10.1.255.2         UHPb       0        0     -     1 vlan99
-10.3.255.255       10.1.255.3         UHPb       0        0     -     1 vlan99
 130.102.71.64/27   130.102.71.68      UCPn       1        1     -     4 vether99
 130.102.71.64/27   130.102.71.70      UCPn       1        0     -     4 vlan99
 130.102.71.67      link#              UHLchP     1        3     -     3 vether99