]> git.proxmox.com Git - mirror_ovs.git/blame - tests/automake.mk
netdev-dpdk: Show Rx checksum status when false.
[mirror_ovs.git] / tests / automake.mk
CommitLineData
1b233b95 1EXTRA_DIST += \
69c2bdfe 2 $(COMMON_MACROS_AT) \
1b233b95 3 $(TESTSUITE_AT) \
d7c5426b 4 $(SYSTEM_TESTSUITE_AT) \
f7526200 5 $(SYSTEM_KMOD_TESTSUITE_AT) \
d7c5426b 6 $(SYSTEM_USERSPACE_TESTSUITE_AT) \
1b233b95 7 $(TESTSUITE) \
f7526200 8 $(SYSTEM_KMOD_TESTSUITE) \
d7c5426b 9 $(SYSTEM_USERSPACE_TESTSUITE) \
1b233b95
BP
10 tests/atlocal.in \
11 $(srcdir)/package.m4 \
ddd347c2
GS
12 $(srcdir)/tests/testsuite \
13 $(srcdir)/tests/testsuite.patch
69c2bdfe
AZ
14
15COMMON_MACROS_AT = \
24c8ae53 16 tests/ovsdb-macros.at \
02e6f2f7 17 tests/ovs-macros.at \
69c2bdfe
AZ
18 tests/ofproto-macros.at
19
20TESTSUITE_AT = \
21 tests/testsuite.at \
08d42548 22 tests/completion.at \
1b233b95 23 tests/library.at \
95974447 24 tests/heap.at \
daff3353 25 tests/bundle.at \
3223e977 26 tests/classifier.at \
05b3c97b 27 tests/check-structs.at \
ff8decf1 28 tests/daemon.at \
99155935 29 tests/daemon-py.at \
f25d0cf3 30 tests/ofp-actions.at \
fec00620 31 tests/ofp-print.at \
681ea7a0 32 tests/ofp-util.at \
2e0525bc 33 tests/ofp-errors.at \
0e581146 34 tests/ovs-ofctl.at \
3bffc610 35 tests/odp.at \
5af43325 36 tests/mpls-xlate.at \
53ddd40a 37 tests/multipath.at \
015cf297 38 tests/bfd.at \
03f209ba 39 tests/cfm.at \
742468d9 40 tests/lacp.at \
acf72f13 41 tests/lib.at \
75a75043 42 tests/learn.at \
d27ce529 43 tests/vconn.at \
e1aff6f9 44 tests/file_name.at \
d918d9d1 45 tests/aes128.at \
0a68ffd2 46 tests/unixctl-py.at \
d918d9d1 47 tests/uuid.at \
f38b84ea 48 tests/json.at \
f2129093 49 tests/jsonrpc.at \
99155935 50 tests/jsonrpc-py.at \
589dd1d5 51 tests/pmd.at \
0f538378 52 tests/tunnel.at \
a36de779 53 tests/tunnel-push-pop.at \
2af602f2 54 tests/tunnel-push-pop-ipv6.at \
4e08f54b 55 tests/ovs-router.at \
ac718c9d 56 tests/lockfile.at \
3ed497fc 57 tests/reconnect.at \
b7898031 58 tests/ovs-vswitchd.at \
9c4044a5 59 tests/dpif-netdev.at \
5acf2e91 60 tests/dpctl.at \
29901626 61 tests/ofproto-dpif.at \
c40b890f 62 tests/bridge.at \
a2cb9dfd 63 tests/ofproto.at \
a5bdd3b2 64 tests/netdev-type.at \
f85f8ebb 65 tests/ovsdb.at \
41709ccc 66 tests/ovsdb-log.at \
f85f8ebb
BP
67 tests/ovsdb-types.at \
68 tests/ovsdb-data.at \
69 tests/ovsdb-column.at \
70 tests/ovsdb-table.at \
71 tests/ovsdb-row.at \
0d0f05b9 72 tests/ovsdb-schema.at \
f85f8ebb 73 tests/ovsdb-condition.at \
e9f8f936 74 tests/ovsdb-mutation.at \
f85f8ebb
BP
75 tests/ovsdb-query.at \
76 tests/ovsdb-transaction.at \
77 tests/ovsdb-execution.at \
78 tests/ovsdb-trigger.at \
1e19e50e 79 tests/ovsdb-tool.at \
7a9d65d2 80 tests/ovsdb-replication.at \
21ff1aee 81 tests/ovsdb-server.at \
a8425c53 82 tests/ovsdb-monitor.at \
c3bb4bd7 83 tests/ovsdb-idl.at \
0ec19def 84 tests/ovsdb-lock.at \
48d014bf 85 tests/ovs-vsctl.at \
1b0fdca5 86 tests/ovs-xapi-sync.at \
829a7d02 87 tests/stp.at \
9efd308e 88 tests/rstp.at \
8ed182d8 89 tests/interface-reconfigure.at \
ffc759c6 90 tests/vlog.at \
99eef98b 91 tests/vtep-ctl.at \
10b1662b 92 tests/auto-attach.at \
fed00ab1 93 tests/ovn.at \
f4e38e30 94 tests/ovn-nbctl.at \
00db2a60 95 tests/ovn-sbctl.at \
caad1387 96 tests/ovn-controller.at \
94a881c1
RD
97 tests/ovn-controller-vtep.at \
98 tests/mcast-snooping.at
69c2bdfe 99
f7526200
DDP
100SYSTEM_KMOD_TESTSUITE_AT = \
101 tests/system-common-macros.at \
102 tests/system-kmod-testsuite.at \
d7c5426b
DDP
103 tests/system-kmod-macros.at
104
105SYSTEM_USERSPACE_TESTSUITE_AT = \
106 tests/system-userspace-testsuite.at \
cc08428b 107 tests/system-ovn.at \
d7c5426b
DDP
108 tests/system-userspace-macros.at
109
110SYSTEM_TESTSUITE_AT = \
111 tests/system-common-macros.at \
cc08428b 112 tests/system-ovn.at \
f7526200 113 tests/system-traffic.at
69c2bdfe 114
d4f531ce
BP
115check_SCRIPTS += tests/atlocal
116
1b233b95 117TESTSUITE = $(srcdir)/tests/testsuite
ddd347c2 118TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
f7526200 119SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
d7c5426b 120SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
7fe079c2 121DISTCLEANFILES += tests/atconfig tests/atlocal
1b233b95 122
72eaa2ba 123AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller
7c126fbb 124
a8cb4562 125check-local:
0d3f2152
BP
126 set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
127 "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
7c126fbb 128\f
79982e90
EJ
129# Python Coverage support.
130# Requires coverage.py http://nedbatchelder.com/code/coverage/.
131
132COVERAGE = coverage
133COVERAGE_FILE='$(abs_srcdir)/.coverage'
a8cb4562 134check-pycov: all clean-pycov
853d1083 135 PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
79982e90
EJ
136 @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
137 @echo
138 @echo '----------------------------------------------------------------------'
139 @echo 'Annotated coverage source has the ",cover" extension.'
140 @echo '----------------------------------------------------------------------'
141 @echo
142 @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
143\f
27de40d0
LR
144# lcov support
145# Requires build with --enable-coverage and lcov/genhtml in $PATH
146CLEAN_LOCAL += clean-lcov
147clean-lcov:
148 rm -fr tests/lcov
149
150LCOV_OPTS = -b $(abs_top_builddir) -d $(abs_top_builddir) -q -c --rc lcov_branch_coverage=1
151GENHTML_OPTS = -q --branch-coverage --num-spaces 4
a8cb4562 152check-lcov: all $(check_DATA) clean-lcov
27de40d0
LR
153 find . -name '*.gcda' | xargs -n1 rm -f
154 -set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
155 "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
156 mkdir -p tests/lcov
157 lcov $(LCOV_OPTS) -o tests/lcov/coverage.info
158 genhtml $(GENHTML_OPTS) -o tests/lcov tests/lcov/coverage.info
159 @echo "coverage report generated at tests/lcov/index.html"
160\f
b6fa4447
BP
161# valgrind support
162
163valgrind_wrappers = \
85ad3f01
GS
164 tests/valgrind/ovn-controller \
165 tests/valgrind/ovn-nbctl \
166 tests/valgrind/ovn-northd \
167 tests/valgrind/ovn-sbctl \
b6fa4447 168 tests/valgrind/ovs-appctl \
9f19a2a3 169 tests/valgrind/ovs-ofctl \
b6fa4447 170 tests/valgrind/ovs-vsctl \
b0f7b9b5 171 tests/valgrind/ovs-vswitchd \
b6fa4447
BP
172 tests/valgrind/ovsdb-client \
173 tests/valgrind/ovsdb-server \
174 tests/valgrind/ovsdb-tool \
7c1abc45 175 tests/valgrind/ovstest \
b6fa4447 176 tests/valgrind/test-ovsdb \
7c1abc45
BP
177 tests/valgrind/test-strtok_r \
178 tests/valgrind/test-type-props
b6fa4447
BP
179
180$(valgrind_wrappers): tests/valgrind-wrapper.in
181 @test -d tests/valgrind || mkdir tests/valgrind
ef44aa50
BP
182 $(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
183 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
184 chmod +x $@.tmp && \
b6fa4447
BP
185 mv $@.tmp $@
186CLEANFILES += $(valgrind_wrappers)
187EXTRA_DIST += tests/valgrind-wrapper.in
188
189VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
75b87ae5 190 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
b6fa4447 191 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
5bdcef15
WT
192HELGRIND = valgrind --log-file=helgrind.%p --tool=helgrind \
193 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
194 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
75b87ae5 195EXTRA_DIST += tests/glibc.supp tests/openssl.supp
a8cb4562 196check-valgrind: all $(valgrind_wrappers) $(check_DATA)
b6fa4447
BP
197 $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
198 @echo
199 @echo '----------------------------------------------------------------------'
200 @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
201 @echo '----------------------------------------------------------------------'
a8cb4562 202check-helgrind: all $(valgrind_wrappers) $(check_DATA)
5bdcef15
WT
203 -$(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(HELGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
204
b6fa4447 205\f
81a114e5
BP
206# OFTest support.
207
208check-oftest: all
ef44aa50 209 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest
81a114e5 210EXTRA_DIST += tests/run-oftest
e3c7ed29
BP
211
212# Ryu support.
213check-ryu: all
ef44aa50 214 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu
e3c7ed29 215EXTRA_DIST += tests/run-ryu
81a114e5 216\f
69c2bdfe 217# Run kmod tests. Assume kernel modules has been installed or linked into the kernel
a8cb4562 218check-kernel: all
ed71ac3e
LR
219 set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS) -j1; \
220 "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
69c2bdfe
AZ
221
222# Testing the out of tree Kernel module
a8cb4562 223check-kmod: all
69c2bdfe 224 $(MAKE) modules_install
6b2b949a 225 modprobe -r -a vport-geneve vport-gre vport-lisp vport-stt vport-vxlan openvswitch
69c2bdfe
AZ
226 $(MAKE) check-kernel
227
a8cb4562 228check-system-userspace: all
4a1cdbcb
LR
229 set $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS) -j1; \
230 "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
d7c5426b 231
1b233b95
BP
232clean-local:
233 test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
234
1b233b95 235AUTOTEST = $(AUTOM4TE) --language=autotest
83e09b5d
GS
236
237if WIN32
ddd347c2 238$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH)
dcd03218
FL
239 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o testsuite.tmp $@.at
240 patch -p0 testsuite.tmp $(TESTSUITE_PATCH)
241 $(AM_V_at)mv testsuite.tmp $@
83e09b5d
GS
242else
243$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT)
244 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
245 $(AM_V_at)mv $@.tmp $@
246endif
69c2bdfe 247
d7c5426b
DDP
248$(SYSTEM_KMOD_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT)
249 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
250 $(AM_V_at)mv $@.tmp $@
251
252$(SYSTEM_USERSPACE_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_USERSPACE_TESTSUITE_AT) $(COMMON_MACROS_AT)
ef44aa50
BP
253 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
254 $(AM_V_at)mv $@.tmp $@
1b233b95
BP
255
256# The `:;' works around a Bash 3.2 bug when the output is not writeable.
257$(srcdir)/package.m4: $(top_srcdir)/configure.ac
ef44aa50 258 $(AM_V_GEN):;{ \
1b233b95 259 echo '# Signature of the current package.' && \
f99cd6ee
BP
260 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
261 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
262 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
263 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
264 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
1b233b95
BP
265 } >'$(srcdir)/package.m4'
266
f85f8ebb 267noinst_PROGRAMS += tests/test-ovsdb
90ffd534
BP
268tests_test_ovsdb_SOURCES = tests/test-ovsdb.c
269nodist_tests_test_ovsdb_SOURCES = tests/idltest.c tests/idltest.h
7360012b 270EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
96d87817 271tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
00732bf5 272
acf72f13
TG
273noinst_PROGRAMS += tests/test-lib
274tests_test_lib_SOURCES = \
275 tests/test-lib.c
276tests_test_lib_LDADD = lib/libopenvswitch.la
277
00732bf5 278# idltest schema and IDL
2c84fdf2 279OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
00732bf5 280IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
d18e52e3 281EXTRA_DIST += $(IDLTEST_IDL_FILES) tests/idltest2.ovsschema
00732bf5 282tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
ef44aa50 283 $(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \
00732bf5
BP
284 mv $@.tmp $@
285
b0fc010a 286tests/idltest.c: tests/idltest.h
f85f8ebb 287
95fb793a 288if DPDK_NETDEV
e96981de
SF
289noinst_PROGRAMS += tests/test-dpdkr
290tests_test_dpdkr_SOURCES = \
291 tests/dpdk/ring_client.c
292tests_test_dpdkr_LDADD = lib/libopenvswitch.la $(LIBS)
95fb793a 293endif
294
3932d8db 295noinst_PROGRAMS += tests/ovstest
eadd1644
AZ
296tests_ovstest_SOURCES = \
297 tests/ovstest.c \
298 tests/ovstest.h \
299 tests/test-aes128.c \
300 tests/test-atomic.c \
301 tests/test-bundle.c \
302 tests/test-byte-order.c \
303 tests/test-classifier.c \
1c4dd424 304 tests/test-ccmap.c \
0e666160 305 tests/test-cmap.c \
8cb14626 306 tests/test-conntrack.c \
eadd1644 307 tests/test-csum.c \
eadd1644
AZ
308 tests/test-flows.c \
309 tests/test-hash.c \
310 tests/test-heap.c \
311 tests/test-hindex.c \
312 tests/test-hmap.c \
313 tests/test-json.c \
314 tests/test-jsonrpc.c \
315 tests/test-list.c \
316 tests/test-lockfile.c \
317 tests/test-multipath.c \
318 tests/test-netflow.c \
319 tests/test-odp.c \
38876d31 320 tests/test-ofpbuf.c \
10b1662b 321 tests/test-ovn.c \
eadd1644
AZ
322 tests/test-packets.c \
323 tests/test-random.c \
13b6d087 324 tests/test-rcu.c \
eadd1644 325 tests/test-reconnect.c \
9efd308e 326 tests/test-rstp.c \
eadd1644
AZ
327 tests/test-sflow.c \
328 tests/test-sha1.c \
329 tests/test-stp.c \
3c016b8b 330 tests/test-unixctl.c \
eadd1644
AZ
331 tests/test-util.c \
332 tests/test-uuid.c \
f831a472 333 tests/test-bitmap.c \
99eef98b
DF
334 tests/test-vconn.c \
335 tests/test-aa.c
7882cfb1
GS
336
337if !WIN32
338tests_ovstest_SOURCES += \
339 tests/test-unix-socket.c
340endif
341
2c06d9a9
DDP
342if LINUX
343tests_ovstest_SOURCES += \
344 tests/test-netlink-conntrack.c
345endif
346
10b1662b 347tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la
eadd1644 348dist_check_SCRIPTS = tests/flowgen.pl
d138cd2c 349
78f172aa
BP
350noinst_PROGRAMS += tests/test-strtok_r
351tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
352
064af421
BP
353noinst_PROGRAMS += tests/test-type-props
354tests_test_type_props_SOURCES = tests/test-type-props.c
355
99155935 356# Python tests.
79982e90 357CHECK_PYFILES = \
0a68ffd2 358 tests/appctl.py \
99155935
BP
359 tests/test-daemon.py \
360 tests/test-json.py \
361 tests/test-jsonrpc.py \
07659514 362 tests/test-l7.py \
99155935 363 tests/test-ovsdb.py \
1b0fdca5 364 tests/test-reconnect.py \
8ed182d8 365 tests/MockXenAPI.py \
cd57233c 366 tests/test-unix-socket.py \
0a68ffd2 367 tests/test-unixctl.py \
8ed182d8 368 tests/test-vlog.py
79982e90
EJ
369EXTRA_DIST += $(CHECK_PYFILES)
370PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
15b619e2 371
115d8719
RB
372FLAKE8_PYFILES += $(CHECK_PYFILES)
373
15b619e2
BP
374if HAVE_OPENSSL
375TESTPKI_FILES = \
376 tests/testpki-cacert.pem \
377 tests/testpki-cert.pem \
378 tests/testpki-privkey.pem \
379 tests/testpki-req.pem \
380 tests/testpki-cert2.pem \
381 tests/testpki-privkey2.pem \
382 tests/testpki-req2.pem
383check_DATA += $(TESTPKI_FILES)
384CLEANFILES += $(TESTPKI_FILES)
385
ef44aa50
BP
386tests/testpki-cacert.pem: tests/pki/stamp
387 $(AM_V_GEN)cp tests/pki/switchca/cacert.pem $@
388tests/testpki-cert.pem: tests/pki/stamp
389 $(AM_V_GEN)cp tests/pki/test-cert.pem $@
390tests/testpki-req.pem: tests/pki/stamp
391 $(AM_V_GEN)cp tests/pki/test-req.pem $@
392tests/testpki-privkey.pem: tests/pki/stamp
393 $(AM_V_GEN)cp tests/pki/test-privkey.pem $@
394tests/testpki-cert2.pem: tests/pki/stamp
395 $(AM_V_GEN)cp tests/pki/test2-cert.pem $@
396tests/testpki-req2.pem: tests/pki/stamp
397 $(AM_V_GEN)cp tests/pki/test2-req.pem $@
398tests/testpki-privkey2.pem: tests/pki/stamp
399 $(AM_V_GEN)cp tests/pki/test2-privkey.pem $@
15b619e2
BP
400
401OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
402tests/pki/stamp:
ef44aa50
BP
403 $(AM_V_at)rm -f tests/pki/stamp
404 $(AM_V_at)rm -rf tests/pki
405 $(AM_V_GEN)$(OVS_PKI) init && \
406 $(OVS_PKI) req+sign tests/pki/test && \
407 $(OVS_PKI) req+sign tests/pki/test2 && \
15b619e2
BP
408 : > tests/pki/stamp
409CLEANFILES += tests/ovs-pki.log
410
411CLEAN_LOCAL += clean-pki
412clean-pki:
413 rm -f tests/pki/stamp
414 rm -rf tests/pki
415endif