summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2020-12-17 00:39:43 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2020-12-17 00:39:43 +0000
commitb8fdd43d117162c8d2a8575e183b845dd894b5bb (patch)
tree33699d64a898f432cfd4c89cbbd240219647e414 /regress
parent732af4006a9a32f45f9cc6a518b519dbe254bc73 (diff)
Use setup and cleanup feature from regress framework.
Remove echo headlines. Use consistent target names. Makefile cleanup.
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/net/etherip/Makefile50
-rw-r--r--regress/sys/net/gif/Makefile206
-rw-r--r--regress/sys/net/loop/Makefile132
3 files changed, 170 insertions, 218 deletions
diff --git a/regress/sys/net/etherip/Makefile b/regress/sys/net/etherip/Makefile
index 14e4d511abb..61c8369fa19 100644
--- a/regress/sys/net/etherip/Makefile
+++ b/regress/sys/net/etherip/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.6 2018/06/25 22:22:49 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2020/12/17 00:39:42 bluhm Exp $
# Copyright (c) 2017 Alexander Bluhm <bluhm@openbsd.org>
# Copyright (c) 2015 Vincent Gross <vgross@openbsd.org>
@@ -35,31 +35,32 @@ N2 = 12
NUMS = ${N1} ${N2}
IFS = bridge vether etherip pair
-CLEANFILES = stamp-*
-
.PHONY: busy-interfaces busy-rdomains ifconfig unconfig
+REGRESS_SETUP_ONCE += busy-interfaces
busy-interfaces:
- # check if interfaces are busy
+ # Check if interfaces are busy.
.for n in ${NUMS}
.for i in ${IFS}
- @if ! /sbin/ifconfig ${i}${n} 2>&1 | grep -q "no such interface"; then\
- echo interface ${i}${n} is already used >&2; exit 1; fi
+ @if ! /sbin/ifconfig $i$n 2>&1 | grep -q "no such interface"; then\
+ echo interface $i$n is already used >&2; exit 1; fi
.endfor
.endfor
+REGRESS_SETUP_ONCE += busy-rdomains
busy-rdomains:
- # check if rdomains are busy
+ # Check if rdomains are busy.
.for n in ${NUMS}
- @if /sbin/ifconfig | grep -v '^lo${n}:' | grep ' rdomain ${n} '; then\
- echo routing domain ${n} is already used >&2; exit 1; fi
+ @if /sbin/ifconfig | grep -v '^lo$n:' | grep ' rdomain $n '; then\
+ echo routing domain $n is already used >&2; exit 1; fi
.endfor
+REGRESS_SETUP_ONCE += ifconfig
ifconfig: unconfig
- # create and configure interfaces
+ # Create and configure interfaces.
.for n in ${NUMS}
.for i in ${IFS}
- ${SUDO} /sbin/ifconfig ${i}${n} create rdomain ${n}
+ ${SUDO} /sbin/ifconfig $i$n create rdomain $n
.endfor
.endfor
${SUDO} /sbin/ifconfig pair${N1} 172.31.0.1/24
@@ -73,33 +74,22 @@ ifconfig: unconfig
${SUDO} /sbin/ifconfig etherip${N1} tunnel 172.31.0.1 172.31.0.2 up
${SUDO} /sbin/ifconfig etherip${N2} tunnel 172.31.0.2 172.31.0.1 up
+REGRESS_CLEANUP += unconfig
unconfig:
- # destroy interfaces
+ # Destroy interfaces.
.for n in ${NUMS}
.for i in ${IFS}
- -${SUDO} /sbin/ifconfig ${i}${n} destroy
+ -${SUDO} /sbin/ifconfig $i$n destroy
.endfor
.endfor
- rm -f stamp-setup
-
-stamp-setup:
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} busy-interfaces busy-rdomains ifconfig
- date >$@
+ rm -f stamp-ifconfig
-REGRESS_TARGETS += run-regress-ping-1-2
-run-regress-ping-1-2: stamp-setup
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-ping-1-2
+run-ping-1-2:
/sbin/ping -n -w 1 -c 1 -V ${N1} 192.168.0.2
-REGRESS_TARGETS += run-regress-ping-2-1
-run-regress-ping-2-1: stamp-setup
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-ping-2-1
+run-ping-2-1:
/sbin/ping -n -w 1 -c 1 -V ${N2} 192.168.0.1
-REGRESS_TARGETS += run-regress-cleanup
-run-regress-cleanup: stamp-setup
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} unconfig
-
.include <bsd.regress.mk>
diff --git a/regress/sys/net/gif/Makefile b/regress/sys/net/gif/Makefile
index f7c8717be16..4af52c693f7 100644
--- a/regress/sys/net/gif/Makefile
+++ b/regress/sys/net/gif/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2020/01/08 21:28:00 bluhm Exp $
+# $OpenBSD: Makefile,v 1.5 2020/12/17 00:39:42 bluhm Exp $
# Copyright (c) 2018-2020 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -86,62 +86,60 @@ regress:
.endif
-.PHONY: busy-rdomains ifconfig unconfig
+.PHONY: busy-rdomains ifconfig unconfig pfctl
+REGRESS_SETUP_ONCE += busy-rdomains
busy-rdomains:
- # check if rdomains are busy
+ # Check if rdomains are busy.
.for n in ${NUMS}
- @if /sbin/ifconfig | grep -v '^lo${n}:' | grep ' rdomain ${n} '; then\
- echo routing domain ${n} is already used >&2; exit 1; fi
+ @if /sbin/ifconfig | grep -v '^lo$n:' | grep ' rdomain $n '; then\
+ echo routing domain $n is already used >&2; exit 1; fi
.endfor
+REGRESS_SETUP_ONCE += ifconfig
ifconfig: unconfig
- # create and configure loopback interfaces
+ # Create and configure loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig lo${n} rdomain ${n}
- ${SUDO} ifconfig lo${n} inet 127.0.0.1/8
- ${SUDO} ifconfig lo${n} inet6 ::1/128
- ${SUDO} ifconfig lo${n} inet ${SRC_TUNNEL4_${n}} alias
- ${SUDO} ifconfig lo${n} inet6 ${SRC_TUNNEL6_${n}} alias
- ${SUDO} route -n -T ${n} add -inet -host ${DST_TUNNEL4_${n}} 127.0.0.1
- ${SUDO} route -n -T ${n} add -inet6 -host ${DST_TUNNEL6_${n}} ::1
- ${SUDO} ifconfig gif${n}4 create rdomain ${n} tunneldomain ${n}
- ${SUDO} ifconfig gif${n}4 tunnel ${SRC_TUNNEL4_${n}} ${DST_TUNNEL4_${n}}
- ${SUDO} ifconfig gif${n}4 inet ${TUNNEL4_SRC_ADDR4_${n}}/32\
- ${TUNNEL4_DST_ADDR4_${n}}
- ${SUDO} ifconfig gif${n}4 inet6 ${TUNNEL4_SRC_ADDR6_${n}}\
- ${TUNNEL4_DST_ADDR6_${n}}
- ${SUDO} ifconfig gif${n}6 create rdomain ${n} tunneldomain ${n}
- ${SUDO} ifconfig gif${n}6 tunnel ${SRC_TUNNEL6_${n}}\
- ${DST_TUNNEL6_${n}}
- ${SUDO} ifconfig gif${n}6 inet ${TUNNEL6_SRC_ADDR4_${n}}/32\
- ${TUNNEL6_DST_ADDR4_${n}}
- ${SUDO} ifconfig gif${n}6 inet6 ${TUNNEL6_SRC_ADDR6_${n}}\
- ${TUNNEL6_DST_ADDR6_${n}}
+ ${SUDO} ifconfig lo$n rdomain $n
+ ${SUDO} ifconfig lo$n inet 127.0.0.1/8
+ ${SUDO} ifconfig lo$n inet6 ::1/128
+ ${SUDO} ifconfig lo$n inet ${SRC_TUNNEL4_$n} alias
+ ${SUDO} ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} alias
+ ${SUDO} route -n -T $n add -inet -host ${DST_TUNNEL4_$n} 127.0.0.1
+ ${SUDO} route -n -T $n add -inet6 -host ${DST_TUNNEL6_$n} ::1
+ ${SUDO} ifconfig gif$n4 create rdomain $n tunneldomain $n
+ ${SUDO} ifconfig gif$n4 tunnel ${SRC_TUNNEL4_$n} ${DST_TUNNEL4_$n}
+ ${SUDO} ifconfig gif$n4 inet ${TUNNEL4_SRC_ADDR4_$n}/32\
+ ${TUNNEL4_DST_ADDR4_$n}
+ ${SUDO} ifconfig gif$n4 inet6 ${TUNNEL4_SRC_ADDR6_$n}\
+ ${TUNNEL4_DST_ADDR6_$n}
+ ${SUDO} ifconfig gif$n6 create rdomain $n tunneldomain $n
+ ${SUDO} ifconfig gif$n6 tunnel ${SRC_TUNNEL6_$n}\
+ ${DST_TUNNEL6_$n}
+ ${SUDO} ifconfig gif$n6 inet ${TUNNEL6_SRC_ADDR4_$n}/32\
+ ${TUNNEL6_DST_ADDR4_$n}
+ ${SUDO} ifconfig gif$n6 inet6 ${TUNNEL6_SRC_ADDR6_$n}\
+ ${TUNNEL6_DST_ADDR6_$n}
.endfor
+ # Wait until DAD for inet6 tunnel addresses has finished.
+ sleep 1
+REGRESS_CLEANUP += unconfig
unconfig:
- # destroy interfaces, keep lo as routing domain cannot be destroyed
+ # Destroy interfaces, keep lo as routing domain cannot be destroyed.
.for n in ${NUMS}
- -${SUDO} ifconfig lo${n} rdomain ${n}
- -${SUDO} ifconfig lo${n} inet 127.0.0.1 delete
- -${SUDO} ifconfig lo${n} inet6 ::1 delete
- -${SUDO} ifconfig lo${n} inet ${SRC_TUNNEL4_${n}} delete
- -${SUDO} ifconfig lo${n} inet6 ${SRC_TUNNEL6_${n}} delete
- -${SUDO} ifconfig gif${n}4 destroy
- -${SUDO} ifconfig gif${n}6 destroy
+ -${SUDO} ifconfig lo$n rdomain $n
+ -${SUDO} ifconfig lo$n inet 127.0.0.1 delete
+ -${SUDO} ifconfig lo$n inet6 ::1 delete
+ -${SUDO} ifconfig lo$n inet ${SRC_TUNNEL4_$n} delete
+ -${SUDO} ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} delete
+ -${SUDO} ifconfig gif$n4 destroy
+ -${SUDO} ifconfig gif$n6 destroy
.endfor
- rm -f stamp-setup
-
-stamp-setup: Makefile
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} busy-rdomains ifconfig
- # wait until DAD for inet6 tunnel addresses has finished
- sleep 1
- date >$@
+ rm -f stamp-ifconfig
-# Create python include file containing the addresses.
addr.py: Makefile
+ # Create python include file containing the addresses.
rm -f $@ $@.tmp
.for N in N1 N2
echo '${N}="${${N}}"' >>$@.tmp
@@ -151,84 +149,68 @@ addr.py: Makefile
.endfor
mv $@.tmp $@
-# Load the pf rules into the kernel.
-stamp-pfctl: addr.py pf.conf stamp-setup
- @echo '\n======== $@ ========'
+REGRESS_SETUP_ONCE += pfctl
+pfctl: addr.py pf.conf
+ # Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
# ifconfig gif inet6 DAD created tunnel states based on old pf rules
${SUDO} /sbin/pfctl -Fs
- @date >$@
.for n in ${N1} ${N2}
-REGRESS_TARGETS += run-regress-ping-local-${n}
-run-regress-ping-local-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping localhost in routing domain ${n}.
- /sbin/ping -n -w 1 -c 1 -V ${n} 127.0.0.1
-
-REGRESS_TARGETS += run-regress-ping-src-${n}
-run-regress-ping-src-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping source address in local routing domain. SRC_TUNNEL4_${n}
- /sbin/ping -n -w 1 -c 1 -V ${n} ${SRC_TUNNEL4_${n}}
-
-REGRESS_TARGETS += run-regress-ping-dst-${n}
-run-regress-ping-dst-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping destination address in other routing domain. DST_TUNNEL4_${n}
- /sbin/ping -n -w 1 -c 1 -V ${n} ${DST_TUNNEL4_${n}}
-
-REGRESS_TARGETS += run-regress-ping-tunnel4-${n}
-run-regress-ping-tunnel4-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping IPv4 address through IPv4 tunnel. TUNNEL4_DST_ADDR4_${n}
- /sbin/ping -n -w 1 -c 1 -V ${n} ${TUNNEL4_DST_ADDR4_${n}}
-
-REGRESS_TARGETS += run-regress-ping-tunnel6-${n}
-run-regress-ping-tunnel6-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping IPv4 address through IPv6 tunnel. TUNNEL6_DST_ADDR4_${n}
- /sbin/ping -n -w 1 -c 1 -V ${n} ${TUNNEL6_DST_ADDR4_${n}}
-
-REGRESS_TARGETS += run-regress-ping6-local-${n}
-run-regress-ping6-local-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping localhost in routing domain ${n}.
- /sbin/ping6 -n -w 1 -c 1 -V ${n} ::1
-
-REGRESS_TARGETS += run-regress-ping6-src-${n}
-run-regress-ping6-src-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping source address in local routing domain. SRC_TUNNEL6_${n}
- /sbin/ping6 -n -w 1 -c 1 -V ${n} ${SRC_TUNNEL6_${n}}
-
-REGRESS_TARGETS += run-regress-ping6-dst-${n}
-run-regress-ping6-dst-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping destination address in other routing domain. DST_TUNNEL6_${n}
- /sbin/ping6 -n -w 1 -c 1 -V ${n} ${DST_TUNNEL6_${n}}
-
-REGRESS_TARGETS += run-regress-ping6-tunnel4-${n}
-run-regress-ping6-tunnel4-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping IPv6 address through IPv4 tunnel. TUNNEL4_DST_ADDR6_${n}
- /sbin/ping6 -n -w 1 -c 1 -V ${n} ${TUNNEL4_DST_ADDR6_${n}}
-
-REGRESS_TARGETS += run-regress-ping6-tunnel6-${n}
-run-regress-ping6-tunnel6-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping IPv6 address through IPv6 tunnel. TUNNEL6_DST_ADDR6_${n}
- /sbin/ping6 -n -w 1 -c 1 -V ${n} ${TUNNEL6_DST_ADDR6_${n}}
+REGRESS_TARGETS += run-ping-local-$n
+run-ping-local-$n:
+ # Ping localhost in routing domain $n.
+ /sbin/ping -n -w 1 -c 1 -V $n 127.0.0.1
+
+REGRESS_TARGETS += run-ping-src-$n
+run-ping-src-$n:
+ # Ping source address in local routing domain. SRC_TUNNEL4_$n
+ /sbin/ping -n -w 1 -c 1 -V $n ${SRC_TUNNEL4_$n}
+
+REGRESS_TARGETS += run-ping-dst-$n
+run-ping-dst-$n:
+ # Ping destination address in other routing domain. DST_TUNNEL4_$n
+ /sbin/ping -n -w 1 -c 1 -V $n ${DST_TUNNEL4_$n}
+
+REGRESS_TARGETS += run-ping-tunnel4-$n
+run-ping-tunnel4-$n:
+ # Ping IPv4 address through IPv4 tunnel. TUNNEL4_DST_ADDR4_$n
+ /sbin/ping -n -w 1 -c 1 -V $n ${TUNNEL4_DST_ADDR4_$n}
+
+REGRESS_TARGETS += run-ping-tunnel6-$n
+run-ping-tunnel6-$n:
+ # Ping IPv4 address through IPv6 tunnel. TUNNEL6_DST_ADDR4_$n
+ /sbin/ping -n -w 1 -c 1 -V $n ${TUNNEL6_DST_ADDR4_$n}
+
+REGRESS_TARGETS += run-ping6-local-$n
+run-ping6-local-$n:
+ # Ping localhost in routing domain $n.
+ /sbin/ping6 -n -w 1 -c 1 -V $n ::1
+
+REGRESS_TARGETS += run-ping6-src-$n
+run-ping6-src-$n:
+ # Ping source address in local routing domain. SRC_TUNNEL6_$n
+ /sbin/ping6 -n -w 1 -c 1 -V $n ${SRC_TUNNEL6_$n}
+
+REGRESS_TARGETS += run-ping6-dst-$n
+run-ping6-dst-$n:
+ # Ping destination address in other routing domain. DST_TUNNEL6_$n
+ /sbin/ping6 -n -w 1 -c 1 -V $n ${DST_TUNNEL6_$n}
+
+REGRESS_TARGETS += run-ping6-tunnel4-$n
+run-ping6-tunnel4-$n:
+ # Ping IPv6 address through IPv4 tunnel. TUNNEL4_DST_ADDR6_$n
+ /sbin/ping6 -n -w 1 -c 1 -V $n ${TUNNEL4_DST_ADDR6_$n}
+
+REGRESS_TARGETS += run-ping6-tunnel6-$n
+run-ping6-tunnel6-$n:
+ # Ping IPv6 address through IPv6 tunnel. TUNNEL6_DST_ADDR6_$n
+ /sbin/ping6 -n -w 1 -c 1 -V $n ${TUNNEL6_DST_ADDR6_$n}
.endfor
-REGRESS_TARGETS += run-regress-cleanup
-run-regress-cleanup:
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} unconfig
-
-CLEANFILES += addr.py *.pyc *.log stamp-*
+CLEANFILES += addr.py *.pyc *.log
.include <bsd.regress.mk>
diff --git a/regress/sys/net/loop/Makefile b/regress/sys/net/loop/Makefile
index 51540d4e83a..708fcecf361 100644
--- a/regress/sys/net/loop/Makefile
+++ b/regress/sys/net/loop/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.6 2020/01/08 21:28:00 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2020/12/17 00:39:42 bluhm Exp $
# Copyright (c) 2017-2020 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -63,42 +63,40 @@ regress:
.endif
-.PHONY: busy-rdomains ifconfig unconfig
+.PHONY: busy-rdomains ifconfig unconfig pfctl
+REGRESS_SETUP_ONCE += busy-rdomains
busy-rdomains:
- # check if rdomains are busy
+ # Check if rdomains are busy.
.for n in ${NUMS}
- @if /sbin/ifconfig | grep -v '^lo${n}:' | grep ' rdomain ${n} '; then\
- echo routing domain ${n} is already used >&2; exit 1; fi
+ @if /sbin/ifconfig | grep -v '^lo$n:' | grep ' rdomain $n '; then\
+ echo routing domain $n is already used >&2; exit 1; fi
.endfor
+REGRESS_SETUP_ONCE += ifconfig
ifconfig: unconfig
- # create and configure loopback interfaces
+ # Create and configure loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig lo${n} rdomain ${n}
- ${SUDO} ifconfig lo${n} inet 127.0.0.1/8
- ${SUDO} ifconfig lo${n} inet 127.0.0.${n} alias
- ${SUDO} route -n -T ${n} add -inet -host 10.6.6.6 127.0.0.1
- ${SUDO} route -n -T ${n} add -inet -host 10.7.7.7 127.0.0.1
+ ${SUDO} ifconfig lo$n rdomain $n
+ ${SUDO} ifconfig lo$n inet 127.0.0.1/8
+ ${SUDO} ifconfig lo$n inet 127.0.0.$n alias
+ ${SUDO} route -n -T $n add -inet -host 10.6.6.6 127.0.0.1
+ ${SUDO} route -n -T $n add -inet -host 10.7.7.7 127.0.0.1
.endfor
${SUDO} route -n -T ${N1} add -inet -host 127.0.0.${N2} 127.0.0.1
${SUDO} route -n -T ${N2} add -inet -host 127.0.0.${N1} 127.0.0.1
-unconfig:
- # destroy interfaces
+REGRESS_CLEANUP += unconfig
+unconfig: stamp-stop
+ # Destroy interfaces.
.for n in ${NUMS}
- -${SUDO} ifconfig lo${n} 127.0.0.1 delete
- -${SUDO} ifconfig lo${n} 127.0.0.${n} delete
+ -${SUDO} ifconfig lo$n 127.0.0.1 delete
+ -${SUDO} ifconfig lo$n 127.0.0.$n delete
.endfor
- rm -f stamp-setup
+ rm -f stamp-ifconfig
-stamp-setup: Makefile
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} busy-rdomains ifconfig
- date >$@
-
-# Create python include file containing the addresses.
addr.py: Makefile
+ # Create python include file containing the addresses.
rm -f $@ $@.tmp
.for var in N1 N2
echo '${var}="${${var}}"' >>$@.tmp
@@ -107,12 +105,11 @@ addr.py: Makefile
.endfor
mv $@.tmp $@
-# Load the pf rules into the kernel.
-stamp-pfctl: addr.py pf.conf stamp-setup
- @echo '\n======== $@ ========'
+REGRESS_SETUP_ONCE += pfctl
+pfctl: addr.py pf.conf
+ # Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
- @date >$@
# run tcpdump on lo devices
DUMPCMD = /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni
@@ -123,18 +120,16 @@ stamp-bpf: stamp-bpf-${N1} stamp-bpf-${N2}
.for n in ${N1} ${N2}
-stamp-bpf-${n}: stamp-setup
- @echo '\n======== $@ ========'
- rm -f lo${n}.tcpdump
- ${SUDO} pkill -f '^${DUMPCMD} lo${n}' || true
- ${SUDO} ${DUMPCMD} lo${n} >lo${n}.tcpdump &
+stamp-bpf-$n: stamp-ifconfig
+ rm -f lo$n.tcpdump
+ ${SUDO} pkill -f '^${DUMPCMD} lo$n' || true
+ ${SUDO} ${DUMPCMD} lo$n >lo$n.tcpdump &
rm -f stamp-stop
@date >$@
.endfor
stamp-stop:
- @echo '\n======== $@ ========'
sleep 2 # XXX
-${SUDO} pkill -f '^${DUMPCMD}'
rm -f stamp-bpf*
@@ -142,66 +137,57 @@ stamp-stop:
.for n in ${N1} ${N2}
-REGRESS_TARGETS += run-regress-ping-local-${n}
-run-regress-ping-local-${n}: stamp-setup stamp-bpf
- @echo '\n======== $@ ========'
- # Ping localhost in routing domain ${n}.
- /sbin/ping -n -w 1 -c 1 -V ${n} 127.0.0.1
+REGRESS_TARGETS += run-ping-local-$n
+run-ping-local-$n: stamp-bpf
+ # Ping localhost in routing domain $n.
+ /sbin/ping -n -w 1 -c 1 -V $n 127.0.0.1
-REGRESS_TARGETS += run-regress-ping-loop-${n}
-run-regress-ping-loop-${n}: stamp-setup stamp-bpf
- @echo '\n======== $@ ========'
- # Ping non existing address with loopback route in routing domain ${n}.
- ! /sbin/ping -n -w 1 -c 1 -V ${n} 10.6.6.6
+REGRESS_TARGETS += run-ping-loop-$n
+run-ping-loop-$n: stamp-bpf
+ # Ping non existing address with loopback route in routing domain $n.
+ ! /sbin/ping -n -w 1 -c 1 -V $n 10.6.6.6
-REGRESS_TARGETS += run-regress-ping-address-${n}
-run-regress-ping-address-${n}: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
- # Ping local address in routing domain ${n}.
- /sbin/ping -n -w 1 -c 1 -V ${n} 127.0.0.${n}
+REGRESS_TARGETS += run-ping-address-$n
+run-ping-address-$n:
+ # Ping local address in routing domain $n.
+ /sbin/ping -n -w 1 -c 1 -V $n 127.0.0.$n
.endfor
-REGRESS_TARGETS += run-regress-ping-rdomain-pass
-run-regress-ping-rdomain-pass: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-ping-rdomain-pass
+run-ping-rdomain-pass:
# Pass ping packets between routing domains with pf rule.
/sbin/ping -n -w 1 -c 1 -V ${N1} 127.0.0.${N2}
-REGRESS_TARGETS += run-regress-ping-rdomain-block
-run-regress-ping-rdomain-block: stamp-setup stamp-pfctl
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-ping-rdomain-block
+run-ping-rdomain-block:
# Check that reverse direction without pf rule is not allowed.
! /sbin/ping -n -w 1 -c 1 -V ${N2} 127.0.0.${N1}
-REGRESS_TARGETS += run-regress-ping-rdomain-loop
-run-regress-ping-rdomain-loop: stamp-setup stamp-pfctl stamp-bpf
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-ping-rdomain-loop
+run-ping-rdomain-loop: stamp-bpf
# Ping non existing address and loop between routing domains.
! /sbin/ping -n -w 1 -c 1 -V ${N1} 10.7.7.7
.for n in ${N1} ${N2}
-REGRESS_TARGETS += run-regress-bpf-local-${n}
-run-regress-bpf-local-${n}: stamp-stop
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-bpf-local-$n
+run-bpf-local-$n: stamp-stop
# Check that the ping packet went through loopback.
- grep '127.0.0.1 > 127.0.0.1: icmp: echo request' lo${n}.tcpdump
+ grep '127.0.0.1 > 127.0.0.1: icmp: echo request' lo$n.tcpdump
-REGRESS_TARGETS += run-regress-bpf-loop-${n}
-run-regress-bpf-loop-${n}: stamp-stop
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-bpf-loop-$n
+run-bpf-loop-$n: stamp-stop
# Check that the ping packet went multiple times through loopback.
grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .*ttl 255,' \
- lo${n}.tcpdump
+ lo$n.tcpdump
grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .* \[ttl 1\]' \
- lo${n}.tcpdump
+ lo$n.tcpdump
.endfor
-REGRESS_TARGETS += run-regress-bpf-rdomain-loop-${N1}
-run-regress-bpf-rdomain-loop-${N1}: stamp-stop
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-bpf-rdomain-loop-${N1}
+run-bpf-rdomain-loop-${N1}: stamp-stop
# Check the ping packet went multiple times in routing domains.
grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 255,' \
lo${N1}.tcpdump
@@ -210,9 +196,8 @@ run-regress-bpf-rdomain-loop-${N1}: stamp-stop
grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .* \[ttl 1\]' \
lo${N1}.tcpdump
-REGRESS_TARGETS += run-regress-bpf-rdomain-loop-${N2}
-run-regress-bpf-rdomain-loop-${N2}: stamp-stop
- @echo '\n======== $@ ========'
+REGRESS_TARGETS += run-bpf-rdomain-loop-${N2}
+run-bpf-rdomain-loop-${N2}: stamp-stop
# Check the ping packet went multiple times in routing domains.
grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 254,' \
lo${N2}.tcpdump
@@ -221,11 +206,6 @@ run-regress-bpf-rdomain-loop-${N2}: stamp-stop
! grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .* \[ttl 1\]' \
lo${N2}.tcpdump
-REGRESS_TARGETS += run-regress-cleanup
-run-regress-cleanup: stamp-stop
- @echo '\n======== $@ ========'
- ${.MAKE} -C ${.CURDIR} unconfig
-
CLEANFILES += addr.py *.pyc *.tcpdump *.log stamp-*
.include <bsd.regress.mk>