testcase for patch empty field
This commit is contained in:
parent
54357a2a78
commit
96c9296056
2 changed files with 15 additions and 4 deletions
|
|
@ -167,7 +167,6 @@ cat<<EOF > $startupdb
|
|||
EOF
|
||||
|
||||
new "kill old restconf"
|
||||
sleep $DEMSLEEP
|
||||
stop_restconf_pre
|
||||
|
||||
new "test params: -f $cfg"
|
||||
|
|
@ -276,9 +275,8 @@ if [ $pid0 -eq $pid3 ]; then
|
|||
err1 "A different pid" "same pid: $pid3"
|
||||
fi
|
||||
|
||||
new "kill restconf using kill"
|
||||
sleep $DEMSLEEP
|
||||
stop_restconf_pre
|
||||
new "kill restconf"
|
||||
sudo kill $pid3
|
||||
|
||||
new "Wait for restconf to stop"
|
||||
wait_restconf_stopped
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ cat <<EOF > $dir/example-system.yang
|
|||
leaf enable-jukebox-streaming {
|
||||
type boolean;
|
||||
}
|
||||
leaf extraleaf {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
|
@ -250,6 +253,16 @@ expectpart "$(curl -u andy:bar $CURLOPTS -X PATCH -H "Content-Type: application
|
|||
new "GET check" # XXX: "data" should probably be namespaced?
|
||||
expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/data?content=config -H 'Accept: application/yang-data+xml')" 0 "HTTP/$HVER 200" '<extra xmlns="http://example.com/ns/example-jukebox">c</extra>' '<data>'
|
||||
|
||||
new "Add empty leaf"
|
||||
expectpart "$(curl -u andy:bar $CURLOPTS -X POST $RCPROTO://localhost/restconf/data -H 'Content-Type: application/yang-data+json' -d '{"example-system:system":{"extraleaf":""}}')" 0 "HTTP/$HVER 201"
|
||||
|
||||
new "Add entry with PATCH"
|
||||
expectpart "$(curl -u andy:bar $CURLOPTS -X PATCH $RCPROTO://localhost/restconf/data/example-system:system -H 'Content-Type: application/yang-data+json' -d '{"example-system:system":{"extraleaf":"something"}}')" 0 "HTTP/$HVER 204"
|
||||
|
||||
new "GET check"
|
||||
expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example-system:system -H 'Accept: application/yang-data+xml')" 0 "HTTP/$HVER 200" '<system xmlns="http://example.com/ns/example-system"><extraleaf>something</extraleaf></system>'
|
||||
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
new "Kill restconf daemon"
|
||||
stop_restconf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue