Skip to content

Commit

Permalink
Implemented: [Simplifying error messages for regex validations. #174](#…
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Feb 16, 2021
1 parent dee4e87 commit e3aa174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Developers may need to change their code

### 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`
* Corrected client session handling to make internal IPC socket persistent
* Applies to cli/netconf/restconf/client-api code
Expand Down
6 changes: 3 additions & 3 deletions test/test_type.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ EOF
expectpart "$($clixon_cli -1f $cfg -l o set c talle x99)" 0 '^$'

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"
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
Expand Down Expand Up @@ -576,13 +576,13 @@ EOF
expectpart "$($clixon_cli -1f $cfg -l o set digit4 0123)" 0 '^$'

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"
expectpart "$($clixon_cli -1f $cfg -l o set word4 abc9)" 0 '^$'

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"
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>]]>]]>$"
Expand Down

0 comments on commit e3aa174

Please sign in to comment.