Fixed: [locally scoped YANG typedef in grouping does not work #394](https://github.com/clicon/clixon/issues/394)
This commit is contained in:
parent
99c6f61637
commit
bcca87b1a0
3 changed files with 34 additions and 1 deletions
|
|
@ -83,6 +83,7 @@ Developers may need to change their code
|
||||||
|
|
||||||
### Corrected Bugs
|
### Corrected Bugs
|
||||||
|
|
||||||
|
* Fixed: [locally scoped YANG typedef in grouping does not work #394](https://github.com/clicon/clixon/issues/394)
|
||||||
* Fixed: [leafref in new type no work in union type](https://github.com/clicon/clixon/issues/388)
|
* Fixed: [leafref in new type no work in union type](https://github.com/clicon/clixon/issues/388)
|
||||||
* Fixed: [must statement check int value failed](https://github.com/clicon/clixon/issues/386)
|
* Fixed: [must statement check int value failed](https://github.com/clicon/clixon/issues/386)
|
||||||
* Fixed: [Defaults in choice does not work properly](https://github.com/clicon/clixon/issues/390)
|
* Fixed: [Defaults in choice does not work properly](https://github.com/clicon/clixon/issues/390)
|
||||||
|
|
|
||||||
|
|
@ -1105,7 +1105,9 @@ static inline int
|
||||||
ys_typedef(yang_stmt *ys)
|
ys_typedef(yang_stmt *ys)
|
||||||
{
|
{
|
||||||
return yang_keyword_get(ys) == Y_MODULE || yang_keyword_get(ys) == Y_SUBMODULE ||
|
return yang_keyword_get(ys) == Y_MODULE || yang_keyword_get(ys) == Y_SUBMODULE ||
|
||||||
yang_keyword_get(ys) == Y_CONTAINER || yang_keyword_get(ys) == Y_LIST;
|
yang_keyword_get(ys) == Y_CONTAINER || yang_keyword_get(ys) == Y_LIST ||
|
||||||
|
yang_keyword_get(ys) == Y_GROUPING
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find next ys up which can contain a typedef */
|
/* find next ys up which can contain a typedef */
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,19 @@ module example{
|
||||||
namespace "urn:example:clixon";
|
namespace "urn:example:clixon";
|
||||||
prefix ex;
|
prefix ex;
|
||||||
import example2 { prefix ex2; }
|
import example2 { prefix ex2; }
|
||||||
|
|
||||||
|
grouping gt{
|
||||||
|
description "test of local scoped type as defined in RFC7950 Section 5.5";
|
||||||
|
typedef ag {
|
||||||
|
type string {
|
||||||
|
pattern
|
||||||
|
'(([c-g])\.){3}[c-g]';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
leaf gr{
|
||||||
|
type ag;
|
||||||
|
}
|
||||||
|
}
|
||||||
typedef ab {
|
typedef ab {
|
||||||
type string {
|
type string {
|
||||||
pattern
|
pattern
|
||||||
|
|
@ -206,6 +219,7 @@ module example{
|
||||||
mandatory true;
|
mandatory true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
uses gt;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -624,6 +638,22 @@ EOF
|
||||||
new "netconf discard-changes"
|
new "netconf discard-changes"
|
||||||
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><discard-changes/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><discard-changes/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||||
|
|
||||||
|
#------ typedef scoped in grouping
|
||||||
|
new "type in grouping"
|
||||||
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><gr xmlns=\"urn:example:clixon\">c.d.e.f</gr></config></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||||
|
|
||||||
|
new "validate grouping ok"
|
||||||
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><validate><source><candidate/></source></validate></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||||
|
|
||||||
|
new "type in grouping negatoive"
|
||||||
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><gr xmlns=\"urn:example:clixon\">a.d.e.f</gr></config></edit-config></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||||
|
|
||||||
|
new "validate grouping expect fail"
|
||||||
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><validate><source><candidate/></source></validate></rpc>" "<rpc-reply $DEFAULTNS><rpc-error><error-type>application</error-type><error-tag>bad-element</error-tag>"
|
||||||
|
|
||||||
|
new "netconf discard-changes"
|
||||||
|
expecteof_netconf "$clixon_netconf -qf $cfg" 0 "$DEFAULTHELLO" "<rpc $DEFAULTNS><discard-changes/></rpc>" "" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>"
|
||||||
|
|
||||||
#------ minus
|
#------ minus
|
||||||
|
|
||||||
new "type with minus"
|
new "type with minus"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue