Implemented: [Simplifying error messages for regex validations. #174](https://github.com/clicon/clixon/issues/174)

This commit is contained in:
Olof hagsand 2021-02-16 20:58:43 +01:00
parent dee4e87edf
commit e3aa17458c
2 changed files with 4 additions and 3 deletions

View file

@ -86,6 +86,7 @@ Developers may need to change their code
### Minor changes ### Minor changes
* Implemented: [Simplifying error messages for regex validations. #174](https://github.com/clicon/clixon/issues/174)
* Add ca_reset plugin also when backend starts as `-s none` * Add ca_reset plugin also when backend starts as `-s none`
* Corrected client session handling to make internal IPC socket persistent * Corrected client session handling to make internal IPC socket persistent
* Applies to cli/netconf/restconf/client-api code * Applies to cli/netconf/restconf/client-api code

View file

@ -249,7 +249,7 @@ EOF
expectpart "$($clixon_cli -1f $cfg -l o set c talle x99)" 0 '^$' expectpart "$($clixon_cli -1f $cfg -l o set c talle x99)" 0 '^$'
new "cli set transitive string error. Wrong type" new "cli set transitive string error. Wrong type"
expectpart "$($clixon_cli -1f $cfg -l o set c talle 9xx)" 255 '^CLI syntax error: "set c talle 9xx": regexp match fail: 9xx does not match \[a-z\]\[0-9\]\*$' expectpart "$($clixon_cli -1f $cfg -l o set c talle 9xx)" 255 '^CLI syntax error: "set c talle 9xx": "9xx" is invalid input for cli command: talle$'
new "netconf discard-changes" new "netconf discard-changes"
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$" expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
@ -576,13 +576,13 @@ EOF
expectpart "$($clixon_cli -1f $cfg -l o set digit4 0123)" 0 '^$' expectpart "$($clixon_cli -1f $cfg -l o set digit4 0123)" 0 '^$'
new "cli yang pattern \d error" new "cli yang pattern \d error"
expectpart "$($clixon_cli -1f $cfg -l o set digit4 01b2)" 255 '^CLI syntax error: "set digit4 01b2": regexp match fail: 01b2 does not match' expectpart "$($clixon_cli -1f $cfg -l o set digit4 01b2)" 255 '^CLI syntax error: "set digit4 01b2": "01b2" is invalid input for cli command: digit4$'
new "cli yang pattern \w ok" new "cli yang pattern \w ok"
expectpart "$($clixon_cli -1f $cfg -l o set word4 abc9)" 0 '^$' expectpart "$($clixon_cli -1f $cfg -l o set word4 abc9)" 0 '^$'
new "cli yang pattern \w error" new "cli yang pattern \w error"
expectpart "$($clixon_cli -1f $cfg -l o set word4 ab%3)" 255 '^CLI syntax error: "set word4 ab%3": regexp match fail: ab%3 does not match' expectpart "$($clixon_cli -1f $cfg -l o set word4 ab%3)" 255 '^CLI syntax error: "set word4 ab%3": "ab%3" is invalid input for cli command: word4$'
new "netconf pattern \w" new "netconf pattern \w"
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><word4 xmlns=\"urn:example:clixon\">aXG9</word4></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$" expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><word4 xmlns=\"urn:example:clixon\">aXG9</word4></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"