unified curl test options

This commit is contained in:
Olof hagsand 2020-07-03 14:13:15 +02:00
parent 593ed2ef3b
commit 5dc2a6387d
34 changed files with 434 additions and 427 deletions

View file

@ -149,7 +149,7 @@ done | $clixon_netconf -qf $cfg > /dev/null; } 2>&1 | awk '/real/ {print $2}'
new "restconf get $perfreq small config 1 key index"
{ time -p for (( i=0; i<$perfreq; i++ )); do
rnd=$(( ( RANDOM % $perfnr ) ))
curl -sik -X GET $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd > /dev/null
curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd > /dev/null
done } 2>&1 | awk '/real/ {print $2}'
# RESTCONF put
@ -159,7 +159,7 @@ done } 2>&1 | awk '/real/ {print $2}'
new "restconf add $perfreq small config"
{ time -p for (( i=0; i<$perfreq; i++ )); do
rnd=$(( ( RANDOM % $perfnr ) ))
curl -sik -X PUT $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd -d '{"scaling:y":{"a":"'$rnd'","b":"'$rnd'"}}'
curl $CURLOPTS -X PUT $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd -d '{"scaling:y":{"a":"'$rnd'","b":"'$rnd'"}}'
done } 2>&1 | awk '/real/ {print $2}'
# CLI get (XXX why does this take so much time?)
@ -184,7 +184,7 @@ expecteof "time -p $clixon_netconf -qf $cfg" 0 "<rpc><get-config><source><candid
new "restconf get large config"
# XXX for some reason cannot expand $TIMEFN next two tests, need keep variable?
$TIMEFN curl -sik -X GET $RCPROTO://localhost/restconf/data 2>&1 > /dev/null | awk '/real/ {print $2}'
$TIMEFN curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data 2>&1 > /dev/null | awk '/real/ {print $2}'
new "cli get large config"
$TIMEFN $clixon_cli -1f $cfg show config xml 2>&1 > /dev/null | awk '/real/ {print $2}'
@ -215,7 +215,7 @@ expecteof "$clixon_netconf -qf $cfg" 0 "<rpc><discard-changes/></rpc>]]>]]>" "^<
new "restconf delete $perfreq small config"
{ time -p for (( i=0; i<$perfreq; i++ )); do
rnd=$(( ( RANDOM % $perfnr ) ))
curl -sik -X DELETE $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd
curl $CURLOPTS -X DELETE $RCPROTO://localhost/restconf/data/scaling:x/y=$rnd
done > /dev/null; } 2>&1 | awk '/real/ {print $2}'
# Now do leaf-lists istead of leafs