* Add multiple yang support also for obsolete versions

* This means that files and datastores supporting modstate also looks for deleted or updated yang modules.
  * A stricter binding which gives error if loading outdated YANG file does not exist.
* Stricter yang checks: you cannot do get-config on datastores that have obsolete YANG
* Added xerr output parameter to `xmldb_get0()`
This commit is contained in:
Olof hagsand 2021-03-16 15:25:34 +01:00
parent d542cd5530
commit 8469a0962e
20 changed files with 328 additions and 118 deletions

View file

@ -116,12 +116,11 @@ function testrun()
XML="$XMLA$XMLU"
else
XML="$XMLA"
unknownreply="<rpc-error><error-type>application</error-type><error-tag>unknown-element</error-tag><error-info><bad-element>u1</bad-element></error-info><error-severity>error</error-severity><error-message>Failed to find YANG spec of XML node: u1 with parent: config in namespace: urn:example:unknown</error-message></rpc-error>"
unknownreply="<rpc-error><error-type>application</error-type><error-tag>unknown-element</error-tag><error-info><bad-element>u3</bad-element></error-info><error-severity>error</error-severity><error-message>Failed to find YANG spec of XML node: u3 with parent: b in namespace: urn:example:unknown</error-message></rpc-error>"
fi
else
XML="$XMLA"
unknownreply="<rpc-error><error-type>application</error-type><error-tag>unknown
-element</error-tag><error-info><bad-element>u1</bad-element></error-info><error-severity>error</error-severity><error-message>Failed to find YANG spec of XML node: u1 with parent: config in namespace: urn:example:unknown</error-message></rpc-error>"
unknownreply="<rpc-error><error-type>application</error-type><error-tag>unknown-element</error-tag><error-info><bad-element>u3</bad-element></error-info><error-severity>error</error-severity><error-message>Failed to find YANG spec of XML node: u3 with parent: b in namespace: urn:example:unknown</error-message></rpc-error>"
fi
if $startup; then # get config from startup
@ -268,16 +267,16 @@ EOF
new "test params: -f $cfg"
new "no startup, dont treat unknown as anydata----"
new "1. no startup, dont treat unknown as anydata----"
testrun false false
new "startup, dont treat unknown as anydata----"
new "2. startup, dont treat unknown as anydata----"
testrun true false
new "no startup, treat unknown as anydata----"
new "3. no startup, treat unknown as anydata----"
testrun false true
new "startup, treat unknown as anydata----"
new "4. startup, treat unknown as anydata----"
testrun true true
# Set by restconf_config