-# $OpenBSD: Makefile,v 1.5 2014/10/30 20:41:02 bluhm Exp $
+# $OpenBSD: Makefile,v 1.6 2016/08/29 16:25:14 bluhm Exp $
PROG ?= relay
CFLAGS += -Wall -Werror
copy splice: ${PROG}
ln -s relay $@
+remote-setup:
+.if ! empty (REMOTE_SSH)
+ ssh ${REMOTE_SSH} 'cd ${.CURDIR} && make copy splice'
+.endif
+
.for p in tcp udp
.for r in copy splice
-run-regress-$p-$r: $r
+run-regress-$p-$r: $r remote-setup
@echo '\n======== $@ ========'
-pkill -x tcpbench
.if empty (REMOTE_SSH)
- ./$r ${p:S/tcp//:S/udp/-u/} 12345 localhost 12346 & \
+ ./$r ${p:S/tcp//:S/udp/-u/} -4 12345 127.0.0.1 12346 & \
rpid=$$! ; \
- tcpbench ${p:S/tcp//:S/udp/-u/} -t 7 -s -p 12346 & \
+ tcpbench ${p:S/tcp//:S/udp/-u/} -4 -t 7 -s -p 12346 & \
sleep 1 ; \
- tcpbench ${p:S/tcp//:S/udp/-u/} -t 5 localhost ; \
+ tcpbench ${p:S/tcp//:S/udp/-u/} -4 -t 5 127.0.0.1 ; \
kill $$rpid ; \
pkill -x tcpbench
.else
-pkill -x $r
./$r ${p:S/tcp//:S/udp/-u/} -b ${REMOTE_ADDR} 12345 ${LOCAL_ADDR} 12346 & \
rpid=$$! ; \
- sleep 7 ; \
+ sleep 10 ; \
kill $$rpid
.endfor