summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-09-05 11:14:48 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-09-05 11:14:48 +0000
commit40aaf5623ba3817857164588ff150122c2d0866e (patch)
treea26f2ee2bd03e4a0e15c39d359a8ea3984c2b357
parent18ee0ebb136c6e83c897e6352d360fc755c186fc (diff)
Test that MPATH routes with different priorities are insterted respecting
their priority order.
-rw-r--r--regress/sbin/route/Makefile12
-rw-r--r--regress/sbin/route/rttest31.ok12
2 files changed, 23 insertions, 1 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile
index ccf75a75e6f..8f20b24b681 100644
--- a/regress/sbin/route/Makefile
+++ b/regress/sbin/route/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.21 2017/09/05 11:03:08 mpi Exp $
+# $OpenBSD: Makefile,v 1.22 2017/09/05 11:14:47 mpi Exp $
RDOMAIN?= 5
@@ -346,6 +346,16 @@ rttest${n}:
${SUDO} ifconfig vlan99 destroy
${SUDO} ifconfig vether99 destroy
+# Check that routes are inserted respecting their priority order
+n= 31
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 192.0.3/24 -priority 13 192.0.2.3
+ ${RCMD} add -mpath 192.0.3/24 -priority 11 192.0.2.1
+ ${RCMD} add -mpath 192.0.3/24 -priority 14 192.0.2.4
+ ${RCMD} add -mpath 192.0.3/24 -priority 12 192.0.2.2
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
REGRESS_TARGETS=netmask ${RTTEST_TARGETS}
REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}
diff --git a/regress/sbin/route/rttest31.ok b/regress/sbin/route/rttest31.ok
new file mode 100644
index 00000000000..193ebb588d9
--- /dev/null
+++ b/regress/sbin/route/rttest31.ok
@@ -0,0 +1,12 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+192.0.2.1 192.0.2.1 UHhl 1 2 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHhl 1 2 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHhl 1 2 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHhl 1 2 32768 1 lo10004
+192.0.3/24 192.0.2.1 UGS 0 0 32768 11 lo10001
+192.0.3/24 192.0.2.2 UGS 0 0 32768 12 lo10002
+192.0.3/24 192.0.2.3 UGS 0 0 32768 13 lo10003
+192.0.3/24 192.0.2.4 UGS 0 0 32768 14 lo10004