revise testing: change expectfn -> extectpart etc
This commit is contained in:
parent
96ab7292b9
commit
41e23865a1
23 changed files with 186 additions and 241 deletions
|
|
@ -246,10 +246,10 @@ EOF
|
|||
fi
|
||||
|
||||
new "cli set transitive string. type is alpha followed by number and is defined in three levels of modules"
|
||||
expectfn "$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"
|
||||
expectfn "$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": regexp match fail: 9xx does not match \[a-z\]\[0-9\]\*$'
|
||||
|
||||
new "netconf discard-changes"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -264,22 +264,22 @@ EOF
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "cli set transitive union int (ulle should accept 4.44|bounded|unbounded)"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set c ulle 33" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set c ulle 33)" 0 '^$'
|
||||
|
||||
new "cli validate"
|
||||
expectfn "$clixon_cli -1f $cfg -l o -l o validate" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o -l o validate)" 0 '^$'
|
||||
|
||||
new "cli set transitive union string (and space)"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set c ulle un\ bounded" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set c ulle "un\ bounded")" 0 '^$'
|
||||
|
||||
new "cli validate"
|
||||
expectfn "$clixon_cli -1f $cfg -l o -l o validate" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o -l o validate)" 0 '^$'
|
||||
|
||||
new "cli set transitive union error. should fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set c ulle kalle" 255 "^CLI syntax error: \"set c ulle kalle\": 'kalle' is not a number$"
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set c ulle kalle)" 255 "^CLI syntax error: \"set c ulle kalle\": 'kalle' is not a number$"
|
||||
|
||||
new "cli set transitive union error int"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set c ulle 55" 255 '^CLI syntax error: "set c ulle 55": Number 55 out of range: 4 - 44$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set c ulle 55)" 255 '^CLI syntax error: "set c ulle 55": Number 55 out of range: 4 - 44$'
|
||||
|
||||
new "netconf set transitive union error int"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><c xmlns=\"urn:example:clixon\"><ulle>55</ulle></c></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>"
|
||||
|
|
@ -293,25 +293,25 @@ EOF
|
|||
#-----------
|
||||
|
||||
new "cli set ab"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set list a.b.a.b" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set list a.b.a.b)" 0 '^$'
|
||||
|
||||
new "cli set cd"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set list c.d.c.d" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set list c.d.c.d)" 0 '^$'
|
||||
|
||||
new "cli set ef"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set list e.f.e.f" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set list e.f.e.f)" 0 '^$'
|
||||
|
||||
new "cli set ab fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set list a&b&a&b" 255 "^CLI syntax error"
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set list "a&b&a&b")" 255 "^CLI syntax error"
|
||||
|
||||
new "cli set ad fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set list a.b.c.d" 255 "^CLI syntax error"
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set list a.b.c.d)" 255 "^CLI syntax error"
|
||||
|
||||
new "cli validate"
|
||||
expectfn "$clixon_cli -1f $cfg -l o -l o validate" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o -l o validate)" 0 '^$'
|
||||
|
||||
new "cli commit"
|
||||
expectfn "$clixon_cli -1f $cfg -l o -l o commit" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o -l o commit)" 0 '^$'
|
||||
|
||||
new "netconf validate ok"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><validate><source><candidate/></source></validate></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -329,20 +329,20 @@ EOF
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><commit/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "cli enum value"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set status down" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set status down)" 0 '^$'
|
||||
|
||||
new "cli bits value"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set mbits create" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set mbits create)" 0 '^$'
|
||||
|
||||
#XXX No, cli cant assign two bit values
|
||||
#new "cli bits two values"
|
||||
#expectfn "$clixon_cli -1f $cfg -l o set mbits \"create read\"" 0 '^$'
|
||||
#expectpart "$($clixon_cli -1f $cfg -l o set mbits \)"create read\"" 0 '^$'
|
||||
|
||||
new "netconf bits two values"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><mbits xmlns=\"urn:example:clixon\">create read</mbits></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
new "cli bits validate"
|
||||
expectfn "$clixon_cli -1f $cfg -l o validate" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o validate)" 0 '^$'
|
||||
|
||||
#-------- num0 empty value
|
||||
|
||||
|
|
@ -358,13 +358,13 @@ EOF
|
|||
#-------- num1 single range (1)
|
||||
|
||||
new "cli range test num1 1 OK"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num1 1" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num1 1)" 0 '^$'
|
||||
|
||||
#new "cli range test num1 -100 ok" # XXX -/minus cant be given as argv
|
||||
#expectfn "$clixon_cli -1f $cfg -l o set num1 \-100" 0 '^$'
|
||||
#expectpart "$($clixon_cli -1f $cfg -l o set num1 \-100)" 0 '^$'
|
||||
|
||||
new "cli range test num1 2 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num1 2" 255 '^CLI syntax error: "set num1 2": Number 2 out of range: 1 - 1$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num1 2)" 255 '^CLI syntax error: "set num1 2": Number 2 out of range: 1 - 1$'
|
||||
|
||||
new "netconf range set num1 -1"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><num1 xmlns=\"urn:example:clixon\">-1</num1></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -378,13 +378,13 @@ EOF
|
|||
#-------- num2 range and blanks
|
||||
|
||||
new "cli range test num2 3 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num2 3" 255 '^CLI syntax error: "set num2 3": Number 3 out of range: 4 - 4000$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num2 3)" 255 '^CLI syntax error: "set num2 3": Number 3 out of range: 4 - 4000$'
|
||||
|
||||
new "cli range test num2 1000 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num2 1000" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num2 1000)" 0 '^$'
|
||||
|
||||
new "cli range test num2 5000 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num2 5000" 255 '^CLI syntax error: "set num2 5000": Number 5000 out of range: 4 - 4000$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num2 5000)" 255 '^CLI syntax error: "set num2 5000": Number 5000 out of range: 4 - 4000$'
|
||||
|
||||
new "netconf range set num2 3 fail"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><num2 xmlns=\"urn:example:clixon\">3</num2></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -410,13 +410,13 @@ EOF
|
|||
#-------- num3 min max range
|
||||
|
||||
new "cli range test num3 42 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num3 42" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num3 42)" 0 '^$'
|
||||
|
||||
new "cli range test num3 260 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num3 260" 255 '^CLI syntax error: "set num3 260": Number 260 out of range: 0 - 255$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num3 260)" 255 '^CLI syntax error: "set num3 260": Number 260 out of range: 0 - 255$'
|
||||
|
||||
new "cli range test num3 -1 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num3 -1" 255 "CLI syntax error:"
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num3 -1)" 255 "CLI syntax error:"
|
||||
|
||||
new "netconf range set num3 260 fail"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><num3 xmlns=\"urn:example:clixon\">260</num3></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -430,19 +430,19 @@ EOF
|
|||
#-------- num4 multiple ranges 1..2 | 42..50
|
||||
|
||||
new "cli range test num4 multiple 0 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num4 0" 255 '^CLI syntax error: "set num4 0": Number 0 out of range: 1 - 2, 42 - 50$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num4 0)" 255 '^CLI syntax error: "set num4 0": Number 0 out of range: 1 - 2, 42 - 50$'
|
||||
|
||||
new "cli range test num4 multiple 2 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l e set num4 2" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l e set num4 2)" 0 '^$'
|
||||
|
||||
new "cli range test num4 multiple 20 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num4 20" 255 '^CLI syntax error: "set num4 20": Number 20 out of range: 1 - 2, 42 - 50$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num4 20)" 255 '^CLI syntax error: "set num4 20": Number 20 out of range: 1 - 2, 42 - 50$'
|
||||
|
||||
new "cli range test num4 multiple 42 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num4 42" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num4 42)" 0 '^$'
|
||||
|
||||
new "cli range test num4 multiple 99 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num4 99" 255 '^CLI syntax error: "set num4 99": Number 99 out of range: 1 - 2, 42 - 50$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num4 99)" 255 '^CLI syntax error: "set num4 99": Number 99 out of range: 1 - 2, 42 - 50$'
|
||||
|
||||
new "netconf range set num4 multiple 2"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><num4 xmlns=\"urn:example:clixon\">42</num4></config></edit-config></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -468,16 +468,16 @@ EOF
|
|||
#-------- dec64 multiple ranges -3.5..-2.5 | 0.0 | 10.0..20.0
|
||||
# XXX how to enter negative numbers in bash string and cli -1?
|
||||
new "cli range dec64 multiple 0 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set dec 0" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set dec 0)" 0 '^$'
|
||||
|
||||
new "cli range dec64 multiple 0.1 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set num4 0.1" 255 '^CLI syntax error: "set num4 0.1": '"'"'0.1'"'"' is not a number$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set num4 0.1)" 255 '^CLI syntax error: "set num4 0.1": '"'"'0.1'"'"' is not a number$'
|
||||
|
||||
new "cli range dec64 multiple 15.0 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set dec 15.0" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set dec 15.0)" 0 '^$'
|
||||
|
||||
new "cli range dec64 multiple 30.0 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set dec 30.0" 255 '^CLI syntax error: "set dec 30.0": Number 30.000 out of range: -3.500 - -2.500, 0.000 - 0.000, 10.000 - 20.000$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set dec 30.0)" 255 '^CLI syntax error: "set dec 30.0": Number 30.000 out of range: -3.500 - -2.500, 0.000 - 0.000, 10.000 - 20.000$'
|
||||
|
||||
new "dec64 discard-changes"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -522,13 +522,13 @@ EOF
|
|||
#----------------string ranges---------------------
|
||||
#-------- len1 single range (2)
|
||||
new "cli length test len1 1 fail"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len1 x" 255 '^CLI syntax error: "set len1 x": String length 1 out of range: 2 - 2$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len1 x)" 255 '^CLI syntax error: "set len1 x": String length 1 out of range: 2 - 2$'
|
||||
|
||||
new "cli length test len1 2 OK"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len1 xy" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len1 xy)" 0 '^$'
|
||||
|
||||
new "cli length test len1 3 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len1 hej" 255 '^CLI syntax error: "set len1 hej": String length 3 out of range: 2 - 2$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len1 hej)" 255 '^CLI syntax error: "set len1 hej": String length 3 out of range: 2 - 2$'
|
||||
|
||||
new "netconf discard-changes"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -542,10 +542,10 @@ EOF
|
|||
#-------- len2 range and blanks
|
||||
|
||||
new "cli length test len2 3 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len2 ab" 255 '^CLI syntax error: "set len2 ab": String length 2 out of range: 4 - 4000$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len2 ab)" 255 '^CLI syntax error: "set len2 ab": String length 2 out of range: 4 - 4000$'
|
||||
|
||||
new "cli length test len2 42 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len2 hejhophdsakjhkjsadhkjsahdkjsad" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len2 hejhophdsakjhkjsadhkjsahdkjsad)" 0 '^$'
|
||||
|
||||
new "netconf discard-changes"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><discard-changes/></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
|
@ -553,36 +553,36 @@ EOF
|
|||
#-------- len3 min max range
|
||||
|
||||
new "cli range ptest len3 42 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len3 hsakjdhkjsahdkjsahdksahdksajdhsakjhd" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len3 hsakjdhkjsahdkjsahdksahdksajdhsakjhd)" 0 '^$'
|
||||
|
||||
#-------- len4 multiple ranges 2..3 | 20-29
|
||||
new "cli length test len4 1 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len4 a" 255 '^CLI syntax error: "set len4 a": String length 1 out of range: 2 - 3, 20 - 29$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len4 a)" 255 '^CLI syntax error: "set len4 a": String length 1 out of range: 2 - 3, 20 - 29$'
|
||||
|
||||
new "cli length test len4 2 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len4 ab" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len4 ab)" 0 '^$'
|
||||
|
||||
new "cli length test len4 10 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len4 abcdefghij" 255 '^CLI syntax error: "set len4 abcdefghij": String length 10 out of range: 2 - 3, 20 - 29$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len4 abcdefghij)" 255 '^CLI syntax error: "set len4 abcdefghij": String length 10 out of range: 2 - 3, 20 - 29$'
|
||||
|
||||
new "cli length test len4 20 ok"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len4 abcdefghijabcdefghija" 0 '^$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len4 abcdefghijabcdefghija)" 0 '^$'
|
||||
|
||||
new "cli length test len4 30 error"
|
||||
expectfn "$clixon_cli -1f $cfg -l o set len4 abcdefghijabcdefghijabcdefghij" 255 '^CLI syntax error: "set len4 abcdefghijabcdefghijabcdefghij": String length 30 out of range: 2 - 3, 20 - 29$'
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set len4 abcdefghijabcdefghijabcdefghij)" 255 '^CLI syntax error: "set len4 abcdefghijabcdefghijabcdefghij": String length 30 out of range: 2 - 3, 20 - 29$'
|
||||
|
||||
# XSD schema -> POSIX ECE translation
|
||||
new "cli yang pattern \d ok"
|
||||
expectfn "$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"
|
||||
expectfn "$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": regexp match fail: 01b2 does not match'
|
||||
|
||||
new "cli yang pattern \w ok"
|
||||
expectfn "$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"
|
||||
expectfn "$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": regexp match fail: ab%3 does not match'
|
||||
|
||||
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>]]>]]>$"
|
||||
|
|
@ -634,28 +634,28 @@ EOF
|
|||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><validate><source><candidate/></source></validate></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
#new "cli type with minus"
|
||||
#expectfn "$clixon_cli -1f $cfg -l o set name my-name" 0 "^$"
|
||||
#expectpart "$($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 "^$"
|
||||
expectpart "$($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 "^$"
|
||||
expectpart "$($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 "^$"
|
||||
expectpart "$($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;"
|
||||
expectpart "$($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 "^$"
|
||||
expectpart "$($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;"
|
||||
expectpart "$($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 "^$"
|
||||
expectpart "$($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 "^$"
|
||||
expectpart "$($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"
|
||||
expectpart "$($clixon_cli -1f $cfg -l o set bool wrong)" 255 "'wrong' is not a boolean value"
|
||||
|
||||
if [ $BE -ne 0 ]; then
|
||||
new "Kill backend"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue