diff options
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r-- | regress/usr.sbin/Makefile | 3 | ||||
-rw-r--r-- | regress/usr.sbin/arp/Makefile | 78 | ||||
-rw-r--r-- | regress/usr.sbin/arp/arptest1.ok | 4 | ||||
-rw-r--r-- | regress/usr.sbin/arp/arptest2.ok | 4 | ||||
-rw-r--r-- | regress/usr.sbin/arp/arptest3.ok | 3 | ||||
-rw-r--r-- | regress/usr.sbin/arp/arptest4.ok | 3 | ||||
-rw-r--r-- | regress/usr.sbin/arp/arptest5.ok | 3 |
7 files changed, 97 insertions, 1 deletions
diff --git a/regress/usr.sbin/Makefile b/regress/usr.sbin/Makefile index 38105414439..8d553fa822e 100644 --- a/regress/usr.sbin/Makefile +++ b/regress/usr.sbin/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.10 2015/06/23 18:04:29 semarie Exp $ +# $OpenBSD: Makefile,v 1.11 2016/03/23 08:58:32 mpi Exp $ +SUBDIR += arp SUBDIR += httpd SUBDIR += mtree SUBDIR += ospfd diff --git a/regress/usr.sbin/arp/Makefile b/regress/usr.sbin/arp/Makefile new file mode 100644 index 00000000000..51618880181 --- /dev/null +++ b/regress/usr.sbin/arp/Makefile @@ -0,0 +1,78 @@ +# $OpenBSD: Makefile,v 1.1 2016/03/23 08:58:32 mpi Exp $ + +RDOMAIN?= 5 +VETHER_MAC= fe:e1:ba:d2:a3:18 +PRIV_MAC= 00:90:27:bb:cc:dd +PUB_MAC= fe:88:33:11:bb:aa + +.MAIN: all + +.ifmake !obj && !clean && !cleandir && !depend && !regress +.if (${.TARGET} != all && ! make(all)) || (${.TARGET} == all) + +.SILENT: .BEGIN .END .INTERRUPT + +.BEGIN: + -${SUDO} ifconfig vether10001 up lladdr ${VETHER_MAC} \ + rdomain ${RDOMAIN} 192.0.2.1/24 + +.END: + -${SUDO} ifconfig vether10001 destroy + +.INTERRUPT: + -${SUDO} ifconfig vether10001 destroy + +.endif +.endif + +ARP= ${SUDO} arp -n -V ${RDOMAIN} + +# Two entries to the same destination are ok if one is "pub" +n= 1 +RTTEST_TARGETS+:=arptest${n} +arptest${n}: + ${ARP} -s 192.0.2.42 ${PRIV_MAC} + ${ARP} -s 192.0.2.42 ${PUB_MAC} pub + ${ARP} -a 2>&1| \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Insert the "pub" entry first, it should not matter +n= 2 +RTTEST_TARGETS+:=arptest${n} +arptest${n}: + ${ARP} -s 192.0.2.42 ${PUB_MAC} pub + ${ARP} -s 192.0.2.42 ${PRIV_MAC} + ${ARP} -a 2>&1| \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Not specifying "pub" should generate an error +n= 3 +RTTEST_TARGETS+:=arptest${n} +arptest${n}: + ${ARP} -s 192.0.2.42 ${PRIV_MAC} + ${ARP} -s 192.0.2.42 ${PUB_MAC} && exit 1 || exit 0 + ${ARP} -a 2>&1| \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Not specifying "pub" works only if "-F" is specified +n= 4 +RTTEST_TARGETS+:=arptest${n} +arptest${n}: + ${ARP} -s 192.0.2.42 ${PRIV_MAC} + ${ARP} -Fs 192.0.2.42 ${PUB_MAC} + ${ARP} -a 2>&1 | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Test that "permanent" entries are correctly created +n= 5 +RTTEST_TARGETS+:=arptest${n} +arptest${n}: + ${ARP} -s 192.0.2.42 ${PRIV_MAC} "permanent" + ${ARP} -a 2>&1 | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +REGRESS_TARGETS=${RTTEST_TARGETS} +REGRESS_ROOT_TARGETS=${REGRESS_TARGETS} +.PHONY: ${REGRESS_TARGETS} + +.include <bsd.regress.mk> diff --git a/regress/usr.sbin/arp/arptest1.ok b/regress/usr.sbin/arp/arptest1.ok new file mode 100644 index 00000000000..6891b513d99 --- /dev/null +++ b/regress/usr.sbin/arp/arptest1.ok @@ -0,0 +1,4 @@ +Host Ethernet Address Netif Expire Flags +192.0.2.1 fe:e1:ba:d2:a3:18 vether10001 permanent l +192.0.2.42 00:90:27:bb:cc:dd vether10001 static +192.0.2.42 fe:88:33:11:bb:aa vether10001 static p diff --git a/regress/usr.sbin/arp/arptest2.ok b/regress/usr.sbin/arp/arptest2.ok new file mode 100644 index 00000000000..6891b513d99 --- /dev/null +++ b/regress/usr.sbin/arp/arptest2.ok @@ -0,0 +1,4 @@ +Host Ethernet Address Netif Expire Flags +192.0.2.1 fe:e1:ba:d2:a3:18 vether10001 permanent l +192.0.2.42 00:90:27:bb:cc:dd vether10001 static +192.0.2.42 fe:88:33:11:bb:aa vether10001 static p diff --git a/regress/usr.sbin/arp/arptest3.ok b/regress/usr.sbin/arp/arptest3.ok new file mode 100644 index 00000000000..44641aa06d7 --- /dev/null +++ b/regress/usr.sbin/arp/arptest3.ok @@ -0,0 +1,3 @@ +Host Ethernet Address Netif Expire Flags +192.0.2.1 fe:e1:ba:d2:a3:18 vether10001 permanent l +192.0.2.42 00:90:27:bb:cc:dd vether10001 static diff --git a/regress/usr.sbin/arp/arptest4.ok b/regress/usr.sbin/arp/arptest4.ok new file mode 100644 index 00000000000..9f036239445 --- /dev/null +++ b/regress/usr.sbin/arp/arptest4.ok @@ -0,0 +1,3 @@ +Host Ethernet Address Netif Expire Flags +192.0.2.1 fe:e1:ba:d2:a3:18 vether10001 permanent l +192.0.2.42 fe:88:33:11:bb:aa vether10001 static diff --git a/regress/usr.sbin/arp/arptest5.ok b/regress/usr.sbin/arp/arptest5.ok new file mode 100644 index 00000000000..0373be03a66 --- /dev/null +++ b/regress/usr.sbin/arp/arptest5.ok @@ -0,0 +1,3 @@ +Host Ethernet Address Netif Expire Flags +192.0.2.1 fe:e1:ba:d2:a3:18 vether10001 permanent l +192.0.2.42 00:90:27:bb:cc:dd vether10001 permanent |