CLI multi-key bug for ordered-by user
This commit is contained in:
parent
df9e4734f9
commit
aa653d0831
2 changed files with 65 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
# CLI test for multi-key lists
|
||||
# Had bugs in duplicate detection
|
||||
|
||||
# Magic line must be first in script (see README.md)
|
||||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
|
@ -49,6 +50,20 @@ module $APPNAME{
|
|||
}
|
||||
}
|
||||
}
|
||||
list y{
|
||||
key "a b" ;
|
||||
ordered-by user;
|
||||
leaf a {
|
||||
type string;
|
||||
}
|
||||
leaf b {
|
||||
type enumeration{
|
||||
enum v1;
|
||||
enum v2;
|
||||
enum v3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
|
@ -91,6 +106,26 @@ expectfn "$clixon_cli -1 -f $cfg set ex x a 1 b v2" 0 ""
|
|||
new "show conf"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' '^<rpc-reply><data><ex xmlns="urn:example:clixon"><x><a>1</a><b>v1</b></x><x><a>1</a><b>v2</b></x><x><a>1</a><b>v3</b></x><x><a>2</a><b>v1</b></x><x><a>2</a><b>v2</b></x><x><a>2</a><b>v3</b></x></ex></data></rpc-reply>]]>]]>$'
|
||||
|
||||
|
||||
# ordered-by user
|
||||
new "set 1 v1"
|
||||
expectfn "$clixon_cli -1 -f $cfg set ex y a 1 b v1" 0 ""
|
||||
|
||||
new "set 2 v1"
|
||||
expectfn "$clixon_cli -1 -f $cfg set ex y a 2 b v1" 0 ""
|
||||
|
||||
new "set 1 v2"
|
||||
expectfn "$clixon_cli -1 -f $cfg set ex y a 1 b v2" 0 ""
|
||||
|
||||
new "set 1 v3"
|
||||
expectfn "$clixon_cli -1 -f $cfg set ex y a 1 b v3" 0 ""
|
||||
|
||||
new "set 2 v2"
|
||||
expectfn "$clixon_cli -1 -f $cfg set ex y a 2 b v2" 0 ""
|
||||
|
||||
new "show conf"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 '<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>' '^<rpc-reply><data><ex xmlns="urn:example:clixon"><x><a>1</a><b>v1</b></x><x><a>1</a><b>v2</b></x><x><a>1</a><b>v3</b></x><x><a>2</a><b>v1</b></x><x><a>2</a><b>v2</b></x><x><a>2</a><b>v3</b></x><y><a>1</a><b>v1</b></y><y><a>2</a><b>v1</b></y><y><a>1</a><b>v2</b></y><y><a>1</a><b>v3</b></y><y><a>2</a><b>v2</b></y></ex></data></rpc-reply>]]>]]>$'
|
||||
|
||||
if [ $BE -eq 0 ]; then
|
||||
exit # BE
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue