From 8f9aa9bc804d039c7f953e3cec3ae7fff9d33be4 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 11 Aug 2020 15:48:25 +0200 Subject: [PATCH] tests for changed return values -> Created --- test/test_nacm.sh | 2 +- test/test_nacm_default.sh | 2 +- test/test_restconf_patch.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_nacm.sh b/test/test_nacm.sh index 540f2e49..fe72d5ba 100755 --- a/test/test_nacm.sh +++ b/test/test_nacm.sh @@ -143,7 +143,7 @@ expectpart "$(curl -u andy:bar $CURLOPTS -X GET $RCPROTO://localhost/restconf/da # explicitly disable nacm (regression on netgate bug) new "disable nacm" -expectpart "$(curl -u andy:bar $CURLOPTS -X PUT -H "Content-Type: application/yang-data+json" -d '{"ietf-netconf-acm:enable-nacm": false}' $RCPROTO://localhost/restconf/data/ietf-netconf-acm:nacm/enable-nacm)" 0 "HTTP/1.1 204 No Content" +expectpart "$(curl -u andy:bar $CURLOPTS -X PUT -H "Content-Type: application/yang-data+json" -d '{"ietf-netconf-acm:enable-nacm": false}' $RCPROTO://localhost/restconf/data/ietf-netconf-acm:nacm/enable-nacm)" 0 "HTTP/1.1 201 Created" new "auth set authentication config" expecteof "$clixon_netconf -qf $cfg" 0 "$RULES]]>]]>" "^]]>]]>$" diff --git a/test/test_nacm_default.sh b/test/test_nacm_default.sh index 88b485c4..5c990b64 100755 --- a/test/test_nacm_default.sh +++ b/test/test_nacm_default.sh @@ -121,7 +121,7 @@ EOF if [ $db = init ]; then # Must set NACM first new "Set NACM using PATCH" - expectpart "$(curl -u guest:bar $CURLOPTS -X PUT -H "Content-Type: application/yang-data+xml" -d "$NACM$XML" $RCPROTO://localhost/restconf/data)" 0 "HTTP/1.1 204 No Content" + expectpart "$(curl -u guest:bar $CURLOPTS -X PUT -H "Content-Type: application/yang-data+xml" -d "$NACM$XML" $RCPROTO://localhost/restconf/data)" 0 "HTTP/1.1 201 Created" # new "Set Initial data using POST" # expectpart "$(curl -u guest:bar $CURLOPTS -X POST -H "Content-Type: application/yang-data+xml" -d "$XML" $RCPROTO://localhost/restconf/data)" 0 "HTTP/1.1 201 Created" diff --git a/test/test_restconf_patch.sh b/test/test_restconf_patch.sh index d4181b36..0c31fe14 100755 --- a/test/test_restconf_patch.sh +++ b/test/test_restconf_patch.sh @@ -126,7 +126,7 @@ new "MUST support the PATCH method for a plain patch" expectpart "$(curl -u andy:bar $CURLOPTS -X OPTIONS $RCPROTO://localhost/restconf/data)" 0 "HTTP/1.1 200 OK" "Allow: OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE" "Accept-Patch: application/yang-data+xml,application/yang-data+json" new "If the target resource instance does not exist, the server MUST NOT create it." -expectpart "$(curl -u andy:bar $CURLOPTS -X PATCH -H 'Content-Type: application/yang-data+json' $RCPROTO://localhost/restconf/data/example-jukebox:jukebox -d '{"example-jukebox:jukebox":null}')" 0 "HTTP/1.1 400 Bad Request" +expectpart "$(curl -u andy:bar $CURLOPTS -X PATCH -H 'Content-Type: application/yang-data+json' $RCPROTO://localhost/restconf/data/example-jukebox:jukebox -d '{"example-jukebox:jukebox":null}')" 0 "HTTP/1.1 409 Conflict" "If the target resource instance does not exist, the server MUST NOT create it" new "Create it with PUT instead" expectpart "$(curl -u andy:bar $CURLOPTS -X PUT -H 'Content-Type: application/yang-data+json' $RCPROTO://localhost/restconf/data/example-jukebox:jukebox -d '{"example-jukebox:jukebox":null}')" 0 "HTTP/1.1 201 Created"