summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/bgpd/Makefile
blob: 84bc623dafcc7603e22e79eab6493c5180f4a7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# $OpenBSD: Makefile,v 1.3 2018/09/06 15:55:30 benno Exp $

BGPDTESTS=1 2

REGRESS_TARGETS = config

.for n in ${BGPDTESTS}
BGPD_TARGETS+=bgpd${n}
BGPD_UPDATES+=bgpd${n}-update

bgpd${n}:
	bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \
	    sed 's/router-id .*/router-id 127.0.0.1/' | \
	    diff -u ${.CURDIR}/bgpd.conf.${n}.ok /dev/stdin

bgpd${n}-update:
	bgpd -nv -f /dev/stdin < ${.CURDIR}/bgpd.conf.${n}.in | \
	    sed 's/router-id .*/router-id 127.0.0.1/' > \
	    ${.CURDIR}/bgpd.conf.${n}.ok
.endfor

config: bgpd-example bgpd-printconf ${BGPD_TARGETS}
bgpd-update: ${BGPD_UPDATES}

# check that the example configuration file we ship is ok
bgpd-example:
	bgpd -nf ${.CURDIR}/../../../etc/examples/bgpd.conf

# check that the output of bgpd -nvv is parseable
bgpd-printconf:
	bgpd -nvf ${.CURDIR}/bgpd.conf.printconf | \
	    bgpd -nf /dev/stdin

clean:
	rm -f bgpd.conf.printconf.test

.include <bsd.regress.mk>