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