]> git.proxmox.com Git - mirror_ovs.git/blob - tests/automake.mk
Add support for connection tracking.
[mirror_ovs.git] / tests / automake.mk
1 EXTRA_DIST += \
2 $(COMMON_MACROS_AT) \
3 $(TESTSUITE_AT) \
4 $(SYSTEM_TESTSUITE_AT) \
5 $(SYSTEM_KMOD_TESTSUITE_AT) \
6 $(SYSTEM_USERSPACE_TESTSUITE_AT) \
7 $(TESTSUITE) \
8 $(SYSTEM_KMOD_TESTSUITE) \
9 $(SYSTEM_USERSPACE_TESTSUITE) \
10 tests/atlocal.in \
11 $(srcdir)/package.m4 \
12 $(srcdir)/tests/testsuite \
13 $(srcdir)/tests/testsuite.patch
14
15 COMMON_MACROS_AT = \
16 tests/ovsdb-macros.at \
17 tests/ovs-macros.at \
18 tests/ofproto-macros.at
19
20 TESTSUITE_AT = \
21 tests/testsuite.at \
22 tests/completion.at \
23 tests/library.at \
24 tests/heap.at \
25 tests/bundle.at \
26 tests/classifier.at \
27 tests/check-structs.at \
28 tests/daemon.at \
29 tests/daemon-py.at \
30 tests/ofp-actions.at \
31 tests/ofp-print.at \
32 tests/ofp-util.at \
33 tests/ofp-errors.at \
34 tests/ovs-ofctl.at \
35 tests/odp.at \
36 tests/mpls-xlate.at \
37 tests/multipath.at \
38 tests/bfd.at \
39 tests/cfm.at \
40 tests/lacp.at \
41 tests/lib.at \
42 tests/learn.at \
43 tests/vconn.at \
44 tests/file_name.at \
45 tests/aes128.at \
46 tests/unixctl-py.at \
47 tests/uuid.at \
48 tests/json.at \
49 tests/jsonrpc.at \
50 tests/jsonrpc-py.at \
51 tests/tunnel.at \
52 tests/tunnel-push-pop.at \
53 tests/lockfile.at \
54 tests/reconnect.at \
55 tests/ovs-vswitchd.at \
56 tests/dpif-netdev.at \
57 tests/dpctl.at \
58 tests/ofproto-dpif.at \
59 tests/bridge.at \
60 tests/vlan-splinters.at \
61 tests/ofproto.at \
62 tests/ovsdb.at \
63 tests/ovsdb-log.at \
64 tests/ovsdb-types.at \
65 tests/ovsdb-data.at \
66 tests/ovsdb-column.at \
67 tests/ovsdb-table.at \
68 tests/ovsdb-row.at \
69 tests/ovsdb-schema.at \
70 tests/ovsdb-condition.at \
71 tests/ovsdb-mutation.at \
72 tests/ovsdb-query.at \
73 tests/ovsdb-transaction.at \
74 tests/ovsdb-execution.at \
75 tests/ovsdb-trigger.at \
76 tests/ovsdb-tool.at \
77 tests/ovsdb-server.at \
78 tests/ovsdb-monitor.at \
79 tests/ovsdb-idl.at \
80 tests/ovs-vsctl.at \
81 tests/ovs-monitor-ipsec.at \
82 tests/ovs-xapi-sync.at \
83 tests/stp.at \
84 tests/rstp.at \
85 tests/interface-reconfigure.at \
86 tests/vlog.at \
87 tests/vtep-ctl.at \
88 tests/auto-attach.at \
89 tests/ovn.at \
90 tests/ovn-nbctl.at \
91 tests/ovn-sbctl.at \
92 tests/ovn-controller.at \
93 tests/ovn-controller-vtep.at
94
95 SYSTEM_KMOD_TESTSUITE_AT = \
96 tests/system-common-macros.at \
97 tests/system-kmod-testsuite.at \
98 tests/system-kmod-macros.at
99
100 SYSTEM_USERSPACE_TESTSUITE_AT = \
101 tests/system-userspace-testsuite.at \
102 tests/system-userspace-macros.at
103
104 SYSTEM_TESTSUITE_AT = \
105 tests/system-common-macros.at \
106 tests/system-traffic.at
107
108 TESTSUITE = $(srcdir)/tests/testsuite
109 TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
110 SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
111 SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
112 DISTCLEANFILES += tests/atconfig tests/atlocal
113
114 AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn:ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller
115
116 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
117 $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
118 \f
119 # Python Coverage support.
120 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
121
122 COVERAGE = coverage
123 COVERAGE_FILE='$(abs_srcdir)/.coverage'
124 check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
125 PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
126 @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
127 @echo
128 @echo '----------------------------------------------------------------------'
129 @echo 'Annotated coverage source has the ",cover" extension.'
130 @echo '----------------------------------------------------------------------'
131 @echo
132 @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
133 \f
134 # valgrind support
135
136 valgrind_wrappers = \
137 tests/valgrind/ovs-appctl \
138 tests/valgrind/ovs-ofctl \
139 tests/valgrind/ovstest \
140 tests/valgrind/ovs-vsctl \
141 tests/valgrind/ovs-vswitchd \
142 tests/valgrind/ovsdb-client \
143 tests/valgrind/ovsdb-server \
144 tests/valgrind/ovsdb-tool \
145 tests/valgrind/test-aes128 \
146 tests/valgrind/test-atomic \
147 tests/valgrind/test-bundle \
148 tests/valgrind/test-byte-order \
149 tests/valgrind/test-classifier \
150 tests/valgrind/test-cmap \
151 tests/valgrind/test-csum \
152 tests/valgrind/test-flows \
153 tests/valgrind/test-hash \
154 tests/valgrind/test-hindex \
155 tests/valgrind/test-hmap \
156 tests/valgrind/test-json \
157 tests/valgrind/test-jsonrpc \
158 tests/valgrind/test-list \
159 tests/valgrind/test-lockfile \
160 tests/valgrind/test-multipath \
161 tests/valgrind/test-odp \
162 tests/valgrind/test-ofpbuf \
163 tests/valgrind/test-ovsdb \
164 tests/valgrind/test-packets \
165 tests/valgrind/test-random \
166 tests/valgrind/test-reconnect \
167 tests/valgrind/test-rstp \
168 tests/valgrind/test-sha1 \
169 tests/valgrind/test-stp \
170 tests/valgrind/test-type-props \
171 tests/valgrind/test-unix-socket \
172 tests/valgrind/test-uuid \
173 tests/valgrind/test-vconn
174
175 $(valgrind_wrappers): tests/valgrind-wrapper.in
176 @test -d tests/valgrind || mkdir tests/valgrind
177 $(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
178 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
179 chmod +x $@.tmp && \
180 mv $@.tmp $@
181 CLEANFILES += $(valgrind_wrappers)
182 EXTRA_DIST += tests/valgrind-wrapper.in
183
184 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
185 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
186 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
187 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
188 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
189 $(valgrind_wrappers) $(check_DATA)
190 $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
191 @echo
192 @echo '----------------------------------------------------------------------'
193 @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
194 @echo '----------------------------------------------------------------------'
195 \f
196 # OFTest support.
197
198 check-oftest: all
199 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest
200 EXTRA_DIST += tests/run-oftest
201
202 # Ryu support.
203 check-ryu: all
204 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu
205 EXTRA_DIST += tests/run-ryu
206 \f
207 # Run kmod tests. Assume kernel modules has been installed or linked into the kernel
208 check-kernel: all tests/atconfig tests/atlocal $(SYSTEM_KMOD_TESTSUITE)
209 $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
210
211 # Testing the out of tree Kernel module
212 check-kmod: all tests/atconfig tests/atlocal $(SYSTEM_KMOD_TESTSUITE)
213 $(MAKE) modules_install
214 modprobe -r openvswitch
215 $(MAKE) check-kernel
216
217 check-system-userspace: all tests/atconfig tests/atlocal $(SYSTEM_USERSPACE_TESTSUITE)
218 $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS)
219
220 clean-local:
221 test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
222
223 AUTOTEST = $(AUTOM4TE) --language=autotest
224
225 if WIN32
226 $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH)
227 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o testsuite.tmp $@.at
228 patch -p0 testsuite.tmp $(TESTSUITE_PATCH)
229 $(AM_V_at)mv testsuite.tmp $@
230 else
231 $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT)
232 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
233 $(AM_V_at)mv $@.tmp $@
234 endif
235
236 $(SYSTEM_KMOD_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT)
237 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
238 $(AM_V_at)mv $@.tmp $@
239
240 $(SYSTEM_USERSPACE_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_USERSPACE_TESTSUITE_AT) $(COMMON_MACROS_AT)
241 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
242 $(AM_V_at)mv $@.tmp $@
243
244 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
245 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
246 $(AM_V_GEN):;{ \
247 echo '# Signature of the current package.' && \
248 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
249 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
250 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
251 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
252 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
253 } >'$(srcdir)/package.m4'
254
255 noinst_PROGRAMS += tests/test-ovsdb
256 tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
257 nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
258 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
259 tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
260
261 noinst_PROGRAMS += tests/test-lib
262 tests_test_lib_SOURCES = \
263 tests/test-lib.c
264 tests_test_lib_LDADD = lib/libopenvswitch.la
265
266 # idltest schema and IDL
267 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
268 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
269 EXTRA_DIST += $(IDLTEST_IDL_FILES) tests/idltest2.ovsschema
270 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
271 $(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \
272 mv $@.tmp $@
273
274 tests/idltest.c: tests/idltest.h
275
276 if DPDK_NETDEV
277 noinst_PROGRAMS += tests/test-dpdkr
278 tests_test_dpdkr_SOURCES = \
279 tests/dpdk/ring_client.c
280 tests_test_dpdkr_LDADD = lib/libopenvswitch.la $(LIBS)
281 endif
282
283 noinst_PROGRAMS += tests/ovstest
284 tests_ovstest_SOURCES = \
285 tests/ovstest.c \
286 tests/ovstest.h \
287 tests/test-aes128.c \
288 tests/test-atomic.c \
289 tests/test-bundle.c \
290 tests/test-byte-order.c \
291 tests/test-classifier.c \
292 tests/test-cmap.c \
293 tests/test-csum.c \
294 tests/test-flows.c \
295 tests/test-hash.c \
296 tests/test-heap.c \
297 tests/test-hindex.c \
298 tests/test-hmap.c \
299 tests/test-json.c \
300 tests/test-jsonrpc.c \
301 tests/test-list.c \
302 tests/test-lockfile.c \
303 tests/test-multipath.c \
304 tests/test-netflow.c \
305 tests/test-odp.c \
306 tests/test-ofpbuf.c \
307 tests/test-ovn.c \
308 tests/test-packets.c \
309 tests/test-random.c \
310 tests/test-reconnect.c \
311 tests/test-rstp.c \
312 tests/test-sflow.c \
313 tests/test-sha1.c \
314 tests/test-stp.c \
315 tests/test-util.c \
316 tests/test-uuid.c \
317 tests/test-bitmap.c \
318 tests/test-vconn.c \
319 tests/test-aa.c
320
321 if !WIN32
322 tests_ovstest_SOURCES += \
323 tests/test-unix-socket.c
324 endif
325
326 tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la
327 dist_check_SCRIPTS = tests/flowgen.pl
328
329 noinst_PROGRAMS += tests/test-strtok_r
330 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
331
332 noinst_PROGRAMS += tests/test-type-props
333 tests_test_type_props_SOURCES = tests/test-type-props.c
334
335 # Python tests.
336 CHECK_PYFILES = \
337 tests/appctl.py \
338 tests/test-daemon.py \
339 tests/test-json.py \
340 tests/test-jsonrpc.py \
341 tests/test-l7.py \
342 tests/test-ovsdb.py \
343 tests/test-reconnect.py \
344 tests/MockXenAPI.py \
345 tests/test-unix-socket.py \
346 tests/test-unixctl.py \
347 tests/test-vlog.py
348 EXTRA_DIST += $(CHECK_PYFILES)
349 PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
350
351 if HAVE_OPENSSL
352 TESTPKI_FILES = \
353 tests/testpki-cacert.pem \
354 tests/testpki-cert.pem \
355 tests/testpki-privkey.pem \
356 tests/testpki-req.pem \
357 tests/testpki-cert2.pem \
358 tests/testpki-privkey2.pem \
359 tests/testpki-req2.pem
360 check_DATA += $(TESTPKI_FILES)
361 CLEANFILES += $(TESTPKI_FILES)
362
363 tests/testpki-cacert.pem: tests/pki/stamp
364 $(AM_V_GEN)cp tests/pki/switchca/cacert.pem $@
365 tests/testpki-cert.pem: tests/pki/stamp
366 $(AM_V_GEN)cp tests/pki/test-cert.pem $@
367 tests/testpki-req.pem: tests/pki/stamp
368 $(AM_V_GEN)cp tests/pki/test-req.pem $@
369 tests/testpki-privkey.pem: tests/pki/stamp
370 $(AM_V_GEN)cp tests/pki/test-privkey.pem $@
371 tests/testpki-cert2.pem: tests/pki/stamp
372 $(AM_V_GEN)cp tests/pki/test2-cert.pem $@
373 tests/testpki-req2.pem: tests/pki/stamp
374 $(AM_V_GEN)cp tests/pki/test2-req.pem $@
375 tests/testpki-privkey2.pem: tests/pki/stamp
376 $(AM_V_GEN)cp tests/pki/test2-privkey.pem $@
377
378 OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
379 tests/pki/stamp:
380 $(AM_V_at)rm -f tests/pki/stamp
381 $(AM_V_at)rm -rf tests/pki
382 $(AM_V_GEN)$(OVS_PKI) init && \
383 $(OVS_PKI) req+sign tests/pki/test && \
384 $(OVS_PKI) req+sign tests/pki/test2 && \
385 : > tests/pki/stamp
386 CLEANFILES += tests/ovs-pki.log
387
388 CLEAN_LOCAL += clean-pki
389 clean-pki:
390 rm -f tests/pki/stamp
391 rm -rf tests/pki
392 endif