aboutsummaryrefslogtreecommitdiffstats
path: root/tests/logging/logging_vty_test.vty
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-10-01 15:51:18 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-10-01 15:58:20 +0200
commitea6f519ff84c31acd2689e92adb4dc1688dd9a7a (patch)
treecf8b858f036e80361634d7979a160c1f67de7533 /tests/logging/logging_vty_test.vty
parent40f35212c71e8926b0dfe7463af959f00c56cd82 (diff)
vty logging: fix crash when missing 'logging enable'
We must explicitly check the return value of osmo_log_vty2tgt(), or may run into a segfault. I wasn't aware of this and introduced numerous such cases in I36f17c131cc70ce5a1aef62fd9693097de230cd4. Reproduce: on the VTY, do not issue 'logging enable', invoke 'logging level force-all LEVEL' first. Show in logging_vty_test.vty that this situation is now again amended by telling the user that logging was not enabled. Related: OS#3611 Change-Id: Id11702d1801d6654ca5e5a51b597a0d802e2e8dd
Diffstat (limited to 'tests/logging/logging_vty_test.vty')
-rw-r--r--tests/logging/logging_vty_test.vty3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/logging/logging_vty_test.vty b/tests/logging/logging_vty_test.vty
index 0eedbe35..b1909271 100644
--- a/tests/logging/logging_vty_test.vty
+++ b/tests/logging/logging_vty_test.vty
@@ -28,6 +28,9 @@ logging_vty_test(config-log)# exit
logging_vty_test(config)# no log stderr
logging_vty_test(config)# exit
+logging_vty_test# logging level force-all notice
+Logging was not enabled.
+
logging_vty_test# logging enable
logging_vty_test# logging filter all 1
logging_vty_test# logging print category-hex 0