Test that next-hop L2 caches are cloned using the correct MPATH route.
authormpi <mpi@openbsd.org>
Thu, 8 Feb 2018 13:51:08 +0000 (13:51 +0000)
committermpi <mpi@openbsd.org>
Thu, 8 Feb 2018 13:51:08 +0000 (13:51 +0000)
ok jmatthew@, claudio@, dlg@

regress/sbin/route/Makefile
regress/sbin/route/rttest32.ok [new file with mode: 0644]

index b5f596f..d99e3b8 100644 (file)
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.23 2017/09/12 08:43:14 mpi Exp $
+# $OpenBSD: Makefile,v 1.24 2018/02/08 13:51:08 mpi Exp $
 
 RDOMAIN?=      5
 
@@ -359,6 +359,26 @@ rttest${n}:
        ${RCMD} show -inet 2>&1 | \
                diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
 
+# Check that next-hop L2 cache are cloned using the correct MPATH route
+n=     32
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+       # Use vether(4) and vlan(4) because we need IFT_ETHER interfaces
+       # for the auto-magic RTF_CLONING routes.
+       ${SUDO} ifconfig vether99 rdomain ${RDOMAIN} lladdr fe:e1:ba:d4:c8:1d up
+       ${SUDO} ifconfig vether99 130.102.71.68/27
+       ${SUDO} ifconfig vlan99 rdomain ${RDOMAIN} parent vether99 vnetid 3 up
+       ${SUDO} ifconfig vlan99 130.102.71.70/27
+       # Inserting such route generate the insertion of a RTF_CLONED entry
+       # attached to the specified interface
+       ${RCMD} add -net 192.168.67.0/25 130.102.71.67 -priority 9 -ifp vether99
+       ${RCMD} add -net 192.168.67.128/25 130.102.71.67 -priority 3 -ifp vlan99
+       ${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}
 .PHONY: ${REGRESS_TARGETS}
diff --git a/regress/sbin/route/rttest32.ok b/regress/sbin/route/rttest32.ok
new file mode 100644 (file)
index 0000000..64ed660
--- /dev/null
@@ -0,0 +1,18 @@
+Routing tables
+
+Internet:
+Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
+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
+130.102.71.67      link#              UHLchP     1        0     -     3 vlan99
+130.102.71.68      fe:e1:ba:d4:c8:1d  UHLl       0        0     -     1 vether99
+130.102.71.70      fe:e1:ba:d4:c8:1d  UHLl       0        0     -     1 vlan99
+130.102.71.95      130.102.71.68      UHPb       0        0     -     1 vether99
+130.102.71.95      130.102.71.70      UHPb       0        0     -     1 vlan99
+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        0        0 32768     1 lo10004
+192.168.67.0/25    130.102.71.67      UGS        0        0     -     9 vether99
+192.168.67.128/25  130.102.71.67      UGS        0        0     -     3 vlan99