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