Fixed a problem caused by recent sorting patches that made "ordered-by user" lists fail in some cases, causing multiple list entries with same keys. NACM being one example. Thanks vratnikov!
This commit is contained in:
parent
6bf2a74e24
commit
220a872188
3 changed files with 21 additions and 4 deletions
|
|
@ -141,6 +141,7 @@
|
|||
* Added libgen.h for baseline()
|
||||
|
||||
### Corrected Bugs
|
||||
* Fixed a problem caused by recent sorting patches that made "ordered-by user" lists fail in some cases, causing multiple list entries with same keys. NACM being one example. Thanks vratnikov!
|
||||
* [Restconf does not handle startup datastore according to the RFC](https://github.com/clicon/clixon/issues/74)
|
||||
* Failure in startup with -m startup or running left running_db cleared.
|
||||
* Running-db should not be changed on failure. Unless failure-db defined. Or if SEGV, etc. In those cases, tmp_db should include the original running-db.
|
||||
|
|
|
|||
|
|
@ -416,11 +416,9 @@ xml_search1(cxobj *xp,
|
|||
cmp = yangi-yang_order(y);
|
||||
/* Here is right yang order == same yang? */
|
||||
if (cmp == 0){
|
||||
if (userorder){
|
||||
return xml_search_userorder(xp, x1, y, yangi, mid);
|
||||
}
|
||||
else /* Ordered by system */
|
||||
cmp = xml_cmp(x1, xc, 0);
|
||||
if (cmp && userorder) /* Ordered by user (if not equal) */
|
||||
return xml_search_userorder(xp, x1, y, yangi, mid);
|
||||
}
|
||||
if (cmp == 0)
|
||||
return xc;
|
||||
|
|
|
|||
|
|
@ -217,6 +217,24 @@ expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><edit-config><target><can
|
|||
new "verify list user order (as entered)"
|
||||
expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><get-config><source><candidate/></source><filter type="xpath" select="/y2"/></get-config></rpc>]]>]]>' '^<rpc-reply><data><y2 xmlns="urn:example:order"><k>c</k><a>bar</a></y2><y2 xmlns="urn:example:order"><k>b</k><a>foo</a></y2><y2 xmlns="urn:example:order"><k>a</k><a>fie</a></y2></data></rpc-reply>]]>]]>$'
|
||||
|
||||
new "Overwrite existing ordered-by user y2->c"
|
||||
expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><edit-config><target><candidate/></target><config><y2 xmlns="urn:example:order">
|
||||
<k>c</k><a>newc</a>
|
||||
</y2></config></edit-config></rpc>]]>]]>'
|
||||
|
||||
new "Overwrite existing ordered-by user y2->b"
|
||||
expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><edit-config><target><candidate/></target><config><y2 xmlns="urn:example:order">
|
||||
<k>b</k><a>newb</a>
|
||||
</y2></config></edit-config></rpc>]]>]]>'
|
||||
|
||||
new "Overwrite existing ordered-by user y2->a"
|
||||
expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><edit-config><target><candidate/></target><config><y2 xmlns="urn:example:order">
|
||||
<k>a</k><a>newa</a>
|
||||
</y2></config></edit-config></rpc>]]>]]>'
|
||||
|
||||
new "Tests for no duplicates."
|
||||
expecteof "$clixon_netconf -qf $cfg -y $fyang" 0 '<rpc><get-config><source><candidate/></source><filter type="xpath" select="/y2"/></get-config></rpc>]]>]]>' '^<rpc-reply><data><y2 xmlns="urn:example:order"><k>c</k><a>newc</a></y2><y2 xmlns="urn:example:order"><k>b</k><a>newb</a></y2><y2 xmlns="urn:example:order"><k>a</k><a>newa</a></y2></data></rpc-reply>]]>]]>$'
|
||||
|
||||
#-- order by type rather than strings.
|
||||
# there are three leaf-lists:strings, ints, and decimal64, and two lists:
|
||||
# listints and listdecs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue