Improved testcases for RESTCONF
This commit is contained in:
parent
c8f98f7c3c
commit
175ed5a193
1 changed files with 18 additions and 4 deletions
|
|
@ -381,18 +381,32 @@ expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPR
|
|||
'<interface xmlns="http://example.com/ns/interfaces"><name>eth1</name><status>ok</status></interface>'
|
||||
|
||||
new "rfc8040 B.3.9. RESTONF with-defaults parameter = trim"
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+json' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth1?with-defaults=trim)" \
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+json' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth3?with-defaults=trim)" \
|
||||
0 \
|
||||
"HTTP/$HVER 200" \
|
||||
"Content-Type: application/yang-data+json" \
|
||||
"Cache-Control: no-cache" \
|
||||
'{"example:interface":\[{"name":"eth1"}\]}'
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth1?with-defaults=trim)" \
|
||||
'{"example:interface":\[{"name":"eth3","status":"waking up"}\]}'
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth3?with-defaults=trim)" \
|
||||
0 \
|
||||
"HTTP/$HVER 200" \
|
||||
"Content-Type: application/yang-data+xml" \
|
||||
"Cache-Control: no-cache" \
|
||||
'<interface xmlns="http://example.com/ns/interfaces"><name>eth1</name></interface>'
|
||||
'<interface xmlns="http://example.com/ns/interfaces"><name>eth3</name><status>waking up</status></interface>'
|
||||
|
||||
new "rfc8040 B.3.9. RESTCONF with-defaults parameter = report-all-tagged"
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+json' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth1?with-defaults=report-all-tagged)" \
|
||||
0 \
|
||||
"HTTP/$HVER 200" \
|
||||
"Content-Type: application/yang-data+json" \
|
||||
"Cache-Control: no-cache" \
|
||||
'{"example:interface":\[{"name":"eth1","mtu":1500,"status":"ok"}\]}'
|
||||
expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPROTO://localhost/restconf/data/example:interfaces/interface=eth1?with-defaults=report-all-tagged)" \
|
||||
0 \
|
||||
"HTTP/$HVER 200" \
|
||||
"Content-Type: application/yang-data+xml" \
|
||||
"Cache-Control: no-cache" \
|
||||
'<interface xmlns="http://example.com/ns/interfaces"><name>eth1</name><mtu wd:default="true">1500</mtu><status wd:default="true">ok</status></interface>'
|
||||
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue