diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ee0eae..f23c555e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Example extended with inclusion of iana-if-type RFC 7224 interface identities * Applications which have not strictly enforced the identities may now have problems with validation and may need to be modified. ### Minor changes: +* Validation of yang bits type space-separated list value * Added -U command line to clixon_cli and clixon_netconf for NACM pseudo-user tests * Added a generated CLI show command that works on the generated parse tree with auto completion. * A typical call is: show @datamodel:example, cli_show_auto("candidate", "json"); diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index d721b471..e917f75d 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -809,6 +809,7 @@ from_client_debug(clicon_handle h, * has the special value "*". * @retval 0 No match * @retval 1 Match + * XXX access_operations is bit-fields */ static int nacm_match_access(char *access_operations, @@ -818,7 +819,7 @@ nacm_match_access(char *access_operations, return 0; if (strcmp(access_operations,"*")==0) return 1; - if (strstr(mode, access_operations)!=NULL) + if (strstr(access_operations, mode)!=NULL) return 1; return 0; } @@ -874,6 +875,7 @@ nacm_match_rule(clicon_handle h, module_name = xml_find_body(xrule, "module-name"); rpc_name = xml_find_body(xrule, "rpc-name"); + /* XXX access_operations can be a set of bits */ access_operations = xml_find_body(xrule, "access-operations"); action = xml_find_body(xrule, "action"); clicon_debug(1, "%s: %s %s %s %s", __FUNCTION__, diff --git a/test/test_type.sh b/test/test_type.sh index cae1227a..2658fe8a 100755 --- a/test/test_type.sh +++ b/test/test_type.sh @@ -122,6 +122,17 @@ module example{ range "min..max"; } }*/ + typedef mybits { + description "Test adding several bits"; + type bits { + bit create; + bit read; + bit write; + } + } + leaf mbits{ + type mybits; + } } EOF @@ -177,6 +188,19 @@ expecteof "$clixon_netconf -qf $cfg -y $fyang" "]]>]]>" "^create read]]>]]>" "^]]>]]>$" + +new "cli bits validate" +expectfn "$clixon_cli -1f $cfg -l o -y $fyang validate" 0 "^$" + new "Kill backend" # Check if still alive pid=`pgrep clixon_backend`