summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-02-12 15:48:59 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-02-12 15:48:59 +0000
commit96ab01fbc123cd7cfe7f9bfa8d4435c0509ac6c6 (patch)
treebf99b78e559ee6af6c4d57768ac0a8be7c051602
parentfa1cc198445ba9a40e185097ed676c001b887b5c (diff)
Always destroy all interfaces before starting a new test.
This should make tests following a failing test pass.
-rw-r--r--regress/sbin/route/Makefile20
-rw-r--r--regress/sbin/route/rttest30.ok2
-rw-r--r--regress/sbin/route/rttest32.ok6
3 files changed, 10 insertions, 18 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile
index 7467b858289..1394b477b10 100644
--- a/regress/sbin/route/Makefile
+++ b/regress/sbin/route/Makefile
@@ -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}
diff --git a/regress/sbin/route/rttest30.ok b/regress/sbin/route/rttest30.ok
index 14391dc3175..7600f583d27 100644
--- a/regress/sbin/route/rttest30.ok
+++ b/regress/sbin/route/rttest30.ok
@@ -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
diff --git a/regress/sbin/route/rttest32.ok b/regress/sbin/route/rttest32.ok
index 2b4ac13da71..64ed66052f2 100644
--- a/regress/sbin/route/rttest32.ok
+++ b/regress/sbin/route/rttest32.ok
@@ -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