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