Modify tests so they all work with evhtp and backend config, eg that CLICON_RESTCONF_CONFIG is default true.

Note that some tests are forced to CLICON_RESTCONF_CONFIG is false due to test complexities.
This commit is contained in:
Olof hagsand 2020-11-18 13:51:15 +01:00
parent daaf3f17df
commit 9016dde319
41 changed files with 218 additions and 134 deletions

View file

@ -143,6 +143,12 @@ if [ $BE -ne 0 ]; then
start_backend -s init -f $cfg -- -s
fi
# Load restconf config for evhtp backend config
if [ "${WITH_RESTCONF}" = "evhtp" ]; then
. ./restconfig.sh
restconfigrun
fi
new "waiting"
wait_backend
@ -191,13 +197,13 @@ new "guest edit nacm"
expectpart "$(curl -u guest:bar $CURLOPTS -X PUT -H "Content-Type: application/yang-data+json" -d '{"nacm-example:x": 3}' $RCPROTO://localhost/restconf/data/nacm-example:x)" 0 "HTTP/1.1 403 Forbidden" '{"ietf-restconf:errors":{"error":{"error-type":"application","error-tag":"access-denied","error-severity":"error","error-message":"access denied"}}}'
new "cli show conf as admin"
expectfn "$clixon_cli -1 -U andy -l o -f $cfg show conf" 0 "^x 1;$"
expectpart "$($clixon_cli -1 -U andy -l o -f $cfg show conf)" 0 "x 1;"
new "cli show conf as limited"
expectfn "$clixon_cli -1 -U wilma -l o -f $cfg show conf" 0 "^x 1;$"
expectpart "$($clixon_cli -1 -U wilma -l o -f $cfg show conf)" 0 "x 1;"
new "cli show conf as guest"
expectfn "$clixon_cli -1 -U guest -l o -f $cfg show conf" 255 "application access-denied"
expectpart "$($clixon_cli -1 -U guest -l o -f $cfg show conf)" 255 "application access-denied"
new "cli rpc as admin"
expectfn "$clixon_cli -1 -U andy -l o -f $cfg rpc ipv4" 0 '<x xmlns="urn:example:clixon">ipv4</x><y xmlns="urn:example:clixon">42</y>'