From 3a9ff11e574fa7ee19b1062b2c90151dbf7f0e27 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 10 Sep 2018 17:18:28 +0200 Subject: logging vty: add VTY transcript test I am setting out to refactor various details about logging. To show the effect, I am first adding this new test to illustrate the exact effects on the various osmo programs. Add logging_vty_test.c as a standalone program that simply defines a few logging categories and opens a telnet vty to play with. Add logging_vty_test.vty, as an osmo_verify_transcript_vty.py test script. Add --enable-external-tests to configure.ac, to enable running logging_vty_test.vty during 'make check'. Also allow running 'make vty-test' without the need to first configure with --enable-external-tests (a flexibility I've missed many times over in the other osmo source trees). Add a Makefile.am stub for external CTRL tests, basically a copy-paste from osmo-msc.git. I doubt that libosmocore will get python driven CTRL interface testing any time soon, but if so we will know to not run it concurrently. Change-Id: I948e832a33131f8eab98651d6010ceb0ccbc9a9c --- tests/Makefile.am | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 5d07695a..18d4bb4a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,7 +24,9 @@ check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ prbs/prbs_test gsm23003/gsm23003_test \ codec/codec_ecu_fr_test timer/clk_override_test \ - oap/oap_client_test + oap/oap_client_test \ + logging/logging_vty_test \ + $(NULL) if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -148,6 +150,9 @@ gb_gprs_ns_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_D logging_logging_test_SOURCES = logging/logging_test.c +logging_logging_vty_test_SOURCES = logging/logging_vty_test.c +logging_logging_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la + fr_fr_test_SOURCES = fr/fr_test.c fr_fr_test_LDADD = $(LDADD) $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DLSYM) \ $(top_builddir)/src/vty/libosmovty.la \ @@ -280,6 +285,7 @@ TESTSUITE = $(srcdir)/testsuite check-local: atconfig $(TESTSUITE) cat /proc/cpuinfo $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + $(MAKE) $(AM_MAKEFLAGS) ext-tests installcheck-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ @@ -298,3 +304,25 @@ $(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \ --target-path $(builddir)/conv + +if ENABLE_EXT_TESTS +ext-tests: +# don't run vty and ctrl tests concurrently so that the ports don't conflict + $(MAKE) vty-test + $(MAKE) ctrl-test +else +ext-tests: + echo "Not running python-based external tests (determined at configure-time)" +endif + +# To update the VTY script from current application behavior, +# pass -u to osmo_verify_transcript_vty.py by doing: +# make vty-test U=-u +vty-test: + osmo_verify_transcript_vty.py -v \ + -p 42042 \ + -r "$(top_builddir)/tests/logging/logging_vty_test" \ + $(U) $(srcdir)/logging/*.vty + +ctrl-test: + echo "No CTRL tests exist currently" -- cgit v1.2.3