identity restconf mapping for augment and identity tests

This commit is contained in:
Olof hagsand 2019-07-29 11:34:14 +02:00
parent dbfd92846c
commit 3b93c812d4
8 changed files with 118 additions and 17 deletions

View file

@ -175,6 +175,14 @@ text_modify(clicon_handle h,
goto done;
x1name = xml_name(x1);
if (yang_keyword_get(y0) == Y_LEAF_LIST || yang_keyword_get(y0) == Y_LEAF){
/* This is a check on no further elements as a sanity check for eg
* <leaf>a<leaf>b</leaf></leaf>
*/
if (xml_child_nr_type(x1, CX_ELMNT)){
if (netconf_unknown_element(cbret, "application", x1name, "Leaf contains sub-element") < 0)
goto done;
goto fail;
}
x1bstr = xml_body(x1);
switch(op){
case OP_CREATE:

View file

@ -382,8 +382,11 @@ validate_identityref(cxobj *xt,
}
/* Get idref value. Then see if this value is derived from ytype.
*/
if ((node = xml_body(xt)) == NULL)
return 0;
if ((node = xml_body(xt)) == NULL){ /* It may not be empty */
if (netconf_bad_element_xml(xret, "application", xml_name(xt), "Identityref should not be empty") < 0)
goto done;
goto fail;
}
if (nodeid_split(node, &prefix, &id) < 0)
goto done;
/* This is the type's base reference */
@ -1238,7 +1241,6 @@ xml_yang_validate_list_key_only(clicon_handle h,
goto done;
}
/*! Validate a single XML node with yang specification for all (not only added) entries
* 1. Check leafrefs. Eg you delete a leaf and a leafref references it.
* @param[in] xt XML node to be validated