summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/sbin/route/Makefile57
-rw-r--r--regress/sbin/route/rttest22.ok10
-rw-r--r--regress/sbin/route/rttest24.ok10
-rw-r--r--regress/sbin/route/rttest26.ok9
-rw-r--r--regress/sbin/route/rttest27.ok9
5 files changed, 94 insertions, 1 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile
index 028fdf4fbfe..b3ff38e90c6 100644
--- a/regress/sbin/route/Makefile
+++ b/regress/sbin/route/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.12 2016/08/31 10:33:15 claudio Exp $
+# $OpenBSD: Makefile,v 1.13 2016/08/31 11:00:15 claudio Exp $
RDOMAIN?= 5
@@ -266,6 +266,61 @@ rttest${n}:
${RCMD} show -inet 2>&1 | \
diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+# Can change the MTU of an mpath route that exists
+n= 22
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.4
+ ${RCMD} change -mpath -mtu 1000 10.8.1/24 192.0.2.4
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
+# Can't change the MTU of an mpath route without gateway
+n= 23
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.4
+ ${RCMD} change -mpath -mtu 1000 10.8.1/24 && exit 1 || exit 0
+
+# Can change and lock the MTU of an mpath route that exists
+# (route can't just lock so this is mostly the same as rttest22)
+n= 24
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.4
+ ${RCMD} change -mpath -lock -mtu 1000 10.8.1/24 192.0.2.4
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
+# Can't change the MTU of an mpath route that has a wrong gateway
+n= 25
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.4
+ ${RCMD} change -mpath -mtu 1000 10.8.1/24 192.0.2.1 && exit 1 || exit 0
+
+# Can change the MTU of an non-mpath route without gateway
+n= 26
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} change -mpath -mtu 1000 10.8.1/24
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
+# Can change the MTU and gateway of an non-mpath route at the same time
+n= 27
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add -mpath 10.8.1/24 192.0.2.3
+ ${RCMD} change -mpath -mtu 1000 10.8.1/24 192.0.2.4
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
REGRESS_TARGETS=netmask ${RTTEST_TARGETS}
REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}
.PHONY: ${REGRESS_TARGETS}
diff --git a/regress/sbin/route/rttest22.ok b/regress/sbin/route/rttest22.ok
new file mode 100644
index 00000000000..f48684c535c
--- /dev/null
+++ b/regress/sbin/route/rttest22.ok
@@ -0,0 +1,10 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+10.8.1/24 192.0.2.3 UGSP 0 1 32768 8 lo10003
+10.8.1/24 192.0.2.4 UGSP 0 0 1000 8 lo10004
+192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHl 1 2 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 1 3 32768 1 lo10004
diff --git a/regress/sbin/route/rttest24.ok b/regress/sbin/route/rttest24.ok
new file mode 100644
index 00000000000..4937e106562
--- /dev/null
+++ b/regress/sbin/route/rttest24.ok
@@ -0,0 +1,10 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+10.8.1/24 192.0.2.3 UGSP 0 1 32768 8 lo10003
+10.8.1/24 192.0.2.4 UGSP 0 0 1000 L 8 lo10004
+192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHl 1 2 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 1 3 32768 1 lo10004
diff --git a/regress/sbin/route/rttest26.ok b/regress/sbin/route/rttest26.ok
new file mode 100644
index 00000000000..f653b056e98
--- /dev/null
+++ b/regress/sbin/route/rttest26.ok
@@ -0,0 +1,9 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+10.8.1/24 192.0.2.3 UGS 0 0 1000 8 lo10003
+192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHl 1 2 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004
diff --git a/regress/sbin/route/rttest27.ok b/regress/sbin/route/rttest27.ok
new file mode 100644
index 00000000000..6382ece75bc
--- /dev/null
+++ b/regress/sbin/route/rttest27.ok
@@ -0,0 +1,9 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+10.8.1/24 192.0.2.4 UGS 0 0 1000 8 lo10004
+192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHl 0 2 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 1 2 32768 1 lo10004