dded enable/disable as alternative boolean truth values on input (in CLIgen)
This commit is contained in:
parent
b64dd678dc
commit
4cd63f6b55
1 changed files with 25 additions and 1 deletions
|
|
@ -192,6 +192,10 @@ module example{
|
||||||
pattern '[a-zA-Z_][a-zA-Z0-9_\-.]*';
|
pattern '[a-zA-Z_][a-zA-Z0-9_\-.]*';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
leaf bool {
|
||||||
|
description "For testing different truth values in CLI";
|
||||||
|
type boolean;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -589,7 +593,6 @@ EOF
|
||||||
new "netconf discard-changes"
|
new "netconf discard-changes"
|
||||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc><discard-changes/></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc><discard-changes/></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||||
|
|
||||||
|
|
||||||
#------ minus
|
#------ minus
|
||||||
|
|
||||||
new "type with minus"
|
new "type with minus"
|
||||||
|
|
@ -601,6 +604,27 @@ EOF
|
||||||
#new "cli type with minus"
|
#new "cli type with minus"
|
||||||
#expectfn "$clixon_cli -1f $cfg -l o set name my-name" 0 '^$'
|
#expectfn "$clixon_cli -1f $cfg -l o set name my-name" 0 '^$'
|
||||||
|
|
||||||
|
#------ cli truth-values: true/on/enable false/off/disable
|
||||||
|
|
||||||
|
new "cli truth: true"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool true" 0 '^$'
|
||||||
|
new "cli truth: false"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool false" 0 '^$'
|
||||||
|
new "cli truth: on"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool on" 0 '^$'
|
||||||
|
new "cli verify on translates to true"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o show conf" 0 'bool true;'
|
||||||
|
new "cli truth: off"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool off" 0 '^$'
|
||||||
|
new "cli verify off translates to false"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o show conf" 0 'bool false;'
|
||||||
|
new "cli truth: enable"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool enable" 0 '^$'
|
||||||
|
new "cli truth: disable"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool disable" 0 '^$'
|
||||||
|
new "cli truth: wrong"
|
||||||
|
expectfn "$clixon_cli -1f $cfg -l o set bool wrong" 255 "'wrong' is not a boolean value"
|
||||||
|
|
||||||
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