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