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