forked from outscale/packetgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.mk
301 lines (224 loc) · 9.59 KB
/
tests.mk
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
tests_antispoof_DIR = tests/antispoof
tests_antispoof_SOURCES = \
$(tests_antispoof_DIR)/test-arp-gratuitous.c\
$(tests_antispoof_DIR)/test-arp-response.c\
$(tests_antispoof_DIR)/test-rarp.c\
$(tests_antispoof_DIR)/tests.c
tests_antispoof_OBJECTS = $(tests_antispoof_SOURCES:.c=.o)
tests_core_DIR = tests/core
tests_core_SOURCES = \
$(tests_core_DIR)/test-bitmask.c\
$(tests_core_DIR)/test-core.c\
$(tests_core_DIR)/test-dot.c\
$(tests_core_DIR)/test-flow.c\
$(tests_core_DIR)/test-error.c\
$(tests_core_DIR)/test-mac.c\
$(tests_core_DIR)/test-pkts-count.c\
$(tests_core_DIR)/test-graph.c\
$(tests_core_DIR)/test-hub.c\
$(tests_core_DIR)/tests.c
tests_core_OBJECTS = $(tests_core_SOURCES:.c=.o)
tests_diode_DIR = tests/diode
tests_diode_SOURCES = \
$(tests_diode_DIR)/tests.c
tests_diode_OBJECTS = $(tests_diode_SOURCES:.c=.o)
tests_udp_filter_DIR = tests/udp-filter
tests_udp_filter_SOURCES = \
$(tests_udp_filter_DIR)/tests.c
tests_udp_filter_OBJECTS = $(tests_udp_filter_SOURCES:.c=.o)
tests_accumulator_DIR = tests/accumulator
tests_accumulator_SOURCES = \
$(tests_accumulator_DIR)/tests.c
tests_accumulator_OBJECTS = $(tests_accumulator_SOURCES:.c=.o)
tests_rxtx_DIR = tests/rxtx
tests_rxtx_SOURCES = \
$(tests_rxtx_DIR)/tests.c
tests_rxtx_OBJECTS = $(tests_rxtx_SOURCES:.c=.o)
tests_pmtud_DIR = tests/pmtud
tests_pmtud_SOURCES = \
$(tests_pmtud_DIR)/tests.c
tests_pmtud_OBJECTS = $(tests_pmtud_SOURCES:.c=.o)
tests_integration_DIR = tests/integration
tests_integration_SOURCES = \
$(tests_integration_DIR)/tests.c
tests_integration_OBJECTS = $(tests_integration_SOURCES:.c=.o)
tests_nic_DIR = tests/nic
tests_nic_SOURCES = \
$(tests_nic_DIR)/test-nic.c\
$(tests_nic_DIR)/tests.c
tests_nic_OBJECTS = $(tests_nic_SOURCES:.c=.o)
tests_print_DIR = tests/print
tests_print_SOURCES = \
$(tests_print_DIR)/tests.c
tests_print_OBJECTS = $(tests_print_SOURCES:.c=.o)
tests_queue_DIR = tests/queue
tests_queue_SOURCES = \
$(tests_queue_DIR)/tests.c
tests_queue_OBJECTS = $(tests_queue_SOURCES:.c=.o)
tests_switch_DIR = tests/switch
tests_switch_SOURCES = \
$(tests_switch_DIR)/tests.c
tests_switch_OBJECTS = $(tests_switch_SOURCES:.c=.o)
tests_vhost_DIR = tests/vhost
tests_vhost_SOURCES = \
$(tests_vhost_DIR)/tests.c\
$(tests_vhost_DIR)/test-vhost.c
tests_vhost_OBJECTS = $(tests_vhost_SOURCES:.c=.o)
tests_vtep_DIR = tests/vtep
tests_vtep_SOURCES = \
$(tests_vtep_DIR)/tests.c
tests_vtep_OBJECTS = $(tests_vtep_SOURCES:.c=.o)
tests_tap_DIR = tests/tap
tests_tap_SOURCES = \
$(tests_tap_DIR)/tests.c
tests_tap_OBJECTS = $(tests_tap_SOURCES:.c=.o)
tests_thread_DIR = tests/thread
tests_thread_SOURCES = \
$(tests_thread_DIR)/tests.c
tests_thread_OBJECTS = $(tests_thread_SOURCES:.c=.o)
tests_firewall_DIR = tests/firewall
tests_firewall_SOURCES = \
$(tests_firewall_DIR)/test-icmp.c\
$(tests_firewall_DIR)/tests.c\
$(tests_firewall_DIR)/test-tcp.c
tests_firewall_OBJECTS = $(tests_firewall_SOURCES:.c=.o)
tests_CFLAGS = $(PG_dev_CFLAGS) $(PG_HEADERS)
tests_firewall_CFLAGS = $(tests_CFLAGS) -Wno-address-of-packed-member
tests_LIBS = $(PG_NAME)-dev.a $(PG_LIBADD) -L$(srcdir)/ -ldl -lm -lnuma -lpthread -lpcap -lz
TESTS = \
tests/antispoof/test.sh\
tests/core/test.sh\
tests/diode/test.sh\
tests/accumulator/test.sh\
tests/rxtx/test.sh\
tests/pmtud/test.sh\
tests/firewall/test.sh\
tests/nic/test.sh\
tests/print/test.sh\
tests/queue/test.sh\
tests/switch/test.sh\
tests/vtep/test.sh\
tests/tap/test.sh\
tests/thread/test.sh\
tests/udp-filter/test.sh\
tests/integration/test.sh\
tests/vhost/test.sh
################################################################################
## Tests compilation rules ##
################################################################################
test: dev tests-all-build antispoof core diode rxtx pmtud firewall nic print queue switch vtep tap thread integration udp-filter vhost accumulator
@echo "tests ended"
tests_compile: dev tests-antispoof tests-core tests-diode tests-rxtx tests-pmtud tests-integration tests-nic tests-print tests-queue tests-switch tests-vhost tests-vtep tests-tap tests-thread tests-udp-filter tests-firewall tests-accumulator
@echo "Compilation done"
tests-antispoof: dev $(tests_antispoof_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_antispoof_OBJECTS) $(tests_LIBS) -o $@
$(tests_antispoof_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-core: dev $(tests_core_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_core_OBJECTS) $(tests_LIBS) -o $@
$(tests_core_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-udp-filter: dev $(tests_udp_filter_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_udp_filter_OBJECTS) $(tests_LIBS) -o $@
$(tests_udp_filter_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-diode: dev $(tests_diode_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_diode_OBJECTS) $(tests_LIBS) -o $@
$(tests_diode_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-accumulator: dev $(tests_accumulator_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_accumulator_OBJECTS) $(tests_LIBS) -o $@
$(tests_accumulator_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-rxtx: dev $(tests_rxtx_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_rxtx_OBJECTS) $(tests_LIBS) -o $@
$(tests_rxtx_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-pmtud: dev $(tests_pmtud_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_pmtud_OBJECTS) $(tests_LIBS) -o $@
$(tests_pmtud_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-integration: dev $(tests_integration_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_integration_OBJECTS) $(tests_LIBS) -o $@
$(tests_integration_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-nic: dev $(tests_nic_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_nic_OBJECTS) $(tests_LIBS) -o $@
$(tests_nic_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-print: dev $(tests_print_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_print_OBJECTS) $(tests_LIBS) -o $@
$(tests_print_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-queue: dev $(tests_queue_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_queue_OBJECTS) $(tests_LIBS) -o $@
$(tests_queue_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-switch: dev $(tests_switch_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_switch_OBJECTS) $(tests_LIBS) -o $@
$(tests_switch_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-vhost: dev $(tests_vhost_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_vhost_OBJECTS) $(tests_LIBS) -o $@
$(tests_vhost_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-vtep: dev $(tests_vtep_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_vtep_OBJECTS) $(tests_LIBS) -o $@
$(tests_vtep_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-tap: dev $(tests_tap_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_tap_OBJECTS) $(tests_LIBS) -o $@
$(tests_tap_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-thread: dev $(tests_thread_OBJECTS)
$(CC) $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_thread_OBJECTS) $(tests_LIBS) -o $@
$(tests_thread_OBJECTS): %.o : %.c
$(CC) -c $(tests_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-firewall: dev $(tests_firewall_OBJECTS)
$(CC) $(tests_firewall_CFLAGS) $(PG_ASAN_CFLAGS) $(tests_firewall_OBJECTS) $(tests_LIBS) -o $@
$(tests_firewall_OBJECTS): %.o : %.c
$(CC) -c $(tests_firewall_CFLAGS) $(PG_ASAN_CFLAGS) $< -o $@
tests-all-build: tests-antispoof tests-core tests-rxtx tests-pmtud \
tests-firewall tests-nic tests-print tests-queue tests-switch tests-vtep \
tests-tap tests-thread tests-integration tests-vhost
################################################################################
## Tests execution rules ##
################################################################################
antispoof : tests-antispoof
tests/antispoof/test.sh
core : tests-core
tests/core/test.sh
diode : tests-diode
tests/diode/test.sh
accumulator : tests-accumulator
tests/accumulator/test.sh
rxtx : tests-rxtx
tests/rxtx/test.sh
pmtud : tests-pmtud
tests/pmtud/test.sh
firewall : tests-firewall
tests/firewall/test.sh
nic : tests-nic
tests/nic/test.sh
print : tests-print
tests/print/test.sh
queue : tests-queue
tests/queue/test.sh
switch : tests-switch
tests/switch/test.sh
vtep : tests-vtep
tests/vtep/test.sh
tap : tests-tap
tests/tap/test.sh
thread : tests-thread
tests/thread/test.sh
integration : tests-integration
tests/integration/test.sh
vhost : tests-vhost
tests/vhost/test.sh
udp-filter: udp-filter
tests/udp-filter/test.sh
testclean: testcleanobj
rm -fv tests-antispoof tests-core tests-diode tests-rxtx tests-pmtud tests-firewall tests-nic tests-print tests-queue tests-switch tests-vtep tests-tap tests-thread tests-integration tests-vhost tests-accumulator udp-filter
testcleanobj:
rm -fv $(tests_antispoof_OBJECTS) $(tests_core_OBJECTS) $(tests_diode_OBJECTS) $(tests_rxtx_OBJECTS) $(tests_pmtud_OBJECTS) $(tests_firewall_OBJECTS) $(tests_nic_OBJECTS) $(tests_print_OBJECTS) $(tests_queue_OBJECTS) $(tests_switch_OBJECTS) $(tests_vtep_OBJECTS) $(tests_tap_OBJECTS) $(tests_thread_OBJECTS) $(tests_integration_OBJECTS) $(tests_vhost_OBJECTS) $(tests_accumulator_OBJECTS)