summaryrefslogtreecommitdiff
path: root/regress/usr.sbin
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-24 15:15:42 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-03-24 15:15:42 +0000
commit16a7789bfd6311dfd64a5260f6cb55dc2a04c0c1 (patch)
treec277cd50b8f98aaa9f6d3b52d88e811928f36608 /regress/usr.sbin
parent2be4b6c91ab09af57f4aaef50147a21f2fe0ad57 (diff)
Check that only one published entry can be added.
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r--regress/usr.sbin/arp/Makefile13
-rw-r--r--regress/usr.sbin/arp/arptest6.ok4
2 files changed, 16 insertions, 1 deletions
diff --git a/regress/usr.sbin/arp/Makefile b/regress/usr.sbin/arp/Makefile
index 51618880181..d0a77d52043 100644
--- a/regress/usr.sbin/arp/Makefile
+++ b/regress/usr.sbin/arp/Makefile
@@ -1,9 +1,10 @@
-# $OpenBSD: Makefile,v 1.1 2016/03/23 08:58:32 mpi Exp $
+# $OpenBSD: Makefile,v 1.2 2016/03/24 15:15:41 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
+OTHER_MAC= cc:77:55:22:aa:66
.MAIN: all
@@ -71,6 +72,16 @@ arptest${n}:
${ARP} -a 2>&1 | \
diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+# Tryin to add two "pub" entries should generate and error
+n= 6
+RTTEST_TARGETS+:=arptest${n}
+arptest${n}:
+ ${ARP} -s 192.0.2.42 ${PRIV_MAC}
+ ${ARP} -s 192.0.2.42 ${PUB_MAC} pub
+ ${ARP} -s 192.0.2.42 ${OTHER_MAC} pub && exit 1 || exit 0
+ ${ARP} -a 2>&1| \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
REGRESS_TARGETS=${RTTEST_TARGETS}
REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}
.PHONY: ${REGRESS_TARGETS}
diff --git a/regress/usr.sbin/arp/arptest6.ok b/regress/usr.sbin/arp/arptest6.ok
new file mode 100644
index 00000000000..6891b513d99
--- /dev/null
+++ b/regress/usr.sbin/arp/arptest6.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