diff --git a/CHANGELOG.md b/CHANGELOG.md index 32719069..6296c455 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,8 +66,18 @@ Users may have to change how they access the system * Check of incoming RPCs * Check of non-presence containers +### C/CLI-API changes on existing features + +Developers may need to change their code + +* CLISPEC change: Changed signature of `cli_show_auto()` and `cli_show_auto_state()` + * Added parameters for pretty-print, state and with-default + * As developer, you only need to replace the old functions if you have the cli prefix parameter set: + * `cli_show_auto(, , )` -> `cli_show_auto(, , true, false, "report-all", )` + ### Corrected Bugs +* Fixed: [All values in list don't appear when writing "show " in cli](https://github.com/clicon/clixon/issues/359) * Fixed: [yang regular char \w not include underline char](https://github.com/clicon/clixon/issues/357) * Fixed: [Clixon backend transactions for choice/case is not logical](https://github.com/clicon/clixon/issues/361) * Fixed: [Clixon backend transaction callback fails for empty types](https://github.com/clicon/clixon/issues/360) diff --git a/apps/cli/cli_auto.c b/apps/cli/cli_auto.c index 0e3d8b18..a3f0f5d8 100644 --- a/apps/cli/cli_auto.c +++ b/apps/cli/cli_auto.c @@ -346,7 +346,7 @@ cli_auto_top(clicon_handle h, * "running"|"candidate"|"startup" * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) * true|false: pretty-print or not - * true|false: include state in output + * true|false: also print state * Retrieval default mode: report-all, trim, explicit, report-all-tagged, * report-all-tagged-default, report-all-tagged-strip * CLI prefix: to print before cli syntax output @@ -507,13 +507,13 @@ cli_auto_show(clicon_handle h, goto done; break; case FORMAT_NETCONF: - fprintf(stdout, "", + cligen_output(stdout, "", NETCONF_BASE_NAMESPACE, NETCONF_MESSAGE_ID_ATTR); if (pretty) - fprintf(stdout, "\n"); + cligen_output(stdout, "\n"); if (clixon_xml2file(stdout, xp, 2, pretty, cligen_output, skiproot, 1) < 0) goto done; - fprintf(stdout, "]]>]]>\n"); + cligen_output(stdout, "]]>]]>\n"); break; } /* switch */ } diff --git a/apps/cli/cli_show.c b/apps/cli/cli_show.c index fcb8cad6..8fd305f1 100644 --- a/apps/cli/cli_show.c +++ b/apps/cli/cli_show.c @@ -673,19 +673,23 @@ int cli_show_version(clicon_handle h, * * This callback can be used only in context of an autocli generated syntax tree, such as: * show @datamodel, cli_show_auto(); - * * @param[in] h CLICON handle * @param[in] state If set, show both config and state, otherwise only config * @param[in] cvv Vector of variables from CLIgen command-line * @param[in] argv String vector: [] * Format of argv: * Generated API PATH - * "running"|"candidate"|"startup" - * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) - * to print before cli syntax output + * "running"|"candidate"|"startup" + * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) + * true|false: pretty-print or not (Optional) + * true|false: also print state + * Retrieval default mode: report-all, trim, explicit, report-all-tagged, + * report-all-tagged-default, report-all-tagged-strip (Optional) + * To print before cli syntax outptu * @note if state parameter is set, then db must be running * @note that first argument is generated by code. * @see cli_show_config1 + * XXX Merge with cli_auto_show */ static int cli_show_auto1(clicon_handle h, @@ -707,9 +711,18 @@ cli_show_auto1(clicon_handle h, char *api_path = NULL; char *prefix = NULL; int cvvi = 0; + cg_var *boolcv = NULL; + char *defaultstr = NULL; /* with extended tagged modes */ + char *withdefaultstr = NULL; /* RFC 6243 modes */ + int pretty = 1; + cxobj **vec = NULL; + size_t veclen; + int i; + yang_stmt *yp; + enum rfc_6020 ys_keyword; - if (cvec_len(argv) < 3 || cvec_len(argv) > 4){ - clicon_err(OE_PLUGIN, EINVAL, "Usage: * . (*) generated."); + if (cvec_len(argv) < 3 || cvec_len(argv) > 7){ + clicon_err(OE_PLUGIN, EINVAL, "Usage: * [ ]. Number of args:%d", cvec_len(argv)); goto done; } /* First argv argument: API_path format */ @@ -718,14 +731,50 @@ cli_show_auto1(clicon_handle h, db = cv_string_get(cvec_i(argv, 1)); /* Third format: output format */ formatstr = cv_string_get(cvec_i(argv, 2)); - if (cvec_len(argv) > 3){ - /* Fourth format: prefix to print before cli syntax */ - prefix = cv_string_get(cvec_i(argv, 3)); - } if ((int)(format = format_str2int(formatstr)) < 0){ clicon_err(OE_PLUGIN, 0, "Not valid format: %s", formatstr); goto done; } + if (cvec_len(argv) > 3){ + /* Fourth: pretty-print */ + if ((boolcv = cv_new(CGV_BOOL)) == NULL){ + clicon_err(OE_UNIX, errno, "cv_new"); + goto done; + } + if (cv_parse(cv_string_get(cvec_i(argv, 3)), boolcv) < 0){ + clicon_err(OE_UNIX, errno, "Parse boolean %s", cv_string_get(cvec_i(argv, 3))); + goto done; + } + pretty = cv_bool_get(boolcv); + } + if (cvec_len(argv) > 4){ + if (cv_parse(cv_string_get(cvec_i(argv, 4)), boolcv) < 0){ + clicon_err(OE_UNIX, errno, "Parse boolean %s", cv_string_get(cvec_i(argv, 4))); + goto done; + } + state = cv_bool_get(boolcv); + } + if (cvec_len(argv) > 5){ + defaultstr = cv_string_get(cvec_i(argv, 5)); + /* From extended to RFC6243 withdefault modes */ + if (strcmp(defaultstr, "report-all-tagged-strip") == 0) + withdefaultstr = "report-all-tagged"; + else if (strcmp(defaultstr, "report-all-tagged-default") == 0) + withdefaultstr = "report-all-tagged"; + else if (strcmp(defaultstr, "report-all") != 0 && + strcmp(defaultstr, "trim") != 0 && + strcmp(defaultstr, "explicit") != 0 && + strcmp(defaultstr, "report-all-tagged") != 0){ + clicon_err(OE_YANG, EINVAL, "Unexpected with-default option: %s", defaultstr); + goto done; + } + else + withdefaultstr = defaultstr; + } + if (cvec_len(argv) > 6){ + /* Fourth format: prefix to print before cli syntax */ + prefix = cv_string_get(cvec_i(argv, 6)); + } if ((yspec = clicon_dbspec_yang(h)) == NULL){ clicon_err(OE_FATAL, 0, "No DB_SPEC"); goto done; @@ -734,61 +783,104 @@ cli_show_auto1(clicon_handle h, goto done; if (api_path2xpath(api_path, yspec, &xpath, &nsc, NULL) < 0) goto done; + if (xpath == NULL){ + clicon_err(OE_FATAL, 0, "Invalid api-path-fmt: %s", api_path_fmt); + goto done; + } /* XXX Kludge to overcome a trailing / in show, that I cannot add to * yang2api_path_fmt_1 where it should belong. */ - if (xpath[strlen(xpath)-1] == '/') + if (xpath && xpath[strlen(xpath)-1] == '/') xpath[strlen(xpath)-1] = '\0'; - - if (state == 0){ /* Get configuration-only from database */ - if (clicon_rpc_get_config(h, NULL, db, xpath, nsc, NULL, &xt) < 0) + if (state && strcmp(db, "running") != 0){ + clicon_err(OE_FATAL, 0, "Show state only for running database, not %s", db); + goto done; + } + if (state == 0){ /* Get configuration-only from a database */ + if (clicon_rpc_get_config(h, NULL, db, xpath, nsc, withdefaultstr, &xt) < 0) goto done; } - else{ /* Get configuration and state from database */ - if (strcmp(db, "running") != 0){ - clicon_err(OE_FATAL, 0, "Show state only for running database, not %s", db); - goto done; - } - if (clicon_rpc_get(h, xpath, nsc, CONTENT_ALL, -1, NULL, &xt) < 0) + else { /* Get configuration and state from running */ + if (clicon_rpc_get(h, xpath, nsc, CONTENT_ALL, -1, withdefaultstr, &xt) < 0) goto done; } if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){ clixon_netconf_error(xerr, "Get configuration", NULL); goto done; } - if ((xp = xpath_first(xt, nsc, "%s", xpath)) != NULL){ - /* Print configuration according to format */ - switch (format){ - case FORMAT_CLI: - if (clixon_cli2file(h, stdout, xp, prefix, cligen_output, 0) < 0) /* cli syntax */ - goto done; - break; - case FORMAT_NETCONF: - fprintf(stdout, "\n"); - if (clixon_xml2file(stdout, xp, 2, 1, fprintf, 0, 1) < 0) - goto done; - fprintf(stdout, "]]>]]>\n"); - break; - case FORMAT_JSON: - if (clixon_json2file(stdout, xp, 1, cligen_output, 0, 1) < 0) - goto done; - break; - case FORMAT_TEXT: - if (clixon_txt2file(stdout, xp, 0, cligen_output, 0, 1) < 0) - goto done; - break; - case FORMAT_XML: - if (clixon_xml2file(stdout, xp, 0, 1, fprintf, 0, 1) < 0) - goto done; - break; + if (xpath_vec(xt, nsc, "%s", &vec, &veclen, xpath) < 0) + goto done; + if (veclen){ + xp = vec[0]; /* First peek to see if it is special case yang list */ + if ((yp = xml_spec(xp)) != NULL) + ys_keyword = yang_keyword_get(xml_spec(xp)); + else + ys_keyword = 0; + /* Special case LIST */ + if ((ys_keyword == Y_LIST || ys_keyword == Y_LEAF_LIST) && format == FORMAT_JSON){ + switch (format){ + case FORMAT_JSON: + if (xml2json_vec(stdout, vec, veclen, pretty) < 0) // XXX cligen_output + goto done; + break; + default: + break; + } } + else /* Default */ + for (i=0; i", + NETCONF_BASE_NAMESPACE, NETCONF_MESSAGE_ID_ATTR); + if (pretty) + cligen_output(stdout, "\n"); + } + if (clixon_xml2file(stdout, xp, 2, pretty, cligen_output, 0, 1) < 0) + goto done; + if (i == veclen-1) + cligen_output(stdout, "]]>]]>\n"); + break; + } + } + + } retval = 0; done: + if (boolcv) + cv_free(boolcv); if (nsc) xml_nsctx_free(nsc); if (api_path) free(api_path); + if (vec) + free(vec); if (xpath) free(xpath); if (xt) @@ -799,9 +891,13 @@ cli_show_auto1(clicon_handle h, /*! Generic show configuration CLIgen callback using generated CLI syntax * Format of argv: * Generated API PATH - * "running"|"candidate"|"startup" - * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) - * to print before cli syntax outptu + * "running"|"candidate"|"startup" + * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) + * true|false: pretty-print or not (Optional) + * true|false: also print state + * Retrieval default mode: report-all, trim, explicit, report-all-tagged, + * report-all-tagged-default, report-all-tagged-strip (Optional) + * To print before cli syntax outptu * @see cli_show_auto_state For config and state * @note SHOULD be used: ... @datamodel, cli_show_auto(,...) to get correct #args * @see cli_auto_show @@ -820,6 +916,9 @@ cli_show_auto(clicon_handle h, * Generated API PATH * "running" * "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) + * true|false: pretty-print or not (Optional) + * Retrieval default mode: report-all, trim, explicit, report-all-tagged, + * report-all-tagged-default, report-all-tagged-strip (Optional) * to print before cli syntax output * @see cli_show_auto For config only * @see cli_show_config_state Not auto-generated diff --git a/example/main/example_cli.cli b/example/main/example_cli.cli index 551ed724..afcec4de 100644 --- a/example/main/example_cli.cli +++ b/example/main/example_cli.cli @@ -69,7 +69,13 @@ copy("Copy and create a new object") { discard("Discard edits (rollback 0)"), discard_changes(); show("Show a particular state of the system"){ - auto("Show expand") @datamodelshow, cli_show_auto("candidate", "xml"); + auto("Show expand x"){ + xml @datamodelshow, cli_show_auto("candidate", "xml", true, false, "report-all"); + text @datamodelshow, cli_show_auto("candidate", "text", true, false, "report-all"); + json @datamodelshow, cli_show_auto("candidate", "json", true, false, "report-all"); + netconf @datamodelshow, cli_show_auto("candidate", "netconf", true, false, "report-all"); + cli @datamodelshow, cli_show_auto("candidate", "cli", true, false, "report-all", "set "); + } xpath("Show configuration") ("XPATH expression") [("Namespace")], show_conf_xpath("candidate"); version("Show version"), cli_show_version("candidate", "text", "/"); diff --git a/test/test_autocli_listkey_compress.sh b/test/test_autocli_listkey_compress.sh index db0fe0ba..ce981d6e 100755 --- a/test/test_autocli_listkey_compress.sh +++ b/test/test_autocli_listkey_compress.sh @@ -149,9 +149,9 @@ merge @datamodel, cli_merge(); create @datamodel, cli_create(); delete @datamodel, cli_del(); show config, cli_show_config("candidate", "cli", "/", 0, "set "); -show config @datamodel, cli_show_auto("candidate", "cli", "set "); +show config @datamodel, cli_show_auto("candidate", "cli", true, false, "report-all", "set "); show state, cli_show_config_state("running", "cli", "/", "set "); -show state @datamodelstate, cli_show_auto_state("running", "cli", "set "); +show state @datamodelstate, cli_show_auto_state("running", "cli", true, true, "report-all", "set "); show xml, cli_show_config("candidate", "xml", "/"); show xml @datamodel, cli_show_auto("candidate", "xml"); commit, cli_commit(); diff --git a/test/test_autocli_show.sh b/test/test_autocli_show.sh new file mode 100755 index 00000000..79b2fdfe --- /dev/null +++ b/test/test_autocli_show.sh @@ -0,0 +1,232 @@ +#!/usr/bin/env bash +# Autocli show tests +# Go through all formats and show for all formats + +# Magic line must be first in script (see README.md) +s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi + +APPNAME=example + +# include err() and new() functions and creates $dir + +cfg=$dir/conf_yang.xml +clidir=$dir/cli + +fyang=$dir/clixon-example.yang + +formatdir=$dir/format +test -d ${formatdir} || rm -rf ${formatdir} +mkdir $formatdir + +test -d ${clidir} || rm -rf ${clidir} +mkdir $clidir + +# Use yang in example + +cat < $cfg + + ietf-netconf:startup + $cfg + ${YANG_INSTALLDIR} + $IETFRFC + $dir + /usr/local/lib/$APPNAME/backend + $APPNAME + /usr/local/lib/$APPNAME/cli + $clidir + /usr/local/var/$APPNAME/$APPNAME.sock + /usr/local/var/$APPNAME/$APPNAME.pidfile + /usr/local/var/$APPNAME + +EOF + +cat < $fyang +module clixon-example { + yang-version 1.1; + namespace "urn:example:clixon"; + prefix ex; + /* Generic config data */ + container table{ + list parameter{ + key name; + leaf name{ + type string; + } + leaf value{ + type string; + } + leaf-list array1{ + type string; + } + } + } +} +EOF + +cat < $clidir/ex.cli +# Clixon example specification +CLICON_MODE="example"; +CLICON_PROMPT="%U@%H %W> "; +CLICON_PLUGIN="example_cli"; + +set @datamodel, cli_auto_set(); +delete("Delete a configuration item") { + @datamodel, cli_auto_del(); + all("Delete whole candidate configuration"), delete_all("candidate"); +} +validate("Validate changes"), cli_validate(); +commit("Commit the changes"), cli_commit(); +quit("Quit"), cli_quit(); +discard("Discard edits (rollback 0)"), discard_changes(); +show("Show a particular state of the system"){ + configuration("Show configuration"){ + xml("Show configuration as XML"), cli_auto_show("datamodel", "candidate", "xml", false, false); + json("Show configuration as JSON"), cli_auto_show("datamodel", "candidate", "json", false, false); + text("Show configuration as TEXT"), cli_auto_show("datamodel", "candidate", "text", false, false); + cli("Show configuration as CLI commands"), cli_auto_show("datamodel", "candidate", "cli", false, false, "report-all", "set "); + netconf("Show configuration as NETCONF"), cli_auto_show("datamodel", "candidate", "netconf", false, false); + } + auto("Show auto") { + xml("Show configuration as XML") @datamodelshow, cli_show_auto("candidate", "xml", false, false, "report-all"); + json("Show configuration as JSON") @datamodelshow, cli_show_auto("candidate", "json", false, false, "report-all"); + text("Show configuration as TEXT")@datamodelshow, cli_show_auto("candidate", "text", false, false, "report-all"); + cli("Show configuration as CLI commands") @datamodelshow, cli_show_auto("candidate", "cli", false, false, "report-all", "set "); + netconf("Show configuration as NETCONF")@datamodelshow, cli_show_auto("candidate", "netconf", false, false, "report-all"); + } +} +EOF + +new "test params: -f $cfg" +if [ $BE -ne 0 ]; then + new "kill old backend" + sudo clixon_backend -z -f $cfg + if [ $? -ne 0 ]; then + err + fi + new "start backend -s init -f $cfg" + start_backend -s init -f $cfg +fi + +new "wait backend" +wait_backend + +# Create two lists +new "cli create list table x" +expectpart "$($clixon_cli -1 -f $cfg -l o set table parameter x value 1)" 0 "^$" + +new "cli create list table y" +expectpart "$($clixon_cli -1 -f $cfg -l o set table parameter y value 2)" 0 "^$" + +# Create two leaf-lists +new "cli create leaflist array1 a" +expectpart "$($clixon_cli -1 -f $cfg -l o set table parameter x array1 a)" 0 "^$" + +new "cli create leaflist array1 b" +expectpart "$($clixon_cli -1 -f $cfg -l o set table parameter x array1 b)" 0 "^$" + +new "cli commit" +expectpart "$($clixon_cli -1 -f $cfg -l o commit)" 0 "^$" + +# XML +format=xml + +new "cli check show config $format" +X='x1aby2
' +expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "^$X$" + +new "cli check show auto $format table" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 "^$X$" + +new "cli check show auto $format table parameter" +X='x1aby2' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter)" 0 "^$X$" + +new "cli check show auto $format table parameter x" +X='x1ab' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x)" 0 "^$X$" + +new "cli check show auto $format table parameter x array1" +X='ab' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x array1)" 0 "^$X$" + +# JSON +format=json + +new "cli check show config $format" +X='{"clixon-example:table":{"parameter":\[{"name":"x","value":"1","array1":\["a","b"\]},{"name":"y","value":"2"}\]}}' +expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "^$X$" + +new "cli check show auto $format table" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 "^$X$" + +new "cli check show auto $format table parameter" +X='{"clixon-example:parameter":\[{"name":"x","value":"1","array1":\["a","b"\]},{"name":"y","value":"2"}\]}' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter)" 0 "^$X$" + +new "cli check show auto $format table parameter x" +X='{"clixon-example:parameter":\[{"name":"x","value":"1","array1":\["a","b"\]}\]}' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x)" 0 "^$X$" + +new "cli check show auto $format table parameter x array1" +X='{"clixon-example:array1":\["a","b"\]}' +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x array1)" 0 "^$X$" + +# TEXT +format=text + +new "cli check show config $format" +expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "clixon-example:table {" "parameter x {" "array1 \[" "parameter y {" + +new "cli check show auto $format table" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 + +new "cli check show auto $format table parameter" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter)" 0 "parameter x {" "array1 \[" "parameter y {" --not-- "clixon-example:table {" + +new "cli check show auto $format table parameter x" + +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x)" 0 "parameter x {" "array1 \[" --not-- "clixon-example:table {" "parameter y {" + +# XXX prints two [] lists, should only print one +new "cli check show auto $format table parameter x array1" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table parameter x array1)" 0 "array1 \[" --not-- "clixon-example:table {" "parameter y {" "parameter x {" + +# CLI +format=cli + +new "cli check show config $format" +expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "set table parameter x" "set table parameter x value 1" "set table parameter x array1 a" "set table parameter x array1 b" "set table parameter y" "set table parameter y value 2" + +new "cli check show auto $format table" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 "set table parameter x" "set table parameter x value 1" "set table parameter x array1 a" "set table parameter x array1 b" "set table parameter y" "set table parameter y value 2" + +# XXX rest does not print whole CLI path to root, eg does not include "table" + +# NETCONF +format=netconf + +# XXX netconf base capability 0, EOM framing +new "cli check show config $format" +X='x1aby2
]]>]]>' +expectpart "$($clixon_cli -1 -f $cfg -l o show config $format)" 0 "^$X$" + +new "cli check show auto $format table" +expectpart "$($clixon_cli -1 -f $cfg -l o show auto $format table)" 0 "^$X$" + +# XXX rest does not print whole NETCONF path to root, eg does not include "table" + +if [ $BE -ne 0 ]; then + new "Kill backend" + # Check if premature kill + pid=$(pgrep -u root -f clixon_backend) + if [ -z "$pid" ]; then + err "backend already dead" + fi + # kill backend + stop_backend -f $cfg +fi + +rm -rf $dir + +new "endtest" +endtest diff --git a/test/test_autocli_treeref.sh b/test/test_autocli_treeref.sh index b4660d78..761103f9 100755 --- a/test/test_autocli_treeref.sh +++ b/test/test_autocli_treeref.sh @@ -111,9 +111,9 @@ CLICON_MODE="example"; CLICON_PROMPT="%U@%H> "; show { - base @datamodel, cli_show_auto_state("running", "cli", "set "); - add-nonconfig @datamodelstate, cli_show_auto_state("running", "cli", "set "); - add-show @datamodelshow, cli_show_auto_state("running", "cli", "set "); + base @datamodel, cli_show_auto_state("running", "cli", true, false, "report-all","set "); + add-nonconfig @datamodelstate, cli_show_auto_state("running", "cli", true, false, "report-all","set "); + add-show @datamodelshow, cli_show_auto_state("running", "cli", true, false, "report-all","set "); } auto { diff --git a/test/test_cli_union.sh b/test/test_cli_union.sh index 5936672c..8802ed8f 100755 --- a/test/test_cli_union.sh +++ b/test/test_cli_union.sh @@ -92,7 +92,7 @@ validate("Validate changes"), cli_validate(); commit("Commit the changes"), cli_commit(); quit("Quit"), cli_quit(); show("Show a particular state of the system"){ - auto("Show expand") @datamodel, cli_show_auto("running", "xml", "set"); + auto("Show expand") @datamodel, cli_show_auto("running", "xml"); candidate("Show configuration"), cli_auto_show("datamodel", "candidate", "xml", false, false); running("Show configuration"), cli_auto_show("datamodel", "running", "xml", false, false); } diff --git a/test/test_datastore_format.sh b/test/test_datastore_format.sh index 73323006..5d1084f7 100755 --- a/test/test_datastore_format.sh +++ b/test/test_datastore_format.sh @@ -60,10 +60,6 @@ module clixon-example { leaf-list array1{ type string; } -/* leaf-list array2{ - type string; - } -*/ } } } @@ -109,8 +105,8 @@ show("Show a particular state of the system"){ } configuration("Show configuration"), cli_auto_show("datamodel", "candidate", "text", true, false);{ cli("Show configuration as CLI commands"), cli_auto_show("datamodel", "candidate", "cli", true, false, "report-all", "set "); - xml("Show configuration as XML"), cli_auto_show("datamodel", "candidate", "xml", true, false, "set "); - text("Show configuration as TEXT"), cli_auto_show("datamodel", "candidate", "text", true, false, "set "); + xml("Show configuration as XML"), cli_auto_show("datamodel", "candidate", "xml", true, false); + text("Show configuration as TEXT"), cli_auto_show("datamodel", "candidate", "text", true, false); } } save("Save candidate configuration to XML file") ("Filename (local filename)"), save_config_file("candidate","filename", "xml"){