From 233a2f762f6d0e1d133874c2ceed9570861d9363 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 13 Mar 2025 14:39:44 +0100 Subject: [PATCH] Test of [Expand of variables broken in 7.3](https://github.com/clicon/cligen/issues/127) --- test/test_cli_expand.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/test_cli_expand.sh b/test/test_cli_expand.sh index ffe0240e..13c57218 100755 --- a/test/test_cli_expand.sh +++ b/test/test_cli_expand.sh @@ -50,6 +50,15 @@ module clixon-example{ } } } + container cont1 { + leaf leaf1 { + type enumeration { + enum ab; + enum ba; + enum bcd; + } + } + } } EOF @@ -70,6 +79,7 @@ delete("Delete a configuration item") { @datamodel, cli_auto_del(); all("Delete whole candidate configuration"), delete_all("candidate"); } +discard("Discard edits (rollback 0)"), discard_changes(); show("Show a particular state of the system"){ configuration("Show configuration"), cli_show_auto_mode("candidate", "text", true, false);{ xml("Show configuration as XML"), cli_show_auto_mode("candidate", "xml", false, false); @@ -106,6 +116,15 @@ expectpart "$(echo "set list1 xyz list2 ?" | $clixon_cli -f $cfg 2>&1)" 0 123 ab new "Expand " expectpart "$(echo "set list1 xyz list2 " | $clixon_cli -f $cfg 2>&1)" 0 123 abc "" +new "Discard" +expectpart "$($clixon_cli -1f $cfg discard)" 0 "^$" + +new "Expand enum" +expectpart "$($clixon_cli -1f $cfg set cont1 leaf1 bc)" 0 "^$" + +new "Show expanded" +expectpart "$($clixon_cli -1f $cfg show config xml)" 0 "bcd" + if [ $BE -ne 0 ]; then new "Kill backend" # Check if premature kill