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