distcheck/tests: Add the referenced osmoappdesc.py for testing

distcheck fails because the file is not present. Write it out to
get our standard vty checking to work. Add simple Makefile and
call it.
This commit is contained in:
Holger Hans Peter Freyther 2016-04-24 22:24:44 +02:00
parent 9a333be20b
commit f896df6b8e
4 changed files with 61 additions and 1 deletions

View File

@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
SUBDIRS = src SUBDIRS = src tests
BUILT_SOURCES = $(top_srcdir)/.version BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen osmoappdesc.py .version EXTRA_DIST = git-version-gen osmoappdesc.py .version

View File

@ -11,7 +11,27 @@ PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.8.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)
PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0) PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)
AC_ARG_ENABLE([vty_tests],
AC_HELP_STRING([--enable-vty-tests],
[Include the VTY/CTRL tests in make check (deprecated)
[default=no]]),
[enable_ext_tests="$enableval"],[enable_ext_tests="no"])
AC_ARG_ENABLE([external_tests],
AC_HELP_STRING([--enable-external-tests],
[Include the VTY/CTRL tests in make check [default=no]]),
[enable_ext_tests="$enableval"],[enable_ext_tests="no"])
if test "x$enable_ext_tests" = "xyes" ; then
AM_PATH_PYTHON
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
AC_MSG_RESULT([$enable_ext_tests])
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
AC_OUTPUT( AC_OUTPUT(
src/Makefile src/Makefile
tests/Makefile
Makefile) Makefile)

29
osmoappdesc.py Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
# (C) 2016 by Holger Hans Peter Freyther
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
app_configs = {
"osmo-sip-connector": ["doc/examples/osmo-sip-connector.cfg"]
}
apps = [
(4256, "src/osmo-sip-connector", "OsmoMNCC", "osmo-sip-connector")
]
vty_command = ["./src/osmo-sip-connector", "-c",
"doc/examples/osmo-sip-connector.cfg"]
vty_app = apps[0]

11
tests/Makefile.am Normal file
View File

@ -0,0 +1,11 @@
if ENABLE_EXT_TESTS
python-tests: $(BUILT_SOURCES)
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
else
python-tests: $(BUILT_SOURCES)
echo "Not running python-based tests (determined at configure-time)"
endif
check-local:
$(MAKE) $(AM_MAKEFLAGS) python-tests