]> git.proxmox.com Git - ovs.git/blame - tests/automake.mk
unit-test: Improve ovstest user interface
[ovs.git] / tests / automake.mk
CommitLineData
1b233b95
BP
1EXTRA_DIST += \
2 $(TESTSUITE_AT) \
3 $(TESTSUITE) \
4 tests/atlocal.in \
5 $(srcdir)/package.m4 \
6 $(srcdir)/tests/testsuite
7TESTSUITE_AT = \
8 tests/testsuite.at \
24c8ae53 9 tests/ovsdb-macros.at \
1b233b95 10 tests/library.at \
95974447 11 tests/heap.at \
daff3353 12 tests/bundle.at \
3223e977 13 tests/classifier.at \
05b3c97b 14 tests/check-structs.at \
ff8decf1 15 tests/daemon.at \
99155935 16 tests/daemon-py.at \
f25d0cf3 17 tests/ofp-actions.at \
fec00620 18 tests/ofp-print.at \
681ea7a0 19 tests/ofp-util.at \
2e0525bc 20 tests/ofp-errors.at \
0e581146 21 tests/ovs-ofctl.at \
3bffc610 22 tests/odp.at \
53ddd40a 23 tests/multipath.at \
015cf297 24 tests/bfd.at \
03f209ba 25 tests/cfm.at \
742468d9 26 tests/lacp.at \
75a75043 27 tests/learn.at \
d27ce529 28 tests/vconn.at \
e1aff6f9 29 tests/file_name.at \
d918d9d1 30 tests/aes128.at \
0a68ffd2 31 tests/unixctl-py.at \
d918d9d1 32 tests/uuid.at \
f38b84ea 33 tests/json.at \
f2129093 34 tests/jsonrpc.at \
99155935 35 tests/jsonrpc-py.at \
0f538378 36 tests/tunnel.at \
ac718c9d 37 tests/lockfile.at \
3ed497fc 38 tests/reconnect.at \
b7898031 39 tests/ovs-vswitchd.at \
29901626 40 tests/ofproto-dpif.at \
1c3e353d 41 tests/vlan-splinters.at \
0fbc9f11 42 tests/ofproto-macros.at \
a2cb9dfd 43 tests/ofproto.at \
f85f8ebb 44 tests/ovsdb.at \
41709ccc 45 tests/ovsdb-log.at \
f85f8ebb
BP
46 tests/ovsdb-types.at \
47 tests/ovsdb-data.at \
48 tests/ovsdb-column.at \
49 tests/ovsdb-table.at \
50 tests/ovsdb-row.at \
0d0f05b9 51 tests/ovsdb-schema.at \
f85f8ebb 52 tests/ovsdb-condition.at \
e9f8f936 53 tests/ovsdb-mutation.at \
f85f8ebb
BP
54 tests/ovsdb-query.at \
55 tests/ovsdb-transaction.at \
56 tests/ovsdb-execution.at \
57 tests/ovsdb-trigger.at \
1e19e50e 58 tests/ovsdb-tool.at \
21ff1aee 59 tests/ovsdb-server.at \
a8425c53 60 tests/ovsdb-monitor.at \
c3bb4bd7 61 tests/ovsdb-idl.at \
48d014bf 62 tests/ovs-vsctl.at \
b54bdbe9 63 tests/ovs-monitor-ipsec.at \
1b0fdca5 64 tests/ovs-xapi-sync.at \
829a7d02 65 tests/stp.at \
8ed182d8 66 tests/interface-reconfigure.at \
ffc759c6
JP
67 tests/vlog.at \
68 tests/vtep-ctl.at
1b233b95 69TESTSUITE = $(srcdir)/tests/testsuite
7fe079c2 70DISTCLEANFILES += tests/atconfig tests/atlocal
1b233b95 71
ffc759c6 72AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests
7c126fbb 73
1b233b95 74check-local: tests/atconfig tests/atlocal $(TESTSUITE)
7c126fbb
BP
75 $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
76\f
79982e90
EJ
77# Python Coverage support.
78# Requires coverage.py http://nedbatchelder.com/code/coverage/.
79
80COVERAGE = coverage
81COVERAGE_FILE='$(abs_srcdir)/.coverage'
82check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
853d1083 83 PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
79982e90
EJ
84 @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
85 @echo
86 @echo '----------------------------------------------------------------------'
87 @echo 'Annotated coverage source has the ",cover" extension.'
88 @echo '----------------------------------------------------------------------'
89 @echo
90 @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
91\f
b6fa4447
BP
92# valgrind support
93
94valgrind_wrappers = \
95 tests/valgrind/ovs-appctl \
9f19a2a3 96 tests/valgrind/ovs-ofctl \
3932d8db 97 tests/valgrind/ovstest \
b6fa4447 98 tests/valgrind/ovs-vsctl \
b0f7b9b5 99 tests/valgrind/ovs-vswitchd \
b6fa4447
BP
100 tests/valgrind/ovsdb-client \
101 tests/valgrind/ovsdb-server \
102 tests/valgrind/ovsdb-tool \
103 tests/valgrind/test-aes128 \
31a3fc6e 104 tests/valgrind/test-atomic \
daff3353 105 tests/valgrind/test-bundle \
10a24935 106 tests/valgrind/test-byte-order \
b6fa4447
BP
107 tests/valgrind/test-classifier \
108 tests/valgrind/test-csum \
e1aff6f9 109 tests/valgrind/test-file_name \
b6fa4447
BP
110 tests/valgrind/test-flows \
111 tests/valgrind/test-hash \
822b7f52 112 tests/valgrind/test-hindex \
b6fa4447
BP
113 tests/valgrind/test-hmap \
114 tests/valgrind/test-json \
115 tests/valgrind/test-jsonrpc \
116 tests/valgrind/test-list \
117 tests/valgrind/test-lockfile \
53ddd40a 118 tests/valgrind/test-multipath \
3bffc610 119 tests/valgrind/test-odp \
b6fa4447 120 tests/valgrind/test-ovsdb \
f696f12f 121 tests/valgrind/test-packets \
78f3f316 122 tests/valgrind/test-random \
b6fa4447
BP
123 tests/valgrind/test-reconnect \
124 tests/valgrind/test-sha1 \
829a7d02 125 tests/valgrind/test-stp \
b6fa4447 126 tests/valgrind/test-type-props \
6e170b4c 127 tests/valgrind/test-unix-socket \
b6fa4447 128 tests/valgrind/test-uuid \
10a24935 129 tests/valgrind/test-vconn
b6fa4447
BP
130
131$(valgrind_wrappers): tests/valgrind-wrapper.in
132 @test -d tests/valgrind || mkdir tests/valgrind
133 sed -e 's,[@]wrap_program[@],$@,' \
134 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
135 chmod +x $@.tmp
136 mv $@.tmp $@
137CLEANFILES += $(valgrind_wrappers)
138EXTRA_DIST += tests/valgrind-wrapper.in
139
140VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
75b87ae5 141 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
b6fa4447 142 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
75b87ae5 143EXTRA_DIST += tests/glibc.supp tests/openssl.supp
16496eea
BP
144check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
145 $(valgrind_wrappers) $(check_DATA)
b6fa4447
BP
146 $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
147 @echo
148 @echo '----------------------------------------------------------------------'
149 @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
150 @echo '----------------------------------------------------------------------'
151\f
81a114e5
BP
152# OFTest support.
153
154check-oftest: all
155 srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest
156EXTRA_DIST += tests/run-oftest
e3c7ed29
BP
157
158# Ryu support.
159check-ryu: all
160 srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu
161EXTRA_DIST += tests/run-ryu
81a114e5 162\f
1b233b95
BP
163clean-local:
164 test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
165
1b233b95
BP
166AUTOTEST = $(AUTOM4TE) --language=autotest
167$(TESTSUITE): package.m4 $(TESTSUITE_AT)
168 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
169 mv $@.tmp $@
170
171# The `:;' works around a Bash 3.2 bug when the output is not writeable.
172$(srcdir)/package.m4: $(top_srcdir)/configure.ac
173 :;{ \
174 echo '# Signature of the current package.' && \
f99cd6ee
BP
175 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
176 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
177 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
178 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
179 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
1b233b95
BP
180 } >'$(srcdir)/package.m4'
181
d918d9d1
BP
182noinst_PROGRAMS += tests/test-aes128
183tests_test_aes128_SOURCES = tests/test-aes128.c
96d87817 184tests_test_aes128_LDADD = lib/libopenvswitch.la
d918d9d1 185
31a3fc6e
BP
186noinst_PROGRAMS += tests/test-atomic
187tests_test_atomic_SOURCES = tests/test-atomic.c
96d87817 188tests_test_atomic_LDADD = lib/libopenvswitch.la
31a3fc6e 189
daff3353
EJ
190noinst_PROGRAMS += tests/test-bundle
191tests_test_bundle_SOURCES = tests/test-bundle.c
96d87817 192tests_test_bundle_LDADD = lib/libopenvswitch.la
daff3353 193
064af421
BP
194noinst_PROGRAMS += tests/test-classifier
195tests_test_classifier_SOURCES = tests/test-classifier.c
96d87817 196tests_test_classifier_LDADD = lib/libopenvswitch.la
064af421 197
1d5aaa61
BP
198noinst_PROGRAMS += tests/test-controller
199MAN_ROOTS += tests/test-controller.8.in
6a62a162 200DISTCLEANFILES += tests/test-controller.8
1d5aaa61
BP
201noinst_man_MANS += tests/test-controller.8
202tests_test_controller_SOURCES = tests/test-controller.c
96d87817 203tests_test_controller_LDADD = lib/libopenvswitch.la
1d5aaa61 204
21effc03
BP
205noinst_PROGRAMS += tests/test-csum
206tests_test_csum_SOURCES = tests/test-csum.c
96d87817 207tests_test_csum_LDADD = lib/libopenvswitch.la
21effc03 208
e1aff6f9
BP
209noinst_PROGRAMS += tests/test-file_name
210tests_test_file_name_SOURCES = tests/test-file_name.c
96d87817 211tests_test_file_name_LDADD = lib/libopenvswitch.la
29d4af60 212
064af421
BP
213noinst_PROGRAMS += tests/test-flows
214tests_test_flows_SOURCES = tests/test-flows.c
96d87817 215tests_test_flows_LDADD = lib/libopenvswitch.la
1b233b95 216dist_check_SCRIPTS = tests/flowgen.pl
064af421 217
064af421
BP
218noinst_PROGRAMS += tests/test-hash
219tests_test_hash_SOURCES = tests/test-hash.c
38b7a52b 220tests_test_hash_LDADD = lib/libopenvswitch.la
064af421 221
822b7f52
BP
222noinst_PROGRAMS += tests/test-hindex
223tests_test_hindex_SOURCES = tests/test-hindex.c
96d87817 224tests_test_hindex_LDADD = lib/libopenvswitch.la
822b7f52 225
064af421
BP
226noinst_PROGRAMS += tests/test-hmap
227tests_test_hmap_SOURCES = tests/test-hmap.c
96d87817 228tests_test_hmap_LDADD = lib/libopenvswitch.la
064af421 229
f38b84ea
BP
230noinst_PROGRAMS += tests/test-json
231tests_test_json_SOURCES = tests/test-json.c
96d87817 232tests_test_json_LDADD = lib/libopenvswitch.la
f38b84ea 233
f2129093
BP
234noinst_PROGRAMS += tests/test-jsonrpc
235tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
96d87817 236tests_test_jsonrpc_LDADD = lib/libopenvswitch.la
f2129093 237
064af421
BP
238noinst_PROGRAMS += tests/test-list
239tests_test_list_SOURCES = tests/test-list.c
96d87817 240tests_test_list_LDADD = lib/libopenvswitch.la
064af421 241
ac718c9d
BP
242noinst_PROGRAMS += tests/test-lockfile
243tests_test_lockfile_SOURCES = tests/test-lockfile.c
96d87817 244tests_test_lockfile_LDADD = lib/libopenvswitch.la
ac718c9d 245
53ddd40a
BP
246noinst_PROGRAMS += tests/test-multipath
247tests_test_multipath_SOURCES = tests/test-multipath.c
96d87817 248tests_test_multipath_LDADD = lib/libopenvswitch.la
53ddd40a 249
f696f12f
JP
250noinst_PROGRAMS += tests/test-packets
251tests_test_packets_SOURCES = tests/test-packets.c
96d87817 252tests_test_packets_LDADD = lib/libopenvswitch.la
f696f12f 253
78f3f316
BP
254noinst_PROGRAMS += tests/test-random
255tests_test_random_SOURCES = tests/test-random.c
96d87817 256tests_test_random_LDADD = lib/libopenvswitch.la
78f3f316 257
829a7d02
JP
258noinst_PROGRAMS += tests/test-stp
259tests_test_stp_SOURCES = tests/test-stp.c
96d87817 260tests_test_stp_LDADD = lib/libopenvswitch.la
829a7d02 261
8073dd31
NM
262noinst_PROGRAMS += tests/test-sflow
263tests_test_sflow_SOURCES = tests/test-sflow.c
96d87817 264tests_test_sflow_LDADD = lib/libopenvswitch.la
8073dd31 265
17f7f7e0
BP
266noinst_PROGRAMS += tests/test-netflow
267tests_test_netflow_SOURCES = tests/test-netflow.c
96d87817 268tests_test_netflow_LDADD = lib/libopenvswitch.la
17f7f7e0 269
6e170b4c
BP
270noinst_PROGRAMS += tests/test-unix-socket
271tests_test_unix_socket_SOURCES = tests/test-unix-socket.c
96d87817 272tests_test_unix_socket_LDADD = lib/libopenvswitch.la
6e170b4c 273
3bffc610
BP
274noinst_PROGRAMS += tests/test-odp
275tests_test_odp_SOURCES = tests/test-odp.c
96d87817 276tests_test_odp_LDADD = lib/libopenvswitch.la
3bffc610 277
f85f8ebb 278noinst_PROGRAMS += tests/test-ovsdb
00732bf5
BP
279tests_test_ovsdb_SOURCES = \
280 tests/test-ovsdb.c \
281 tests/idltest.c \
282 tests/idltest.h
7360012b 283EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
96d87817 284tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
00732bf5
BP
285
286# idltest schema and IDL
2c84fdf2 287OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
00732bf5
BP
288IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
289EXTRA_DIST += $(IDLTEST_IDL_FILES)
290tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
291 $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
292 mv $@.tmp $@
293
b0fc010a 294tests/idltest.c: tests/idltest.h
f85f8ebb 295
3932d8db
AZ
296noinst_PROGRAMS += tests/ovstest
297tests_ovstest_SOURCES = tests/ovstest.c \
a8513c7d
AZ
298 tests/ovstest.h \
299 tests/test-heap.c
3932d8db
AZ
300tests_ovstest_LDADD = lib/libopenvswitch.la
301
3ed497fc
BP
302noinst_PROGRAMS += tests/test-reconnect
303tests_test_reconnect_SOURCES = tests/test-reconnect.c
96d87817 304tests_test_reconnect_LDADD = lib/libopenvswitch.la
3ed497fc 305
d138cd2c
BP
306noinst_PROGRAMS += tests/test-sha1
307tests_test_sha1_SOURCES = tests/test-sha1.c
96d87817 308tests_test_sha1_LDADD = lib/libopenvswitch.la
d138cd2c 309
78f172aa
BP
310noinst_PROGRAMS += tests/test-strtok_r
311tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
312
064af421
BP
313noinst_PROGRAMS += tests/test-type-props
314tests_test_type_props_SOURCES = tests/test-type-props.c
315
711e0157
BP
316noinst_PROGRAMS += tests/test-util
317tests_test_util_SOURCES = tests/test-util.c
96d87817 318tests_test_util_LDADD = lib/libopenvswitch.la
711e0157 319
d918d9d1
BP
320noinst_PROGRAMS += tests/test-uuid
321tests_test_uuid_SOURCES = tests/test-uuid.c
96d87817 322tests_test_uuid_LDADD = lib/libopenvswitch.la
d918d9d1 323
48d973e3
BP
324noinst_PROGRAMS += tests/test-vconn
325tests_test_vconn_SOURCES = tests/test-vconn.c
96d87817 326tests_test_vconn_LDADD = lib/libopenvswitch.la
99155935 327
10a24935
BP
328noinst_PROGRAMS += tests/test-byte-order
329tests_test_byte_order_SOURCES = tests/test-byte-order.c
38b7a52b 330tests_test_byte_order_LDADD = lib/libopenvswitch.la
965f03d8 331
99155935 332# Python tests.
79982e90 333CHECK_PYFILES = \
0a68ffd2 334 tests/appctl.py \
99155935
BP
335 tests/test-daemon.py \
336 tests/test-json.py \
337 tests/test-jsonrpc.py \
338 tests/test-ovsdb.py \
1b0fdca5 339 tests/test-reconnect.py \
8ed182d8 340 tests/MockXenAPI.py \
cd57233c 341 tests/test-unix-socket.py \
0a68ffd2 342 tests/test-unixctl.py \
8ed182d8 343 tests/test-vlog.py
79982e90
EJ
344EXTRA_DIST += $(CHECK_PYFILES)
345PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
15b619e2
BP
346
347if HAVE_OPENSSL
348TESTPKI_FILES = \
349 tests/testpki-cacert.pem \
350 tests/testpki-cert.pem \
351 tests/testpki-privkey.pem \
352 tests/testpki-req.pem \
353 tests/testpki-cert2.pem \
354 tests/testpki-privkey2.pem \
355 tests/testpki-req2.pem
356check_DATA += $(TESTPKI_FILES)
357CLEANFILES += $(TESTPKI_FILES)
358
359tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@
360tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@
361tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@
362tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@
363tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@
364tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@
365tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@
366
367OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
368tests/pki/stamp:
369 rm -f tests/pki/stamp
370 rm -rf tests/pki
371 $(OVS_PKI) init
372 $(OVS_PKI) req+sign tests/pki/test
373 $(OVS_PKI) req+sign tests/pki/test2
374 : > tests/pki/stamp
375CLEANFILES += tests/ovs-pki.log
376
377CLEAN_LOCAL += clean-pki
378clean-pki:
379 rm -f tests/pki/stamp
380 rm -rf tests/pki
381endif