summaryrefslogtreecommitdiff
path: root/regress/sbin/ipsecctl/Makefile
blob: f549374c4f34df19dadd959a91273dd197b5b680 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# $OpenBSD: Makefile,v 1.47 2007/02/19 10:12:45 hshoexer Exp $

# you can update the *.ok files with: make -i | patch
# TARGETS
# ipsec: feed ipsecNN.in through ipsecctl and check wether the output matches
# 	 ipsecNN.ok
# tcpmd5: same as above, but for tcpmd5 rules
# sa:	 same as above, but for SA rules.
# ike:	 same as above, but for ike rules.

IPSECTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
IPSECTESTS+=25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
IPSECTESTS+=51 52 53
TCPMD5TESTS=1 2 3
SATESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
SAFAIL=1 2
IPSECFAIL=1 2
IKEFAIL=1 3 4 5 6 7 8 9 10 11 12
IKETESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IKETESTS+=16 17 18 19 20 21 22 23
IKETESTS+=29 30 31 32 33 34 35 36 37 38 39 40
IKETESTS+=41 42 43 46 47 48 49 50 51 52 53 54 55 56

IKEDELTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IKEDELTESTS+=16 17 18 19 20 21 22 23
IKEDELTESTS+=29 30 31 32 33 34 35 36 37 38 39 40
IKEDELTESTS+=41 42 43 46 47

SHELL=/bin/sh

.MAIN: all

.for n in ${IPSECTESTS}
IPSEC_TARGETS+=ipsec${n}

ipsec${n}:
	cat ${.CURDIR}/ipsec${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nv -f - | diff -u ${.CURDIR}/ipsec${n}.ok /dev/stdin
.endfor

.for n in ${TCPMD5TESTS}
TCPMD5_TARGETS+=tcpmd5${n}

tcpmd5${n}:
	cat ${.CURDIR}/tcpmd5${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nkv -f - | diff -u ${.CURDIR}/tcpmd5${n}.ok /dev/stdin
.endfor

.for n in ${SATESTS}
SA_TARGETS+=sa${n}

sa${n}:
	cat ${.CURDIR}/sa${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -knv -f - | diff -u ${.CURDIR}/sa${n}.ok /dev/stdin
.endfor

.for n in ${SAFAIL}
SAFAIL_TARGETS+=safail${n}

safail${n}:
	cat ${.CURDIR}/safail${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nv -f - 2>&1 | diff -u ${.CURDIR}/safail${n}.ok /dev/stdin
.endfor

.for n in ${IPSECFAIL}
IPSECFAIL_TARGETS+=ipsecfail${n}

ipsecfail${n}:
	cat ${.CURDIR}/ipsecfail${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nv -f - 2>&1 | diff -u ${.CURDIR}/ipsecfail${n}.ok /dev/stdin
.endfor

.for n in ${IKETESTS}
IKE_TARGETS+=ike${n}

ike${n}:
	cat ${.CURDIR}/ike${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nv -f - | diff -u ${.CURDIR}/ike${n}.ok /dev/stdin
.endfor

.for n in ${IKEFAIL}
IKEFAIL_TARGETS+=ikefail${n}

ikefail${n}:
	cat ${.CURDIR}/ikefail${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -nv -f - 2>&1 | diff -u ${.CURDIR}/ikefail${n}.ok /dev/stdin
.endfor

.for n in ${IKEDELTESTS}
IKEDEL_TARGETS+=ikedel${n}

ikedel${n}:
	cat ${.CURDIR}/ikedel${n}.in | sed -e 's,DIR,${.CURDIR},g' | \
	    ipsecctl -dnv -f - | diff -u ${.CURDIR}/ikedel${n}.ok /dev/stdin
.endfor

ipsec:		${IPSEC_TARGETS}
REGRESS_TARGETS+=ipsec

tcpmd5:		${TCPMD5_TARGETS}
REGRESS_TARGETS+=tcpmd5

sa:		${SA_TARGETS}
REGRESS_TARGETS+=sa

safail:		${SAFAIL_TARGETS}
REGRESS_TARGETS+=safail

ipsecfail:	${IPSECFAIL_TARGETS}
REGRESS_TARGETS+=ipsecfail

ike:		${IKE_TARGETS}
REGRESS_TARGETS+=ike

ikefail:	${IKEFAIL_TARGETS}
REGRESS_TARGETS+=ikefail

ikedel:		${IKEDEL_TARGETS}
REGRESS_TARGETS+=ikedel

alltests: ${REGRESS_TARGETS}

.PHONY: ${REGRESS_TARGETS}

.include <bsd.regress.mk>