summaryrefslogtreecommitdiff
path: root/regress/sbin
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-26 11:55:09 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-11-26 11:55:09 +0000
commitcd6636dce5336f1d014292dc71050511f02687d1 (patch)
tree9db7afd073f3a9e40a1c184e5be3ce7a5f8566f1 /regress/sbin
parent366762224369ec5373fb18c2d6ec980e9cf01020 (diff)
Add 3 regression tests for "route change" dealing with -ifp, -ifa and
-mtu. Triggered by a report from Florian Riehm on tech@. Note that two of these tests are using IPv6 addresses and expose another bug with ::1. I'll deal with this afterward unless someone else(tm) fixes it.
Diffstat (limited to 'regress/sbin')
-rw-r--r--regress/sbin/route/Makefile35
-rw-r--r--regress/sbin/route/rttest14.ok23
-rw-r--r--regress/sbin/route/rttest15.ok9
-rw-r--r--regress/sbin/route/rttest16.ok23
4 files changed, 89 insertions, 1 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile
index 2d8cbf869d8..f61fedf3c2a 100644
--- a/regress/sbin/route/Makefile
+++ b/regress/sbin/route/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2014/05/31 14:15:53 claudio Exp $
+# $OpenBSD: Makefile,v 1.5 2014/11/26 11:55:08 mpi Exp $
RDOMAIN?= 5
@@ -171,6 +171,39 @@ rttest${n}:
${RCMD} add -mpath 10.8.1/24 192.0.2.4
${RCMD} change -mpath 10.8.1/24 192.0.2.5 && exit 1 || exit 0
+# Changing MTU should not change the ifa
+n= 14
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${SUDO} ifconfig lo10001 inet6 eui64
+ ${SUDO} ifconfig lo10002 inet6 fd88::1/64
+ ${SUDO} ifconfig lo10003 inet6 fd99::1/64
+ ${RCMD} add -inet6 fd88::666 fd99::1
+ ${RCMD} change fd88::666 -mtu 1500
+ ${RCMD} show -inet6 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
+# Changing the ifa should not change the gw
+n= 15
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${RCMD} add 10.0/16 192.0.2.4
+ ${RCMD} change 10.0/16 -ifa 192.0.2.2
+ ${RCMD} show -inet 2>&1 | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
+# Changing ifp should not change the gw
+n= 16
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ ${SUDO} ifconfig lo10001 inet6 eui64
+ ${SUDO} ifconfig lo10002 inet6 fd88::1/64
+ ${SUDO} ifconfig lo10003 inet6 fd99::1/64
+ ${RCMD} add -inet6 fd88::666 fd99::1
+ ${RCMD} change fd88::666 -ifp lo10002
+ ${RCMD} show -inet6 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/rttest14.ok b/regress/sbin/route/rttest14.ok
new file mode 100644
index 00000000000..d46adfe97b8
--- /dev/null
+++ b/regress/sbin/route/rttest14.ok
@@ -0,0 +1,23 @@
+Routing tables
+
+Internet6:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+::1 ::1 UHl 0 0 32768 1 lo10001
+::1 ::1 UH 0 0 32768 4 lo10001
+fd88::/64 fe80::1%lo10002 U 0 0 - 4 lo10002
+fd88::1 fd88::1 UHl 0 0 - 1 lo10002
+fd88::666 fd99::1 UGHS 0 0 1500 8 lo10003
+fd99::/64 fe80::1%lo10003 U 0 0 - 4 lo10003
+fd99::1 fd99::1 UHl 1 0 - 1 lo10003
+fe80::%lo10001/64 fe80::1%lo10001 U 0 0 - 4 lo10001
+fe80::1%lo10001 fe80::1%lo10001 UHl 0 0 - 1 lo10001
+fe80::%lo10002/64 fe80::1%lo10002 U 0 0 - 4 lo10002
+fe80::1%lo10002 fe80::1%lo10002 UHl 0 0 - 1 lo10002
+fe80::%lo10003/64 fe80::1%lo10003 U 0 0 - 4 lo10003
+fe80::1%lo10003 fe80::1%lo10003 UHl 0 0 - 1 lo10003
+ff01::%lo10001/32 fe80::1%lo10001 UC 0 0 - 4 lo10001
+ff01::%lo10002/32 fe80::1%lo10002 UC 0 0 - 4 lo10002
+ff01::%lo10003/32 fe80::1%lo10003 UC 0 0 - 4 lo10003
+ff02::%lo10001/32 fe80::1%lo10001 UC 0 0 - 4 lo10001
+ff02::%lo10002/32 fe80::1%lo10002 UC 0 0 - 4 lo10002
+ff02::%lo10003/32 fe80::1%lo10003 UC 0 0 - 4 lo10003
diff --git a/regress/sbin/route/rttest15.ok b/regress/sbin/route/rttest15.ok
new file mode 100644
index 00000000000..88749fdd4e8
--- /dev/null
+++ b/regress/sbin/route/rttest15.ok
@@ -0,0 +1,9 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+10.0/16 192.0.2.4 UGS 0 0 32768 8 lo10002
+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 0 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 1 0 32768 1 lo10004
diff --git a/regress/sbin/route/rttest16.ok b/regress/sbin/route/rttest16.ok
new file mode 100644
index 00000000000..434b70f8915
--- /dev/null
+++ b/regress/sbin/route/rttest16.ok
@@ -0,0 +1,23 @@
+Routing tables
+
+Internet6:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+::1 ::1 UHl 0 0 32768 1 lo10001
+::1 ::1 UH 0 0 32768 4 lo10001
+fd88::/64 fe80::1%lo10002 U 0 0 - 4 lo10002
+fd88::1 fd88::1 UHl 0 0 - 1 lo10002
+fd88::666 fd99::1 UGHS 0 0 - 8 lo10002
+fd99::/64 fe80::1%lo10003 U 0 0 - 4 lo10003
+fd99::1 fd99::1 UHl 1 0 - 1 lo10003
+fe80::%lo10001/64 fe80::1%lo10001 U 0 0 - 4 lo10001
+fe80::1%lo10001 fe80::1%lo10001 UHl 0 0 - 1 lo10001
+fe80::%lo10002/64 fe80::1%lo10002 U 0 0 - 4 lo10002
+fe80::1%lo10002 fe80::1%lo10002 UHl 0 0 - 1 lo10002
+fe80::%lo10003/64 fe80::1%lo10003 U 0 0 - 4 lo10003
+fe80::1%lo10003 fe80::1%lo10003 UHl 0 0 - 1 lo10003
+ff01::%lo10001/32 fe80::1%lo10001 UC 0 0 - 4 lo10001
+ff01::%lo10002/32 fe80::1%lo10002 UC 0 0 - 4 lo10002
+ff01::%lo10003/32 fe80::1%lo10003 UC 0 0 - 4 lo10003
+ff02::%lo10001/32 fe80::1%lo10001 UC 0 0 - 4 lo10001
+ff02::%lo10002/32 fe80::1%lo10002 UC 0 0 - 4 lo10002
+ff02::%lo10003/32 fe80::1%lo10003 UC 0 0 - 4 lo10003