blob: 7ab3c377fb1d97bb29f7ed86d29a03fa8561ba22 [file] [log] [blame]
Alexander Huemer7b6673f2016-09-09 00:43:15 +02001SUBDIRS = \
Harald Welte2483f1b2016-06-19 18:06:02 +02002 sms_queue \
Neels Hofmeyr6a29d322017-01-25 15:04:16 +01003 msc_vlr \
Vadim Yanitskiye1e72472019-04-09 16:55:44 +07004 db_sms \
Neels Hofmeyreef45782019-10-21 03:24:04 +02005 sdp_msg \
Neels Hofmeyrb4552052019-10-21 03:00:26 +02006 mncc \
Oliver Smithf5435482023-07-06 12:55:36 +02007 csd \
Alexander Huemer7b6673f2016-09-09 00:43:15 +02008 $(NULL)
Philipp22611be2016-08-10 12:08:03 +02009
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +020010if BUILD_SMPP
Alexander Huemer7b6673f2016-09-09 00:43:15 +020011SUBDIRS += \
12 smpp \
13 $(NULL)
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +020014endif
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010015
16# The `:;' works around a Bash 3.2 bug when the output is not writeable.
Holger Hans Peter Freyther93ef33e2012-01-09 22:53:04 +010017$(srcdir)/package.m4: $(top_srcdir)/configure.ac
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010018 :;{ \
19 echo '# Signature of the current package.' && \
20 echo 'm4_define([AT_PACKAGE_NAME],' && \
21 echo ' [$(PACKAGE_NAME)])' && \
22 echo 'm4_define([AT_PACKAGE_TARNAME],' && \
23 echo ' [$(PACKAGE_TARNAME)])' && \
24 echo 'm4_define([AT_PACKAGE_VERSION],' && \
25 echo ' [$(PACKAGE_VERSION)])' && \
26 echo 'm4_define([AT_PACKAGE_STRING],' && \
27 echo ' [$(PACKAGE_STRING)])' && \
28 echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \
29 echo ' [$(PACKAGE_BUGREPORT)])'; \
30 echo 'm4_define([AT_PACKAGE_URL],' && \
31 echo ' [$(PACKAGE_URL)])'; \
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +010032 } >'$(srcdir)/package.m4'
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010033
Alexander Huemer7b6673f2016-09-09 00:43:15 +020034EXTRA_DIST = \
35 testsuite.at \
36 $(srcdir)/package.m4 \
37 $(TESTSUITE) \
38 vty_test_runner.py \
39 ctrl_test_runner.py \
40 smpp_test_runner.py \
Neels Hofmeyr0ebc9112024-02-04 03:21:49 +010041 $(srcdir)/*.vty \
Alexander Huemer7b6673f2016-09-09 00:43:15 +020042 $(NULL)
43
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +010044TESTSUITE = $(srcdir)/testsuite
Alexander Huemer7b6673f2016-09-09 00:43:15 +020045
46DISTCLEANFILES = \
47 atconfig \
48 $(NULL)
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010049
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +020050if ENABLE_EXT_TESTS
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010051# don't run multiple tests concurrently so that the ports don't conflict
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +070052python-tests:
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010053 $(MAKE) vty-test
54 $(MAKE) ctrl-test
Holger Hans Peter Freythered0d4f62014-03-06 23:43:13 +010055if BUILD_SMPP
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010056 $(MAKE) smpp-test
Holger Hans Peter Freythered0d4f62014-03-06 23:43:13 +010057endif
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010058
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +020059else
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +070060python-tests:
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +020061 echo "Not running python-based tests (determined at configure-time)"
62endif
63
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +070064vty-python-test: $(top_builddir)/src/osmo-msc/osmo-msc
Oliver Smitha7ec3692019-10-29 15:37:19 +010065if BUILD_IU
66 IU=1 osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
67 IU=1 osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
68else
69 IU=0 osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
70 IU=0 osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
71endif
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010072 $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
Harald Welted677f512022-05-16 14:34:56 +020073 rm -f $(top_builddir)/sms.db*
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010074
Neels Hofmeyr1139ca32020-06-15 03:09:54 +020075# Run a specific transcript test with: 'make vty-transcript-test VTY_TEST=osmo-msc.vty'
76VTY_TEST ?= *.vty
77
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010078# To update the VTY script from current application behavior,
79# pass -u to vty_script_runner.py by doing:
80# make vty-transcript-test U=-u
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +070081vty-transcript-test: $(top_builddir)/src/osmo-msc/osmo-msc
Neels Hofmeyr18333fa2018-12-05 02:24:30 +010082 osmo_verify_transcript_vty.py -v \
83 -n OsmoMSC -p 4254 \
84 -r "$(top_builddir)/src/osmo-msc/osmo-msc -c $(top_srcdir)/doc/examples/osmo-msc/osmo-msc.cfg" \
Neels Hofmeyr1139ca32020-06-15 03:09:54 +020085 $(U) $(srcdir)/$(VTY_TEST)
Harald Welted677f512022-05-16 14:34:56 +020086 rm -f $(builddir)/sms.db*
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010087
88# don't run multiple tests concurrently so that the ports don't conflict
89vty-test:
90 $(MAKE) vty-python-test
91 $(MAKE) vty-transcript-test
92
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +070093ctrl-python-test: $(top_builddir)/src/osmo-msc/osmo-msc
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010094 $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
Harald Welted677f512022-05-16 14:34:56 +020095 rm -f $(top_builddir)/sms.db*
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +010096
97# To update the CTRL script from current application behavior,
98# pass -u to ctrl_script_runner.py by doing:
99# make ctrl-transcript-test U=-u
100ctrl-transcript-test:
101 echo "No ctrl-transcript-test exists yet"
102
103# don't run multiple tests concurrently so that the ports don't conflict
104ctrl-test:
105 $(MAKE) ctrl-python-test
106 $(MAKE) ctrl-transcript-test
107
Vadim Yanitskiy5d0bc332023-03-29 19:43:35 +0700108smpp-test:$(top_builddir)/src/osmo-msc/osmo-msc
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +0100109 $(srcdir)/smpp_test_runner.py -w $(abs_top_builddir) -v
Harald Welted677f512022-05-16 14:34:56 +0200110 rm -f $(top_builddir)/sms.db*
Neels Hofmeyr1231fdb2018-12-05 02:24:16 +0100111
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100112check-local: atconfig $(TESTSUITE)
113 $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200114 $(MAKE) $(AM_MAKEFLAGS) python-tests
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100115
116installcheck-local: atconfig $(TESTSUITE)
117 $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
118 $(TESTSUITEFLAGS)
119
120clean-local:
121 test ! -f '$(TESTSUITE)' || \
122 $(SHELL) '$(TESTSUITE)' --clean
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100123
124AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
125AUTOTEST = $(AUTOM4TE) --language=autotest
Holger Hans Peter Freyther03ff1c82012-01-09 21:49:47 +0100126$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +0100127 $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
128 mv $@.tmp $@