test rpc keyless wrong order

This commit is contained in:
Olof hagsand 2020-12-02 09:53:33 +01:00
parent 4d5c428b79
commit 2b9f19a19f
3 changed files with 5 additions and 2 deletions

View file

@ -280,7 +280,7 @@ ctx2number(xp_ctx *xc,
{
int retval = -1;
char *str = NULL;
double n;
double n = NAN;
switch (xc->xc_type){
case XT_NODESET:

View file

@ -112,6 +112,8 @@ expectfn "$clixon_cli -1 -f $cfg err x" 255 "Config error: api-path syntax error
new "err x a"
expectfn "$clixon_cli -1 -f $cfg err x a 99" 255 "Config error: api-path syntax error \"/example:x/m1=%s\": rpc malformed-message List key m1 length mismatch : Invalid argument"
endtest
new "Kill backend"
# Check if premature kill
pid=$(pgrep -u root -f clixon_backend)

View file

@ -165,8 +165,9 @@ expectpart "$(curl $CURLOPTS -X POST -H "Content-Type: application/yang-data+jso
# test rpc lists with / without keys
LIST='<u0 xmlns="urn:example:clixon"><uk>foo</uk></u0><u0 xmlns="urn:example:clixon"><uk>bar</uk></u0><u0 xmlns="urn:example:clixon"><uk>bar</uk></u0>'
# On docker /fcgi the return is bar,foo,bar
new "netconf example rpc input list without key with non-unique entries"
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><example xmlns=\"urn:example:clixon\"><x>mandatory</x>$LIST</example></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><x xmlns=\"urn:example:clixon\">mandatory</x><y xmlns=\"urn:example:clixon\">42</y>$LIST</rpc-reply>]]>]]>$"
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc $DEFAULTNS><example xmlns=\"urn:example:clixon\"><x>mandatory</x>$LIST</example></rpc>]]>]]>" "^<rpc-reply $DEFAULTNS><x xmlns=\"urn:example:clixon\">mandatory</x><y xmlns=\"urn:example:clixon\">42</y>" '<u0 xmlns="urn:example:clixon">' '<uk>foo</uk></u0><u0 xmlns="urn:example:clixon"><uk>bar</uk></u0>' "</rpc-reply>]]>]]>$"
LIST='<u1 xmlns="urn:example:clixon"><uk>bar</uk><val>1</val></u1><u1 xmlns="urn:example:clixon"><uk>foo</uk><val>2</val></u1>'
new "netconf example rpc input list with key"