diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/testsuite.at | 5 | ||||
-rw-r--r-- | tests/vty/ok_deprecated_logging.cfg | 3 | ||||
-rw-r--r-- | tests/vty/vty_test.c | 4 | ||||
-rw-r--r-- | tests/vty/vty_test.ok | 2 |
5 files changed, 14 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 76249966..e8e4dee1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -306,6 +306,7 @@ EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \ vty/ok_more_spaces.cfg \ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ + vty/ok_deprecated_logging.cfg \ comp128/comp128_test.ok bits/bitfield_test.ok \ utils/utils_test.ok utils/utils_test.err stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ diff --git a/tests/testsuite.at b/tests/testsuite.at index c231b964..58651409 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -199,7 +199,10 @@ AT_SETUP([vty]) AT_KEYWORDS([vty]) cat $abs_srcdir/vty/vty_test.ok > expout cp $abs_srcdir/vty/*.cfg . -AT_CHECK([$abs_top_builddir/tests/vty/vty_test], [0], [expout], [ignore]) +# FIXME: calling vty_out() during initialization of the VTY interface would cause +# the process write to its own *stdin*! This breaks the output of 'make check'. +# Let's work this around untill the bug in libosmovty is fixed. +AT_CHECK([$abs_top_builddir/tests/vty/vty_test 0>/dev/null], [0], [expout], [ignore]) AT_CLEANUP AT_SETUP([gprs-bssgp]) diff --git a/tests/vty/ok_deprecated_logging.cfg b/tests/vty/ok_deprecated_logging.cfg new file mode 100644 index 00000000..2699719e --- /dev/null +++ b/tests/vty/ok_deprecated_logging.cfg @@ -0,0 +1,3 @@ +log stderr + logging filter all 1 + logging level depr debug diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 0d68a6c0..1139638d 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -29,6 +29,7 @@ #include <osmocom/core/application.h> #include <osmocom/core/talloc.h> +#include <osmocom/core/logging_internal.h> #include <osmocom/core/logging.h> #include <osmocom/core/stats.h> #include <osmocom/core/utils.h> @@ -442,6 +443,8 @@ void test_vty_add_cmds() install_element(CONFIG_NODE, &cfg_ret_warning_cmd); install_element(CONFIG_NODE, &cfg_ret_success_cmd); + logging_vty_add_deprecated_subsys(tall_log_ctx, "depr"); + install_element(CONFIG_NODE, &cfg_level1_cmd); install_node(&level1_node, NULL); install_element(LEVEL1_NODE, &cfg_level1_child_cmd); @@ -544,6 +547,7 @@ int main(int argc, char **argv) test_exit_by_indent("ok_indented_root.cfg", 0); test_exit_by_indent("ok_empty_parent.cfg", 0); test_exit_by_indent("fail_cmd_ret_warning.cfg", -EINVAL); + test_exit_by_indent("ok_deprecated_logging.cfg", 0); test_is_cmd_ambiguous(); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index 0b5ac9c0..d2c96111 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -290,6 +290,8 @@ reading file fail_cmd_ret_warning.cfg, expecting rc=-22 Called: 'return-success' Called: 'return-warning' got rc=-22 +reading file ok_deprecated_logging.cfg, expecting rc=0 +got rc=0 Going to test is_cmd_ambiguous() Going to execute 'ambiguous_nr' Called: 'ambiguous_nr [<0-23>]' (argc=0) |