Fixed: [string length validation doesn't work for the entry "" in case it has default value specified](https://github.com/clicon/clixon/issues/563)
This commit is contained in:
parent
739d052383
commit
3188e3cc59
3 changed files with 22 additions and 4 deletions
|
|
@ -17,6 +17,7 @@ Expected: January 2025
|
||||||
|
|
||||||
### Corrected Bugs
|
### Corrected Bugs
|
||||||
|
|
||||||
|
* Fixed: [string length validation doesn't work for the entry "" in case it has default value specified](https://github.com/clicon/clixon/issues/563)
|
||||||
* Fixed: [SNMP: snmpwalk is slow and can timeout](https://github.com/clicon/clixon/issues/404)
|
* Fixed: [SNMP: snmpwalk is slow and can timeout](https://github.com/clicon/clixon/issues/404)
|
||||||
|
|
||||||
## 7.2.0
|
## 7.2.0
|
||||||
|
|
|
||||||
|
|
@ -1065,6 +1065,13 @@ xml_yang_validate_add(clixon_handle h,
|
||||||
goto done;
|
goto done;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if (cvtype != CGV_EMPTY && cvtype != CGV_VOID){
|
||||||
|
if (cv_parse1("", cv, &reason) != 1){
|
||||||
|
if (xret && netconf_bad_element_xml(xret, "application", yang_argument_get(yt), reason) < 0)
|
||||||
|
goto done;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (cv_parse1(body, cv, &reason) != 1){
|
if (cv_parse1(body, cv, &reason) != 1){
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ module example{
|
||||||
}
|
}
|
||||||
leaf lstring {
|
leaf lstring {
|
||||||
type tstring;
|
type tstring;
|
||||||
|
default "somestring";
|
||||||
}
|
}
|
||||||
/* here follows unlimited ints */
|
/* here follows unlimited ints */
|
||||||
leaf rint8 {
|
leaf rint8 {
|
||||||
|
|
@ -165,6 +166,7 @@ cat <<EOF > $dclispec/clispec.cli
|
||||||
merge @datamodel, cli_merge();
|
merge @datamodel, cli_merge();
|
||||||
create @datamodel, cli_create();
|
create @datamodel, cli_create();
|
||||||
show, cli_show_config("candidate", "text");
|
show, cli_show_config("candidate", "text");
|
||||||
|
validate("Validate changes"), cli_validate();
|
||||||
quit("Quit"), cli_quit();
|
quit("Quit"), cli_quit();
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -211,7 +213,8 @@ function testbuiltin(){
|
||||||
}
|
}
|
||||||
|
|
||||||
# Type explicit typed range tests.
|
# Type explicit typed range tests.
|
||||||
# Parameters: 1: type (eg uint8)
|
# Parameters:
|
||||||
|
# 1: type (eg uint8)
|
||||||
# 2: val OK
|
# 2: val OK
|
||||||
# 3: eval Invalid value
|
# 3: eval Invalid value
|
||||||
# 4: post (eg .000 - special for decimal64, others should have "")
|
# 4: post (eg .000 - special for decimal64, others should have "")
|
||||||
|
|
@ -317,6 +320,13 @@ testrange decimal64 1 0 ".000"
|
||||||
# test string with lengthlimit
|
# test string with lengthlimit
|
||||||
testrange string "012" "01234567890" ""
|
testrange string "012" "01234567890" ""
|
||||||
|
|
||||||
|
# see https://github.com/clicon/clixon/issues/563
|
||||||
|
new "Netconf set empty string with 1.. range"
|
||||||
|
expectpart "$($clixon_cli -1f $cfg -l o set lstring \"\")" 0 ""
|
||||||
|
|
||||||
|
new "Validate expect fail"
|
||||||
|
expectpart "$($clixon_cli -1f $cfg -l o validate)" 255 "String length 0 out of range: 1 - 10"
|
||||||
|
|
||||||
if [ $BE -ne 0 ]; then
|
if [ $BE -ne 0 ]; then
|
||||||
new "Kill backend"
|
new "Kill backend"
|
||||||
# Check if premature kill
|
# Check if premature kill
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue