6 $(srcdir)/tests/testsuite
9 tests/ovsdb-macros.at \
14 tests/check-structs.at \
17 tests/ofp-actions.at \
37 tests/ofproto-dpif.at \
38 tests/ofproto-macros.at \
42 tests/ovsdb-types.at \
44 tests/ovsdb-column.at \
45 tests/ovsdb-table.at \
47 tests/ovsdb-schema.at \
48 tests/ovsdb-condition.at \
49 tests/ovsdb-mutation.at \
50 tests/ovsdb-query.at \
51 tests/ovsdb-transaction.at \
52 tests/ovsdb-execution.at \
53 tests/ovsdb-trigger.at \
55 tests/ovsdb-server.at \
56 tests/ovsdb-monitor.at \
59 tests/ovs-monitor-ipsec.at \
60 tests/ovs-xapi-sync.at \
62 tests/interface-reconfigure.at \
64 TESTSUITE = $(srcdir)/tests/testsuite
65 DISTCLEANFILES += tests/atconfig tests/atlocal
67 AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
69 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
70 $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
72 # Python Coverage support.
73 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
76 COVERAGE_FILE='$(abs_srcdir)/.coverage'
77 check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
78 PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
79 @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
81 @echo '----------------------------------------------------------------------'
82 @echo 'Annotated coverage source has the ",cover" extension.'
83 @echo '----------------------------------------------------------------------'
85 @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
90 tests/lcov/ovs-appctl \
91 tests/lcov/ovs-ofctl \
92 tests/lcov/ovs-vsctl \
93 tests/lcov/ovs-vswitchd \
94 tests/lcov/ovsdb-client \
95 tests/lcov/ovsdb-server \
96 tests/lcov/ovsdb-tool \
97 tests/lcov/test-aes128 \
98 tests/lcov/test-bundle \
99 tests/lcov/test-byte-order \
100 tests/lcov/test-classifier \
101 tests/lcov/test-csum \
102 tests/lcov/test-file_name \
103 tests/lcov/test-flows \
104 tests/lcov/test-hash \
105 tests/lcov/test-heap \
106 tests/lcov/test-hmap \
107 tests/lcov/test-json \
108 tests/lcov/test-jsonrpc \
109 tests/lcov/test-list \
110 tests/lcov/test-lockfile \
111 tests/lcov/test-multipath \
112 tests/lcov/test-odp \
113 tests/lcov/test-ovsdb \
114 tests/lcov/test-packets \
115 tests/lcov/test-random \
116 tests/lcov/test-reconnect \
117 tests/lcov/test-sha1 \
118 tests/lcov/test-stp \
119 tests/lcov/test-timeval \
120 tests/lcov/test-type-props \
121 tests/lcov/test-unix-socket \
122 tests/lcov/test-uuid \
123 tests/lcov/test-vconn
125 $(lcov_wrappers): tests/lcov-wrapper.in
126 @test -d tests/lcov || mkdir tests/lcov
127 sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
128 -e 's,[@]wrap_program[@],$@,' \
129 $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
132 CLEANFILES += $(lcov_wrappers)
133 EXTRA_DIST += tests/lcov-wrapper.in
135 LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
136 check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
137 rm -fr tests/coverage.html tests/coverage.info
138 $(LCOV) -c -i -o - > tests/coverage.info
139 $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true DISABLE_LCOV=false AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
141 echo "Producing coverage.html..."; \
142 cd tests && genhtml -q -o coverage.html coverage.info; \
147 valgrind_wrappers = \
148 tests/valgrind/ovs-appctl \
149 tests/valgrind/ovs-ofctl \
150 tests/valgrind/ovs-vsctl \
151 tests/valgrind/ovs-vswitchd \
152 tests/valgrind/ovsdb-client \
153 tests/valgrind/ovsdb-server \
154 tests/valgrind/ovsdb-tool \
155 tests/valgrind/test-aes128 \
156 tests/valgrind/test-bundle \
157 tests/valgrind/test-byte-order \
158 tests/valgrind/test-classifier \
159 tests/valgrind/test-csum \
160 tests/valgrind/test-file_name \
161 tests/valgrind/test-flows \
162 tests/valgrind/test-hash \
163 tests/valgrind/test-heap \
164 tests/valgrind/test-hmap \
165 tests/valgrind/test-json \
166 tests/valgrind/test-jsonrpc \
167 tests/valgrind/test-list \
168 tests/valgrind/test-lockfile \
169 tests/valgrind/test-multipath \
170 tests/valgrind/test-odp \
171 tests/valgrind/test-ovsdb \
172 tests/valgrind/test-packets \
173 tests/valgrind/test-random \
174 tests/valgrind/test-reconnect \
175 tests/valgrind/test-sha1 \
176 tests/valgrind/test-stp \
177 tests/valgrind/test-timeval \
178 tests/valgrind/test-type-props \
179 tests/valgrind/test-unix-socket \
180 tests/valgrind/test-uuid \
181 tests/valgrind/test-vconn
183 $(valgrind_wrappers): tests/valgrind-wrapper.in
184 @test -d tests/valgrind || mkdir tests/valgrind
185 sed -e 's,[@]wrap_program[@],$@,' \
186 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
189 CLEANFILES += $(valgrind_wrappers)
190 EXTRA_DIST += tests/valgrind-wrapper.in
192 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
193 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
194 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
195 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
196 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
197 $(valgrind_wrappers) $(check_DATA)
198 $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
200 @echo '----------------------------------------------------------------------'
201 @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
202 @echo '----------------------------------------------------------------------'
205 test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
208 AUTOTEST = $(AUTOM4TE) --language=autotest
209 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
210 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
213 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
214 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
216 echo '# Signature of the current package.' && \
217 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
218 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
219 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
220 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
221 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
222 } >'$(srcdir)/package.m4'
224 noinst_PROGRAMS += tests/test-aes128
225 tests_test_aes128_SOURCES = tests/test-aes128.c
226 tests_test_aes128_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
228 noinst_PROGRAMS += tests/test-bundle
229 tests_test_bundle_SOURCES = tests/test-bundle.c
230 tests_test_bundle_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
232 noinst_PROGRAMS += tests/test-classifier
233 tests_test_classifier_SOURCES = tests/test-classifier.c
234 tests_test_classifier_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
236 noinst_PROGRAMS += tests/test-csum
237 tests_test_csum_SOURCES = tests/test-csum.c
238 tests_test_csum_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
240 noinst_PROGRAMS += tests/test-file_name
241 tests_test_file_name_SOURCES = tests/test-file_name.c
242 tests_test_file_name_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
244 noinst_PROGRAMS += tests/test-flows
245 tests_test_flows_SOURCES = tests/test-flows.c
246 tests_test_flows_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
247 dist_check_SCRIPTS = tests/flowgen.pl
249 noinst_PROGRAMS += tests/test-hash
250 tests_test_hash_SOURCES = tests/test-hash.c
251 tests_test_hash_LDADD = lib/libopenvswitch.a
253 noinst_PROGRAMS += tests/test-heap
254 tests_test_heap_SOURCES = tests/test-heap.c
255 tests_test_heap_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
257 noinst_PROGRAMS += tests/test-hmap
258 tests_test_hmap_SOURCES = tests/test-hmap.c
259 tests_test_hmap_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
261 noinst_PROGRAMS += tests/test-json
262 tests_test_json_SOURCES = tests/test-json.c
263 tests_test_json_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
265 noinst_PROGRAMS += tests/test-jsonrpc
266 tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
267 tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
269 noinst_PROGRAMS += tests/test-list
270 tests_test_list_SOURCES = tests/test-list.c
271 tests_test_list_LDADD = lib/libopenvswitch.a
273 noinst_PROGRAMS += tests/test-lockfile
274 tests_test_lockfile_SOURCES = tests/test-lockfile.c
275 tests_test_lockfile_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
277 noinst_PROGRAMS += tests/test-multipath
278 tests_test_multipath_SOURCES = tests/test-multipath.c
279 tests_test_multipath_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
281 noinst_PROGRAMS += tests/test-packets
282 tests_test_packets_SOURCES = tests/test-packets.c
283 tests_test_packets_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
285 noinst_PROGRAMS += tests/test-random
286 tests_test_random_SOURCES = tests/test-random.c
287 tests_test_random_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
289 noinst_PROGRAMS += tests/test-stp
290 tests_test_stp_SOURCES = tests/test-stp.c
291 tests_test_stp_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
293 noinst_PROGRAMS += tests/test-netflow
294 tests_test_netflow_SOURCES = tests/test-netflow.c
295 tests_test_netflow_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
297 noinst_PROGRAMS += tests/test-unix-socket
298 tests_test_unix_socket_SOURCES = tests/test-unix-socket.c
299 tests_test_unix_socket_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
301 noinst_PROGRAMS += tests/test-odp
302 tests_test_odp_SOURCES = tests/test-odp.c
303 tests_test_odp_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
305 noinst_PROGRAMS += tests/test-ovsdb
306 tests_test_ovsdb_SOURCES = \
310 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
311 tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
313 # idltest schema and IDL
314 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
315 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
316 EXTRA_DIST += $(IDLTEST_IDL_FILES)
317 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
318 $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
321 tests/idltest.c: tests/idltest.h
323 noinst_PROGRAMS += tests/test-reconnect
324 tests_test_reconnect_SOURCES = tests/test-reconnect.c
325 tests_test_reconnect_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
327 noinst_PROGRAMS += tests/test-sha1
328 tests_test_sha1_SOURCES = tests/test-sha1.c
329 tests_test_sha1_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
331 noinst_PROGRAMS += tests/test-timeval
332 tests_test_timeval_SOURCES = tests/test-timeval.c
333 tests_test_timeval_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
335 noinst_PROGRAMS += tests/test-strtok_r
336 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
338 noinst_PROGRAMS += tests/test-type-props
339 tests_test_type_props_SOURCES = tests/test-type-props.c
341 noinst_PROGRAMS += tests/test-util
342 tests_test_util_SOURCES = tests/test-util.c
343 tests_test_util_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
345 noinst_PROGRAMS += tests/test-uuid
346 tests_test_uuid_SOURCES = tests/test-uuid.c
347 tests_test_uuid_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
349 noinst_PROGRAMS += tests/test-vconn
350 tests_test_vconn_SOURCES = tests/test-vconn.c
351 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
353 noinst_PROGRAMS += tests/test-byte-order
354 tests_test_byte_order_SOURCES = tests/test-byte-order.c
355 tests_test_byte_order_LDADD = lib/libopenvswitch.a
357 EXTRA_DIST += tests/choose-port.pl
362 tests/test-daemon.py \
364 tests/test-jsonrpc.py \
365 tests/test-ovsdb.py \
366 tests/test-reconnect.py \
367 tests/MockXenAPI.py \
368 tests/test-unixctl.py \
370 EXTRA_DIST += $(CHECK_PYFILES)
371 PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
375 tests/testpki-cacert.pem \
376 tests/testpki-cert.pem \
377 tests/testpki-privkey.pem \
378 tests/testpki-req.pem \
379 tests/testpki-cert2.pem \
380 tests/testpki-privkey2.pem \
381 tests/testpki-req2.pem
382 check_DATA += $(TESTPKI_FILES)
383 CLEANFILES += $(TESTPKI_FILES)
385 tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@
386 tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@
387 tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@
388 tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@
389 tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@
390 tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@
391 tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@
393 OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
395 rm -f tests/pki/stamp
398 $(OVS_PKI) req+sign tests/pki/test
399 $(OVS_PKI) req+sign tests/pki/test2
401 CLEANFILES += tests/ovs-pki.log
403 CLEAN_LOCAL += clean-pki
405 rm -f tests/pki/stamp