* Augment target node check strict, instead of printing a warning, it will terminate with error.

* Fixed: [Augment that reference a submodule as target node fails #178](https://github.com/clicon/clixon/issues/178)
* Fixed a memory error that was reported in slack by Pawel Maslanka
  * The crash printout was: `realloc(): invalid next size Aborted`
This commit is contained in:
Olof hagsand 2021-02-19 15:46:55 +01:00
parent 108f94cfad
commit 9840e248c6
12 changed files with 227 additions and 130 deletions

View file

@ -66,6 +66,12 @@ module main{
type string;
}
}
/* Augment something in sub module */
augment /ex:sub2 {
leaf aug0{
type string;
}
}
}
EOF
@ -87,6 +93,18 @@ submodule sub1 {
type string;
}
}
/* Augment something in module */
augment /ex:main {
leaf aug1{
type string;
}
}
/* Augment something in another submodule */
augment /ex:sub2 {
leaf aug2{
type string;
}
}
}
EOF
@ -221,6 +239,15 @@ expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+jso
new "restconf check main/sub1/sub2 contents"
expectpart "$(curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data?content=config)" 0 'HTTP/1.1 200 OK' '{"data":{"main:main":{"ext":"foo","x":"foo"},"main:sub1":{"ext1":"foo","x":"foo"},"main:sub2":{"ext2":"foo","x":"foo"}'
new "restconf edit augment 0"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug0":"foo"}')" 0 'HTTP/1.1 201 Created'
new "restconf edit augment 1"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:main -d '{"main:aug1":"foo"}')" 0 'HTTP/1.1 201 Created'
new "restconf edit augment 2"
expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+json" $RCPROTO://localhost/restconf/data/main:sub2 -d '{"main:aug2":"foo"}')" 0 'HTTP/1.1 201 Created'
if [ $RC -ne 0 ]; then
new "Kill restconf daemon"
stop_restconf