summaryrefslogtreecommitdiffstats
path: root/tests/vty/vty_test.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-09-07 04:52:05 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-09-08 23:45:52 +0000
commitd64b6aed235f6e4d84a2cb8e84b32c3179260254 (patch)
tree2b5b3297248f72732aa3ff78f3539e08460b4e70 /tests/vty/vty_test.c
parent889ab16437297a2ce1885efde5e2efc4816851ff (diff)
VTY: interactive: never look for matching commands on parent node
For interactive telnet VTY, remove the implicit move up to the parent node when a command did not succeed on the current node level. When reading config files, this behavior was useful to allow skipping explicit 'exit' commands. (A different patch deals with that.) In the telnet VTY, this behavior was never necessary. Explicit 'exit' commands can move to the parent node, and typically uninformed users expect to require that. On a telnet VTY, counting indents like for reading config files is not an option: a user will always type from the first column or may paste some leading spaces without intended meaning. After this patch, it is thus no longer possible to paste a complete config across several node levels directly to a telnet session, unless it contains 'exit' commands. Change-Id: Id73cba2dd34676bad8a130e9c45e67a272f19588
Diffstat (limited to 'tests/vty/vty_test.c')
-rw-r--r--tests/vty/vty_test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c
index 1e1b495a..d84bf419 100644
--- a/tests/vty/vty_test.c
+++ b/tests/vty/vty_test.c
@@ -155,14 +155,12 @@ static void test_node_tree_structure(void)
OSMO_ASSERT(vty->node == ENABLE_NODE);
- /* Check searching the parents nodes for matching commands. */
+ /* Check for not searching the parent node for matching commands. */
OSMO_ASSERT(do_vty_command(vty, "configure terminal") == CMD_SUCCESS);
OSMO_ASSERT(vty->node == CONFIG_NODE);
OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS);
OSMO_ASSERT(vty->node == CFG_LOG_NODE);
- OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_SUCCESS);
- OSMO_ASSERT(vty->node == VTY_NODE);
- OSMO_ASSERT(do_vty_command(vty, "log stderr") == CMD_SUCCESS);
+ OSMO_ASSERT(do_vty_command(vty, "line vty") == CMD_ERR_NO_MATCH);
OSMO_ASSERT(vty->node == CFG_LOG_NODE);
OSMO_ASSERT(do_vty_command(vty, "end") == CMD_SUCCESS);
OSMO_ASSERT(vty->node == ENABLE_NODE);