* Fixed: [The config false leaf shouldn't be configed in startup stage #189](https://github.com/clicon/clixon/issues/189)
This commit is contained in:
parent
f01efaf02a
commit
dea3962cc0
6 changed files with 38 additions and 6 deletions
19
CHANGELOG.md
19
CHANGELOG.md
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
* [5.1.0](#510) Expected: April
|
||||
* [5.0.0](#500) 27 February 2021
|
||||
* [5.0.1](#501) 10 March 2021
|
||||
* [4.9.0](#490) 18 December 2020
|
||||
* [4.8.0](#480) 18 October 2020
|
||||
* [4.7.0](#470) 14 September 2020
|
||||
|
|
@ -61,11 +62,25 @@ Developers may need to change their code
|
|||
|
||||
### Corrected Bugs
|
||||
|
||||
* Fixed: [The config false leaf shouldn't be configed in startup stage #189](https://github.com/clicon/clixon/issues/189)
|
||||
* Fixed: [CLIXON is not waiting for the hello message #184](https://github.com/clicon/clixon/issues/184)
|
||||
* See also API changes
|
||||
* Fixed: [comma in yang list name will lead to cli setting error #186](https://github.com/clicon/clixon/issues/186)
|
||||
* Reverted blocked signal behavior introduced in 5.0.
|
||||
|
||||
## 5.0.1
|
||||
|
||||
10 March 2021
|
||||
|
||||
### Minor features
|
||||
|
||||
* Introduced a delay before making process start/stop/restart processes for race conditions when configuring eg restconf
|
||||
* For restconf `CLICON_BACKEND_RESTCONF_PROCESS`, restart restconf if restconf is edited.
|
||||
|
||||
### Corrected Bugs
|
||||
|
||||
* Reverted blocked signal behavior introduced in 5.0.
|
||||
|
||||
## 5.0.0
|
||||
27 February 2021
|
||||
|
||||
|
|
@ -77,6 +92,10 @@ Other changes since 4.9 include NETCONF call home, a new client API, and a modif
|
|||
|
||||
Thanks Netgate and input from the Clixon community for making this possible!
|
||||
|
||||
### Known Issues
|
||||
|
||||
* Changed behavior in signal handlers and some race conditions, use 5.0.1 instead
|
||||
|
||||
### New features
|
||||
|
||||
* RESTCONF configuration is extended and changed for both fcgi and evhtp
|
||||
|
|
|
|||
|
|
@ -261,6 +261,14 @@ startup_common(clicon_handle h,
|
|||
goto done;
|
||||
goto fail;
|
||||
}
|
||||
/* After upgrade check no state data */
|
||||
if ((ret = xml_non_config_data(xt, &xret)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
if (clicon_xml2cbuf(cbret, xret, 0, 0, -1) < 0)
|
||||
goto done;
|
||||
goto fail;
|
||||
}
|
||||
/* Sort xml */
|
||||
if (xml_sort_recurse(xt) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -1478,9 +1478,8 @@ xml_non_config_data(cxobj *xt,
|
|||
clicon_err(OE_UNIX, errno, "cbuf_new");
|
||||
goto done;
|
||||
}
|
||||
cprintf(cb, "%s in module %s: state data node unexpected",
|
||||
yang_argument_get(y), yang_argument_get(ys_module(y)));
|
||||
if (netconf_invalid_value_xml(xerr, "application", cbuf_get(cb)) < 0)
|
||||
cprintf(cb, "module %s: state data node unexpected", yang_argument_get(ys_module(y)));
|
||||
if (netconf_bad_element_xml(xerr, "application", yang_argument_get(y), cbuf_get(cb)) < 0)
|
||||
goto done;
|
||||
retval = 0;
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ new "netconf discard-changes"
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "netconf edit state operation should fail"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><interfaces xmlns=\"urn:ietf:params:xml:ns:yang:ietf-interfaces\"><interface><name>e0</name><oper-status>up</oper-status></interface></interfaces></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><rpc-error><error-type>application</error-type><error-tag>invalid-value</error-tag><error-severity>error</error-severity><error-message>oper-status in module ietf-interfaces: state data node unexpected</error-message></rpc-error></rpc-reply>]]>]]>"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><interfaces xmlns=\"urn:ietf:params:xml:ns:yang:ietf-interfaces\"><interface><name>e0</name><oper-status>up</oper-status></interface></interfaces></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><rpc-error><error-type>application</error-type><error-tag>bad-element</error-tag><error-info><bad-element>oper-status</bad-element></error-info><error-severity>error</error-severity><error-message>module ietf-interfaces: state data node unexpected</error-message></rpc-error></rpc-reply>]]>]]>"
|
||||
|
||||
new "netconf get state operation"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><get><filter type=\"xpath\" select=\"/if:interfaces\" xmlns:if=\"urn:ietf:params:xml:ns:yang:ietf-interfaces\" /></get></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><data><interfaces xmlns=\"urn:ietf:params:xml:ns:yang:ietf-interfaces\"><interface><name>eth1</name><type>ex:eth</type><enabled>true</enabled><oper-status>up</oper-status><ex:my-status xmlns:ex=\"urn:example:clixon\"><ex:int>42</ex:int><ex:str>foo</ex:str></ex:my-status></interface></interfaces></data></rpc-reply>]]>]]>$"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
# - An extra xml configuration file starts with an "extra" interface
|
||||
# - running db starts with a "run" interface
|
||||
# - startup db starts with a "start" interface
|
||||
# There is also an "invalid" XML and a "broken" XML
|
||||
# There is also an "invalid" XML and a "broken" XML and a "state" XML
|
||||
# There are two steps, first run through everything OK
|
||||
# Then try with invalid and broken XML and ensure the backend quits and all is untouched
|
||||
|
||||
|
|
@ -57,6 +57,9 @@ invalidvar='<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><int
|
|||
# Broken XML (contains </nmae>)
|
||||
brokenvar='<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface><name>broken</nmae><type>ex:eth</type><enabled>true</enabled></interface></interfaces>'
|
||||
|
||||
# Startup XML with state
|
||||
statevar='<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface><name>startup</name><oper-status>up</oper-status><type>ex:eth</type><enabled>true</enabled></interface></interfaces>'
|
||||
|
||||
# Create a pre-set running, startup and (extra) config.
|
||||
# The configs are identified by an interface called run, startup, extra.
|
||||
# Depending on startup mode (init, none, running, or startup)
|
||||
|
|
@ -184,6 +187,9 @@ if [ $valgrindtest -ne 2 ]; then
|
|||
|
||||
new "Run broken startup in startup mode"
|
||||
testfail startup "$runvar" "$brokenvar" "$extravar"
|
||||
|
||||
new "Run broken startup with state data in startup mode"
|
||||
testfail startup "$runvar" "$statevar" "$extravar"
|
||||
fi
|
||||
|
||||
rm -rf $dir
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ new "cli show leaf-list"
|
|||
expectpart "$($clixon_cli -1f $cfg show xpath /x/f/e urn:example:clixon)" 0 "<e>foo</e>"
|
||||
|
||||
new "netconf set state data (not allowed)"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><state xmlns=\"urn:example:clixon\"><op>42</op></state></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><rpc-error><error-type>application</error-type><error-tag>invalid-value</error-tag><error-severity>error</error-severity><error-message>state in module example: state data node unexpected</error-message></rpc-error></rpc-reply>]]>]]>$"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><state xmlns=\"urn:example:clixon\"><op>42</op></state></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><rpc-error><error-type>application</error-type><error-tag>bad-element</error-tag><error-info><bad-element>state</bad-element></error-info><error-severity>error</error-severity><error-message>module example: state data node unexpected</error-message></rpc-error></rpc-reply>]]>]]>$"
|
||||
|
||||
new "netconf set presence and not present"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><x xmlns=\"urn:example:clixon\"><nopresence/><presence/></x></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue