]> git.proxmox.com Git - ovs.git/blob - tests/automake.mk
lib: Move vconn.h to <openvswitch/vconn.h>
[ovs.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/heap.at \
12 tests/bundle.at \
13 tests/classifier.at \
14 tests/check-structs.at \
15 tests/daemon.at \
16 tests/daemon-py.at \
17 tests/ofp-actions.at \
18 tests/ofp-print.at \
19 tests/ofp-util.at \
20 tests/ofp-errors.at \
21 tests/ovs-ofctl.at \
22 tests/odp.at \
23 tests/multipath.at \
24 tests/bfd.at \
25 tests/cfm.at \
26 tests/lacp.at \
27 tests/learn.at \
28 tests/vconn.at \
29 tests/file_name.at \
30 tests/aes128.at \
31 tests/unixctl-py.at \
32 tests/uuid.at \
33 tests/json.at \
34 tests/jsonrpc.at \
35 tests/jsonrpc-py.at \
36 tests/tunnel.at \
37 tests/tunnel-push-pop.at \
38 tests/lockfile.at \
39 tests/reconnect.at \
40 tests/ovs-vswitchd.at \
41 tests/dpif-netdev.at \
42 tests/ofproto-dpif.at \
43 tests/bridge.at \
44 tests/vlan-splinters.at \
45 tests/ofproto-macros.at \
46 tests/ofproto.at \
47 tests/ovsdb.at \
48 tests/ovsdb-log.at \
49 tests/ovsdb-types.at \
50 tests/ovsdb-data.at \
51 tests/ovsdb-column.at \
52 tests/ovsdb-table.at \
53 tests/ovsdb-row.at \
54 tests/ovsdb-schema.at \
55 tests/ovsdb-condition.at \
56 tests/ovsdb-mutation.at \
57 tests/ovsdb-query.at \
58 tests/ovsdb-transaction.at \
59 tests/ovsdb-execution.at \
60 tests/ovsdb-trigger.at \
61 tests/ovsdb-tool.at \
62 tests/ovsdb-server.at \
63 tests/ovsdb-monitor.at \
64 tests/ovsdb-idl.at \
65 tests/ovs-vsctl.at \
66 tests/ovs-monitor-ipsec.at \
67 tests/ovs-xapi-sync.at \
68 tests/stp.at \
69 tests/rstp.at \
70 tests/interface-reconfigure.at \
71 tests/vlog.at \
72 tests/vtep-ctl.at
73 TESTSUITE = $(srcdir)/tests/testsuite
74 DISTCLEANFILES += tests/atconfig tests/atlocal
75
76 AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests
77
78 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
79 $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
80 \f
81 # Python Coverage support.
82 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
83
84 COVERAGE = coverage
85 COVERAGE_FILE='$(abs_srcdir)/.coverage'
86 check-pycov: all tests/atconfig tests/atlocal $(TESTSUITE) clean-pycov
87 PYTHONDONTWRITEBYTECODE=yes COVERAGE_FILE=$(COVERAGE_FILE) PYTHON='$(COVERAGE) run -p' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
88 @cd $(srcdir) && $(COVERAGE) combine && COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) annotate
89 @echo
90 @echo '----------------------------------------------------------------------'
91 @echo 'Annotated coverage source has the ",cover" extension.'
92 @echo '----------------------------------------------------------------------'
93 @echo
94 @COVERAGE_FILE=$(COVERAGE_FILE) $(COVERAGE) report
95 \f
96 # valgrind support
97
98 valgrind_wrappers = \
99 tests/valgrind/ovs-appctl \
100 tests/valgrind/ovs-ofctl \
101 tests/valgrind/ovstest \
102 tests/valgrind/ovs-vsctl \
103 tests/valgrind/ovs-vswitchd \
104 tests/valgrind/ovsdb-client \
105 tests/valgrind/ovsdb-server \
106 tests/valgrind/ovsdb-tool \
107 tests/valgrind/test-aes128 \
108 tests/valgrind/test-atomic \
109 tests/valgrind/test-bundle \
110 tests/valgrind/test-byte-order \
111 tests/valgrind/test-classifier \
112 tests/valgrind/test-cmap \
113 tests/valgrind/test-csum \
114 tests/valgrind/test-flows \
115 tests/valgrind/test-hash \
116 tests/valgrind/test-hindex \
117 tests/valgrind/test-hmap \
118 tests/valgrind/test-json \
119 tests/valgrind/test-jsonrpc \
120 tests/valgrind/test-list \
121 tests/valgrind/test-lockfile \
122 tests/valgrind/test-multipath \
123 tests/valgrind/test-odp \
124 tests/valgrind/test-ovsdb \
125 tests/valgrind/test-packets \
126 tests/valgrind/test-random \
127 tests/valgrind/test-reconnect \
128 tests/valgrind/test-rstp \
129 tests/valgrind/test-sha1 \
130 tests/valgrind/test-stp \
131 tests/valgrind/test-type-props \
132 tests/valgrind/test-unix-socket \
133 tests/valgrind/test-uuid \
134 tests/valgrind/test-vconn
135
136 $(valgrind_wrappers): tests/valgrind-wrapper.in
137 @test -d tests/valgrind || mkdir tests/valgrind
138 $(AM_V_GEN) sed -e 's,[@]wrap_program[@],$@,' \
139 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp && \
140 chmod +x $@.tmp && \
141 mv $@.tmp $@
142 CLEANFILES += $(valgrind_wrappers)
143 EXTRA_DIST += tests/valgrind-wrapper.in
144
145 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
146 --suppressions=$(abs_top_srcdir)/tests/glibc.supp \
147 --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
148 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
149 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) \
150 $(valgrind_wrappers) $(check_DATA)
151 $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
152 @echo
153 @echo '----------------------------------------------------------------------'
154 @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
155 @echo '----------------------------------------------------------------------'
156 \f
157 # OFTest support.
158
159 check-oftest: all
160 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-oftest
161 EXTRA_DIST += tests/run-oftest
162
163 # Ryu support.
164 check-ryu: all
165 $(AM_V_at)srcdir='$(srcdir)' $(SHELL) $(srcdir)/tests/run-ryu
166 EXTRA_DIST += tests/run-ryu
167 \f
168 clean-local:
169 test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
170
171 AUTOTEST = $(AUTOM4TE) --language=autotest
172 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
173 $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
174 $(AM_V_at)mv $@.tmp $@
175
176 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
177 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
178 $(AM_V_GEN):;{ \
179 echo '# Signature of the current package.' && \
180 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])' && \
181 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])' && \
182 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])' && \
183 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])' && \
184 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
185 } >'$(srcdir)/package.m4'
186
187 noinst_PROGRAMS += tests/test-ovsdb
188 tests_test_ovsdb_SOURCES = \
189 tests/test-ovsdb.c \
190 tests/idltest.c \
191 tests/idltest.h
192 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
193 tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
194
195 # idltest schema and IDL
196 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
197 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
198 EXTRA_DIST += $(IDLTEST_IDL_FILES)
199 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
200 $(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \
201 mv $@.tmp $@
202
203 tests/idltest.c: tests/idltest.h
204
205 if DPDK_NETDEV
206 noinst_PROGRAMS += tests/test-dpdkr
207 tests_test_dpdkr_SOURCES = \
208 tests/dpdk/ring_client.c
209 tests_test_dpdkr_LDADD = lib/libopenvswitch.la $(LIBS)
210 endif
211
212 noinst_PROGRAMS += tests/ovstest
213 tests_ovstest_SOURCES = \
214 tests/ovstest.c \
215 tests/ovstest.h \
216 tests/test-aes128.c \
217 tests/test-atomic.c \
218 tests/test-bundle.c \
219 tests/test-byte-order.c \
220 tests/test-classifier.c \
221 tests/test-cmap.c \
222 tests/test-csum.c \
223 tests/test-flows.c \
224 tests/test-hash.c \
225 tests/test-heap.c \
226 tests/test-hindex.c \
227 tests/test-hmap.c \
228 tests/test-json.c \
229 tests/test-jsonrpc.c \
230 tests/test-list.c \
231 tests/test-lockfile.c \
232 tests/test-multipath.c \
233 tests/test-netflow.c \
234 tests/test-odp.c \
235 tests/test-packets.c \
236 tests/test-random.c \
237 tests/test-reconnect.c \
238 tests/test-rstp.c \
239 tests/test-sflow.c \
240 tests/test-sha1.c \
241 tests/test-stp.c \
242 tests/test-util.c \
243 tests/test-uuid.c \
244 tests/test-bitmap.c \
245 tests/test-vconn.c
246
247 if !WIN32
248 tests_ovstest_SOURCES += \
249 tests/test-unix-socket.c
250 endif
251
252 tests_ovstest_LDADD = lib/libopenvswitch.la
253 dist_check_SCRIPTS = tests/flowgen.pl
254
255 noinst_PROGRAMS += tests/test-strtok_r
256 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
257
258 noinst_PROGRAMS += tests/test-type-props
259 tests_test_type_props_SOURCES = tests/test-type-props.c
260
261 # Python tests.
262 CHECK_PYFILES = \
263 tests/appctl.py \
264 tests/test-daemon.py \
265 tests/test-json.py \
266 tests/test-jsonrpc.py \
267 tests/test-ovsdb.py \
268 tests/test-reconnect.py \
269 tests/MockXenAPI.py \
270 tests/test-unix-socket.py \
271 tests/test-unixctl.py \
272 tests/test-vlog.py
273 EXTRA_DIST += $(CHECK_PYFILES)
274 PYCOV_CLEAN_FILES += $(CHECK_PYFILES:.py=.py,cover) .coverage
275
276 if HAVE_OPENSSL
277 TESTPKI_FILES = \
278 tests/testpki-cacert.pem \
279 tests/testpki-cert.pem \
280 tests/testpki-privkey.pem \
281 tests/testpki-req.pem \
282 tests/testpki-cert2.pem \
283 tests/testpki-privkey2.pem \
284 tests/testpki-req2.pem
285 check_DATA += $(TESTPKI_FILES)
286 CLEANFILES += $(TESTPKI_FILES)
287
288 tests/testpki-cacert.pem: tests/pki/stamp
289 $(AM_V_GEN)cp tests/pki/switchca/cacert.pem $@
290 tests/testpki-cert.pem: tests/pki/stamp
291 $(AM_V_GEN)cp tests/pki/test-cert.pem $@
292 tests/testpki-req.pem: tests/pki/stamp
293 $(AM_V_GEN)cp tests/pki/test-req.pem $@
294 tests/testpki-privkey.pem: tests/pki/stamp
295 $(AM_V_GEN)cp tests/pki/test-privkey.pem $@
296 tests/testpki-cert2.pem: tests/pki/stamp
297 $(AM_V_GEN)cp tests/pki/test2-cert.pem $@
298 tests/testpki-req2.pem: tests/pki/stamp
299 $(AM_V_GEN)cp tests/pki/test2-req.pem $@
300 tests/testpki-privkey2.pem: tests/pki/stamp
301 $(AM_V_GEN)cp tests/pki/test2-privkey.pem $@
302
303 OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
304 tests/pki/stamp:
305 $(AM_V_at)rm -f tests/pki/stamp
306 $(AM_V_at)rm -rf tests/pki
307 $(AM_V_GEN)$(OVS_PKI) init && \
308 $(OVS_PKI) req+sign tests/pki/test && \
309 $(OVS_PKI) req+sign tests/pki/test2 && \
310 : > tests/pki/stamp
311 CLEANFILES += tests/ovs-pki.log
312
313 CLEAN_LOCAL += clean-pki
314 clean-pki:
315 rm -f tests/pki/stamp
316 rm -rf tests/pki
317 endif