Change in ...libosmocore[master]: vty: tests: Verify incomplete optional parameters are passed to vty f...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Jun 12 16:41:02 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/14431


Change subject: vty: tests: Verify incomplete optional parameters are passed to vty funcs
......................................................................

vty: tests: Verify incomplete optional parameters are passed to vty funcs

The test shows that in the case were "single0 on" is executed, VTY
function should return complete "single0 one" but it doesn't.

Related: OS#4045
Change-Id: Ib5b9dc07e2b280dc95011b3926afb1d490cadd81
---
M tests/vty/vty_transcript_test.c
M tests/vty/vty_transcript_test.vty
2 files changed, 18 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/14431/1

diff --git a/tests/vty/vty_transcript_test.c b/tests/vty/vty_transcript_test.c
index 7ffe713..6651097 100644
--- a/tests/vty/vty_transcript_test.c
+++ b/tests/vty/vty_transcript_test.c
@@ -154,6 +154,14 @@
 	.num_cat = ARRAY_SIZE(default_categories),
 };
 
+DEFUN(single0, single0_cmd,
+      "single0 [one]",
+      "single0 test command\n" "1\n")
+{
+	vty_out(vty, "ok argc=%d%s%s%s", argc, argc ? " " : "", argc ? argv[0] : "", VTY_NEWLINE);
+	return CMD_SUCCESS;
+}
+
 DEFUN(multi0, multi0_cmd,
       "multi0 (one|two|three)",
       "multi0 test command\n" "1\n2\n3\n")
@@ -180,6 +188,7 @@
 
 static void init_vty_cmds()
 {
+	install_element_ve(&single0_cmd);
 	install_element_ve(&multi0_cmd);
 	install_element_ve(&multi1_cmd);
 	install_element_ve(&multi2_cmd);
diff --git a/tests/vty/vty_transcript_test.vty b/tests/vty/vty_transcript_test.vty
index 5ed3c1d..1557744 100644
--- a/tests/vty/vty_transcript_test.vty
+++ b/tests/vty/vty_transcript_test.vty
@@ -75,3 +75,12 @@
 
 vty_transcript_test> multi2 t
 % Ambiguous command.
+
+vty_transcript_test> single0 one
+ok argc=1 one
+
+vty_transcript_test> single0 on
+ok argc=1 on
+
+vty_transcript_test> single0
+ok argc=0

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14431
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib5b9dc07e2b280dc95011b3926afb1d490cadd81
Gerrit-Change-Number: 14431
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190612/125554fe/attachment.htm>


More information about the gerrit-log mailing list