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