blob: 48d657905148e0c0a339e0e3a5f0a50520ed19ad [file] [log] [blame]
Alexander Huemer7477d712016-09-09 00:43:15 +02001SUBDIRS = \
Alexander Huemer7477d712016-09-09 00:43:15 +02002 $(NULL)
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +01003
4# The `:;' works around a Bash 3.2 bug when the output is not writeable.
Holger Hans Peter Freyther34abf212012-01-09 22:53:04 +01005$(srcdir)/package.m4: $(top_srcdir)/configure.ac
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +01006 :;{ \
7 echo '# Signature of the current package.' && \
8 echo 'm4_define([AT_PACKAGE_NAME],' && \
9 echo ' [$(PACKAGE_NAME)])' && \
10 echo 'm4_define([AT_PACKAGE_TARNAME],' && \
11 echo ' [$(PACKAGE_TARNAME)])' && \
12 echo 'm4_define([AT_PACKAGE_VERSION],' && \
13 echo ' [$(PACKAGE_VERSION)])' && \
14 echo 'm4_define([AT_PACKAGE_STRING],' && \
15 echo ' [$(PACKAGE_STRING)])' && \
16 echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
17 echo ' [$(PACKAGE_BUGREPORT)])'; \
18 echo 'm4_define([AT_PACKAGE_URL],' && \
19 echo ' [$(PACKAGE_URL)])'; \
Holger Hans Peter Freyther3073cb02012-01-09 21:49:47 +010020 } >'$(srcdir)/package.m4'
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010021
Alexander Huemer7477d712016-09-09 00:43:15 +020022EXTRA_DIST = \
23 testsuite.at \
24 $(srcdir)/package.m4 \
25 $(TESTSUITE) \
26 vty_test_runner.py \
27 ctrl_test_runner.py \
Daniel Willmannee834af2020-12-14 16:22:39 +010028 osmo-gbproxy_test-nodes.vty \
29 osmo-gbproxy-pool_test-nodes.vty \
Alexander Huemer7477d712016-09-09 00:43:15 +020030 $(NULL)
31
Holger Hans Peter Freyther3073cb02012-01-09 21:49:47 +010032TESTSUITE = $(srcdir)/testsuite
Alexander Huemer7477d712016-09-09 00:43:15 +020033
34DISTCLEANFILES = \
35 atconfig \
36 $(NULL)
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010037
Holger Hans Peter Freyther8fa08b02014-08-22 00:29:04 +020038if ENABLE_EXT_TESTS
Katerina Barone-Adesiad5fb002013-04-05 17:36:09 +020039python-tests: $(BUILT_SOURCES)
Pau Espin Pedrol4330ea92019-08-14 20:22:59 +020040 $(MAKE) vty-test
41 $(MAKE) ctrl-python-test
Katerina Barone-Adesiad5fb002013-04-05 17:36:09 +020042else
43python-tests: $(BUILT_SOURCES)
44 echo "Not running python-based tests (determined at configure-time)"
45endif
46
Pau Espin Pedrol4330ea92019-08-14 20:22:59 +020047vty-python-test: $(BUILT_SOURCES)
48 osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
49 osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
50 $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
51 rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
52
53# To update the VTY script from current application behavior,
54# pass -u to vty_script_runner.py by doing:
55# make vty-transcript-test U=-u
56vty-transcript-test:
57 osmo_verify_transcript_vty.py -v \
Daniel Willmannee834af2020-12-14 16:22:39 +010058 -n OsmoGbProxy -p 4246 \
Harald Welte936dfd72021-01-31 19:36:06 +010059 -r "$(top_builddir)/src/osmo-gbproxy -c $(top_srcdir)/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg" \
Daniel Willmannee834af2020-12-14 16:22:39 +010060 $(U) $${T:-$(srcdir)/osmo-gbproxy_test-nodes.vty}
61 osmo_verify_transcript_vty.py -v \
62 -n OsmoGbProxy -p 4246 \
Harald Welte936dfd72021-01-31 19:36:06 +010063 -r "$(top_builddir)/src/osmo-gbproxy -c $(top_srcdir)/doc/examples/osmo-gbproxy/osmo-gbproxy-pool.cfg" \
Daniel Willmannee834af2020-12-14 16:22:39 +010064 $(U) $${T:-$(srcdir)/osmo-gbproxy-pool_test-nodes.vty}
Pau Espin Pedrol4330ea92019-08-14 20:22:59 +020065 rm -f $(builddir)/sms.db $(builddir)/gsn_restart
66
67# don't run multiple tests concurrently so that the ports don't conflict
68vty-test:
69 $(MAKE) vty-python-test
70 $(MAKE) vty-transcript-test
71
72ctrl-python-test: $(BUILT_SOURCES)
73 $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
74 rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
75
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010076check-local: atconfig $(TESTSUITE)
77 $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
Katerina Barone-Adesiad5fb002013-04-05 17:36:09 +020078 $(MAKE) $(AM_MAKEFLAGS) python-tests
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010079
80installcheck-local: atconfig $(TESTSUITE)
81 $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
82 $(TESTSUITEFLAGS)
83
84clean-local:
85 test ! -f '$(TESTSUITE)' || \
86 $(SHELL) '$(TESTSUITE)' --clean
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010087
88AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
89AUTOTEST = $(AUTOM4TE) --language=autotest
Holger Hans Peter Freyther3073cb02012-01-09 21:49:47 +010090$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
Holger Hans Peter Freytherfee826b2012-01-06 15:16:12 +010091 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
92 mv $@.tmp $@