diff options
author | Kat <katerinab@gmail.com> | 2013-04-05 21:44:46 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-04-06 11:00:20 +0200 |
commit | 7dac4862bcdbbb182edb80ac6765736aa34e6299 (patch) | |
tree | 369b5232dc843b39e056742d6132b8d0c5ae462b | |
parent | 72075f0e009e103e7cfa15edf42dc40d3c373128 (diff) |
Added conditional python-based tests for VTY/config handling
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | osmoappdesc.py | 26 |
4 files changed, 56 insertions, 0 deletions
@@ -20,3 +20,5 @@ ltmain.sh core core.* + +osmoappdesc.pyc diff --git a/Makefile.am b/Makefile.am index 2c080ed9..e23a40fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,16 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 SUBDIRS = src examples +EXTRA_DIST = osmoappdesc.py + +if ENABLE_VTY_TESTS +python-tests: $(BUILT_SOURCES) + osmotestvty.py -p $(top_srcdir) -w $(builddir) -v + osmotestconfig.py -p $(top_srcdir) -w $(builddir) -v +else +python-tests: $(BUILT_SOURCES) + @echo "Not running python-based tests (determined at configure-time)" +endif + +check-local: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) python-tests diff --git a/configure.ac b/configure.ac index f4b1d07a..dfe98a85 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,21 @@ AC_ARG_ENABLE(sysmocom-dsp, AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +AC_ARG_ENABLE([vty_tests], + AC_HELP_STRING([--enable-vty-tests], + [Include the VTY tests in make check [default=yes]]), + [enable_vty_tests="$enableval"],[enable_vty_tests="yes"]) +if test "x$enable_vty_tests" = "xyes" ; then + AM_PATH_PYTHON + AC_CHECK_PROG(OSMOTESTVTY_CHECK,osmotestvty.py,yes) + if test "x$OSMOTESTVTY_CHECK" != "xyes" ; then + AC_MSG_ERROR([Please install osmocom-python to run the vty tests.]) + fi +fi +AC_MSG_CHECKING([whether to enable VTY tests]) +AC_MSG_RESULT([$enable_vty_tests]) +AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes") + AC_OUTPUT( src/Makefile examples/Makefile diff --git a/osmoappdesc.py b/osmoappdesc.py new file mode 100644 index 00000000..b202dc69 --- /dev/null +++ b/osmoappdesc.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# (C) 2013 by Katerina Barone-Adesi <kat.obsc@gmail.com> +# 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-pcu": ["examples/osmo-pcu.cfg"] +} + +apps = [(4240, "src/osmo-pcu", "Osmo-PCU", "osmo-pcu"), + ] + +vty_command = ["src/osmo-pcu", "-c", "examples/osmo-pcu.cfg"] + +vty_app = apps[0] |