socket-util: Remove DSCP_INVALID.
[openvswitch] / tests / automake.mk
1 EXTRA_DIST += \
2         $(TESTSUITE_AT) \
3         $(TESTSUITE) \
4         tests/atlocal.in \
5         $(srcdir)/package.m4 \
6         $(srcdir)/tests/testsuite
7 TESTSUITE_AT = \
8         tests/testsuite.at \
9         tests/ovsdb-macros.at \
10         tests/library.at \
11         tests/heap.at \
12         tests/bundle.at \
13         tests/classifier.at \
14         tests/check-structs.at \
15         tests/daemon.at \
16         tests/daemon-py.at \
17         tests/ofp-print.at \
18         tests/ofp-errors.at \
19         tests/ovs-ofctl.at \
20         tests/odp.at \
21         tests/multipath.at \
22         tests/autopath.at \
23         tests/lacp.at \
24         tests/learn.at \
25         tests/vconn.at \
26         tests/file_name.at \
27         tests/aes128.at \
28         tests/unixctl-py.at \
29         tests/uuid.at \
30         tests/json.at \
31         tests/jsonrpc.at \
32         tests/jsonrpc-py.at \
33         tests/timeval.at \
34         tests/lockfile.at \
35         tests/reconnect.at \
36         tests/ofproto-dpif.at \
37         tests/ofproto-macros.at \
38         tests/ofproto.at \
39         tests/ovsdb.at \
40         tests/ovsdb-log.at \
41         tests/ovsdb-types.at \
42         tests/ovsdb-data.at \
43         tests/ovsdb-column.at \
44         tests/ovsdb-table.at \
45         tests/ovsdb-row.at \
46         tests/ovsdb-schema.at \
47         tests/ovsdb-condition.at \
48         tests/ovsdb-mutation.at \
49         tests/ovsdb-query.at \
50         tests/ovsdb-transaction.at \
51         tests/ovsdb-execution.at \
52         tests/ovsdb-trigger.at \
53         tests/ovsdb-tool.at \
54         tests/ovsdb-server.at \
55         tests/ovsdb-monitor.at \
56         tests/ovsdb-idl.at \
57         tests/ovs-vsctl.at \
58         tests/ovs-monitor-ipsec.at \
59         tests/ovs-xapi-sync.at \
60         tests/stp.at \
61         tests/interface-reconfigure.at \
62         tests/vlog.at
63 TESTSUITE = $(srcdir)/tests/testsuite
64 DISTCLEANFILES += tests/atconfig tests/atlocal
65
66 AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
67
68 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
69         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
70 \f
71 # Python Coverage support.
72 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
73
74 COVERAGE = coverage
75 COVERAGE_FILE='$(abs_srcdir)/.coverage'
76 check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
77         COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
78         @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
79         @echo
80         @echo '----------------------------------------------------------------------'
81         @echo 'Annotated coverage source has the ",cover" extension.'
82         @echo '----------------------------------------------------------------------'
83         @echo
84         @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
85 \f
86 # lcov support
87
88 lcov_wrappers = \
89         tests/lcov/ovs-appctl \
90         tests/lcov/ovs-ofctl \
91         tests/lcov/ovs-vsctl \
92         tests/lcov/ovs-vswitchd \
93         tests/lcov/ovsdb-client \
94         tests/lcov/ovsdb-server \
95         tests/lcov/ovsdb-tool \
96         tests/lcov/test-aes128 \
97         tests/lcov/test-bundle \
98         tests/lcov/test-byte-order \
99         tests/lcov/test-classifier \
100         tests/lcov/test-csum \
101         tests/lcov/test-file_name \
102         tests/lcov/test-flows \
103         tests/lcov/test-hash \
104         tests/lcov/test-heap \
105         tests/lcov/test-hmap \
106         tests/lcov/test-json \
107         tests/lcov/test-jsonrpc \
108         tests/lcov/test-list \
109         tests/lcov/test-lockfile \
110         tests/lcov/test-multipath \
111         tests/lcov/test-odp \
112         tests/lcov/test-ovsdb \
113         tests/lcov/test-packets \
114         tests/lcov/test-random \
115         tests/lcov/test-reconnect \
116         tests/lcov/test-sha1 \
117         tests/lcov/test-stp \
118         tests/lcov/test-timeval \
119         tests/lcov/test-type-props \
120         tests/lcov/test-unix-socket \
121         tests/lcov/test-uuid \
122         tests/lcov/test-vconn
123
124 $(lcov_wrappers): tests/lcov-wrapper.in
125         @test -d tests/lcov || mkdir tests/lcov
126         sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
127             -e 's,[@]wrap_program[@],$@,' \
128                 $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
129         chmod +x $@.tmp
130         mv $@.tmp $@
131 CLEANFILES += $(lcov_wrappers)
132 EXTRA_DIST += tests/lcov-wrapper.in
133
134 LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
135 check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
136         rm -fr tests/coverage.html tests/coverage.info
137         $(LCOV) -c -i -o - > tests/coverage.info
138         $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true DISABLE_LCOV=false AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
139                 rc=$$?; \
140                 echo "Producing coverage.html..."; \
141                 cd tests && genhtml -q -o coverage.html coverage.info; \
142                 exit $$rc
143 \f
144 # valgrind support
145
146 valgrind_wrappers = \
147         tests/valgrind/ovs-appctl \
148         tests/valgrind/ovs-ofctl \
149         tests/valgrind/ovs-vsctl \
150         tests/valgrind/ovs-vswitchd \
151         tests/valgrind/ovsdb-client \
152         tests/valgrind/ovsdb-server \
153         tests/valgrind/ovsdb-tool \
154         tests/valgrind/test-aes128 \
155         tests/valgrind/test-bundle \
156         tests/valgrind/test-byte-order \
157         tests/valgrind/test-classifier \
158         tests/valgrind/test-csum \
159         tests/valgrind/test-file_name \
160         tests/valgrind/test-flows \
161         tests/valgrind/test-hash \
162         tests/valgrind/test-heap \
163         tests/valgrind/test-hmap \
164         tests/valgrind/test-json \
165         tests/valgrind/test-jsonrpc \
166         tests/valgrind/test-list \
167         tests/valgrind/test-lockfile \
168         tests/valgrind/test-multipath \
169         tests/valgrind/test-odp \
170         tests/valgrind/test-ovsdb \
171         tests/valgrind/test-packets \
172         tests/valgrind/test-random \
173         tests/valgrind/test-reconnect \
174         tests/valgrind/test-sha1 \
175         tests/valgrind/test-stp \
176         tests/valgrind/test-timeval \
177         tests/valgrind/test-type-props \
178         tests/valgrind/test-unix-socket \
179         tests/valgrind/test-uuid \
180         tests/valgrind/test-vconn
181
182 $(valgrind_wrappers): tests/valgrind-wrapper.in
183         @test -d tests/valgrind || mkdir tests/valgrind
184         sed -e 's,[@]wrap_program[@],$@,' \
185                 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
186         chmod +x $@.tmp
187         mv $@.tmp $@
188 CLEANFILES += $(valgrind_wrappers)
189 EXTRA_DIST += tests/valgrind-wrapper.in
190
191 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
192         --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
193         --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
194 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
195 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
196         $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
197         @echo
198         @echo '----------------------------------------------------------------------'
199         @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
200         @echo '----------------------------------------------------------------------'
201 \f
202 clean-local:
203         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
204
205 AUTOM4TE = autom4te
206 AUTOTEST = $(AUTOM4TE) --language=autotest
207 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
208         $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
209         mv $@.tmp $@
210
211 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
212 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
213         :;{ \
214           echo '# Signature of the current package.' && \
215           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
216           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
217           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
218           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
219           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
220         } >'$(srcdir)/package.m4'
221
222 noinst_PROGRAMS += tests/test-aes128
223 tests_test_aes128_SOURCES = tests/test-aes128.c
224 tests_test_aes128_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
225
226 noinst_PROGRAMS += tests/test-bundle
227 tests_test_bundle_SOURCES = tests/test-bundle.c
228 tests_test_bundle_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
229
230 noinst_PROGRAMS += tests/test-classifier
231 tests_test_classifier_SOURCES = tests/test-classifier.c
232 tests_test_classifier_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
233
234 noinst_PROGRAMS += tests/test-csum
235 tests_test_csum_SOURCES = tests/test-csum.c
236 tests_test_csum_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
237
238 noinst_PROGRAMS += tests/test-file_name
239 tests_test_file_name_SOURCES = tests/test-file_name.c
240 tests_test_file_name_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
241
242 noinst_PROGRAMS += tests/test-flows
243 tests_test_flows_SOURCES = tests/test-flows.c
244 tests_test_flows_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
245 dist_check_SCRIPTS = tests/flowgen.pl
246
247 noinst_PROGRAMS += tests/test-hash
248 tests_test_hash_SOURCES = tests/test-hash.c
249 tests_test_hash_LDADD = lib/libopenvswitch.a
250
251 noinst_PROGRAMS += tests/test-heap
252 tests_test_heap_SOURCES = tests/test-heap.c
253 tests_test_heap_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
254
255 noinst_PROGRAMS += tests/test-hmap
256 tests_test_hmap_SOURCES = tests/test-hmap.c
257 tests_test_hmap_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
258
259 noinst_PROGRAMS += tests/test-json
260 tests_test_json_SOURCES = tests/test-json.c
261 tests_test_json_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
262
263 noinst_PROGRAMS += tests/test-jsonrpc
264 tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
265 tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
266
267 noinst_PROGRAMS += tests/test-list
268 tests_test_list_SOURCES = tests/test-list.c
269 tests_test_list_LDADD = lib/libopenvswitch.a
270
271 noinst_PROGRAMS += tests/test-lockfile
272 tests_test_lockfile_SOURCES = tests/test-lockfile.c
273 tests_test_lockfile_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
274
275 noinst_PROGRAMS += tests/test-multipath
276 tests_test_multipath_SOURCES = tests/test-multipath.c
277 tests_test_multipath_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
278
279 noinst_PROGRAMS += tests/test-packets
280 tests_test_packets_SOURCES = tests/test-packets.c
281 tests_test_packets_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
282
283 noinst_PROGRAMS += tests/test-random
284 tests_test_random_SOURCES = tests/test-random.c
285 tests_test_random_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
286
287 noinst_PROGRAMS += tests/test-stp
288 tests_test_stp_SOURCES = tests/test-stp.c
289 tests_test_stp_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
290
291 noinst_PROGRAMS += tests/test-netflow
292 tests_test_netflow_SOURCES = tests/test-netflow.c
293 tests_test_netflow_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
294
295 noinst_PROGRAMS += tests/test-unix-socket
296 tests_test_unix_socket_SOURCES = tests/test-unix-socket.c
297 tests_test_unix_socket_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
298
299 noinst_PROGRAMS += tests/test-odp
300 tests_test_odp_SOURCES = tests/test-odp.c
301 tests_test_odp_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
302
303 noinst_PROGRAMS += tests/test-ovsdb
304 tests_test_ovsdb_SOURCES = \
305         tests/test-ovsdb.c \
306         tests/idltest.c \
307         tests/idltest.h
308 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
309 tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
310
311 # idltest schema and IDL
312 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
313 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
314 EXTRA_DIST += $(IDLTEST_IDL_FILES)
315 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
316         $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
317         mv $@.tmp $@
318
319 tests/idltest.c: tests/idltest.h
320
321 noinst_PROGRAMS += tests/test-reconnect
322 tests_test_reconnect_SOURCES = tests/test-reconnect.c
323 tests_test_reconnect_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
324
325 noinst_PROGRAMS += tests/test-sha1
326 tests_test_sha1_SOURCES = tests/test-sha1.c
327 tests_test_sha1_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
328
329 noinst_PROGRAMS += tests/test-timeval
330 tests_test_timeval_SOURCES = tests/test-timeval.c
331 tests_test_timeval_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
332
333 noinst_PROGRAMS += tests/test-strtok_r
334 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
335
336 noinst_PROGRAMS += tests/test-type-props
337 tests_test_type_props_SOURCES = tests/test-type-props.c
338
339 noinst_PROGRAMS += tests/test-util
340 tests_test_util_SOURCES = tests/test-util.c
341 tests_test_util_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
342
343 noinst_PROGRAMS += tests/test-uuid
344 tests_test_uuid_SOURCES = tests/test-uuid.c
345 tests_test_uuid_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
346
347 noinst_PROGRAMS += tests/test-vconn
348 tests_test_vconn_SOURCES = tests/test-vconn.c
349 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
350
351 noinst_PROGRAMS += tests/test-byte-order
352 tests_test_byte_order_SOURCES = tests/test-byte-order.c
353 tests_test_byte_order_LDADD = lib/libopenvswitch.a
354
355 EXTRA_DIST += tests/choose-port.pl
356
357 # Python tests.
358 CHECK_PYFILES = \
359         tests/appctl.py \
360         tests/test-daemon.py \
361         tests/test-json.py \
362         tests/test-jsonrpc.py \
363         tests/test-ovsdb.py \
364         tests/test-reconnect.py \
365         tests/MockXenAPI.py \
366         tests/test-unixctl.py \
367         tests/test-vlog.py
368 EXTRA_DIST += $(CHECK_PYFILES)
369 PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
370
371 if HAVE_OPENSSL
372 TESTPKI_FILES = \
373         tests/testpki-cacert.pem \
374         tests/testpki-cert.pem \
375         tests/testpki-privkey.pem \
376         tests/testpki-req.pem \
377         tests/testpki-cert2.pem \
378         tests/testpki-privkey2.pem \
379         tests/testpki-req2.pem
380 check_DATA += $(TESTPKI_FILES)
381 CLEANFILES += $(TESTPKI_FILES)
382
383 tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@
384 tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@
385 tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@
386 tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@
387 tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@
388 tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@
389 tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@
390
391 OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
392 tests/pki/stamp:
393         rm -f tests/pki/stamp
394         rm -rf tests/pki
395         $(OVS_PKI) init
396         $(OVS_PKI) req+sign tests/pki/test
397         $(OVS_PKI) req+sign tests/pki/test2
398         : > tests/pki/stamp
399 CLEANFILES += tests/ovs-pki.log
400
401 CLEAN_LOCAL += clean-pki
402 clean-pki:
403         rm -f tests/pki/stamp
404         rm -rf tests/pki
405 endif