Commit 80a1efa7 authored by Hammad Zafar's avatar Hammad Zafar Committed by Giacomo Bernini
Browse files

update for '412 Precondition Failed test' cases

parent 171daa33
......@@ -101,17 +101,16 @@ PATCH Individual VNF Performance Job
PATCH Individual VNF Performance Job - Precondition failed
[Documentation] Test ID: 6.3.3.2.8
... Test title: PATCH Individual VNF Performance Job - Precondition failed
... Test objective: The objective is to attempt to Modify an individual alarm resource, where the precondition was not met
... Test objective: The objective is to attempt to Modify an individual PM Job resource, where the precondition given in an HTTP request header is not fulfilled due to an ETag mismatch.
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
... Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: The VNF Performance Job is not modified by the operation
Send Patch request for individual VNF Performance Job
Send Patch request for individual VNF Performance Job - ETag Mismatch
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Performance Job is Unmodified (Implicit)
PATCH Individual VNF Performance Job - UNPROCESSIBLE ENTITY
[Documentation] Test ID: 6.3.3.2.9
......@@ -183,11 +182,23 @@ Send Patch request for individual VNF Performance Job
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/PMJobModification.json
${body}= Format String ${template} callback_uri=${callback_uri}
${body}= Format String ${template} callback_uri=${new_callback_uri}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Send Patch request for individual VNF Performance Job - ETag Mismatch
log Trying to perform a PATCH to modify individual PmJob using an invalid ETag
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${invalid_etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/PMJobModification.json
${body}= Format String ${template} callback_uri=${new_callback_uri}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId} ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Send Patch request for individual VNF Performance Job with Unreachable Callback URI
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
......
......@@ -4,6 +4,7 @@ Resource environment/variables.txt # Generic Parameters
Library JSONLibrary
Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false
Library OperatingSystem
Library String
*** Test Cases ***
GET Individual Threshold
......@@ -99,13 +100,13 @@ PATCH Individual Threshold
PATCH Individual Threshold - Precondition failed
[Documentation] Test ID: 6.3.3.5.8
... Test title: PATCH Individual Threshold - Precondition failed
... Test objective: The objective is to attempt to modify an individual threshold resource, where the precondition was not met.
... Test objective: The objective is to attempt to modify an individual threshold resource, where the precondition given in an HTTP request header is not fulfilled due to an ETag mismatch.
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNFM.
... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VNFM
... Applicability: none
... Post-Conditions: The VNF Performance Job is not modified by the operation
Send Patch request for individual VNF Performance Threshold
Send Patch request for individual VNF Performance Threshold - ETag Mismatch
Check HTTP Response Status Code Is 412
Check HTTP Response Body Json Schema Is ProblemDetails
Check Postcondition VNF Performance Threshold is Unmodified (Implicit)
......@@ -113,7 +114,7 @@ PATCH Individual Threshold - Precondition failed
PATCH Individual Threshold - Unprocessible Entity
[Documentation] Test ID: 6.3.3.5.9
... Test title: PATCH Individual Threshold - Unprocessible Entity
... Test objective: The objective is to test that PATCH method cannot modify an exsisting individual PM job resource when the callback URI provided in the Request body is unreachable by the VNFM.
... Test objective: The objective is to test that PATCH method cannot modify an exsisting individual Threshold resource when the callback URI provided in the Request body is unreachable by the VNFM.
... Pre-conditions: A VNF instance is instantiated. One or more VNF performance thresholds are set in the VNFM.
... Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v2.8.1
... Config ID: Config_prod_VNFM
......@@ -175,7 +176,7 @@ Send Put request for individual VNF Performance Threshold
Send Patch request for individual VNF Performance Threshold
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
${origOutput}= Output response
......@@ -186,6 +187,18 @@ Send Patch request for individual VNF Performance Threshold
${output}= Output response
Set Suite Variable ${response} ${output}
Send Patch request for individual VNF Performance Threshold - ETag Mismatch
log Trying to perform a PATCH to modify individual Threshold using an invalid ETag
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
Set Headers {"If-Match": "${invalid_etag}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/ThresholdModification.json
${body}= Format String ${template} callback_uri=${new_callback_uri}:${callback_port}
PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId} ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Send Patch request for individual VNF Performance Threshold with Unreachable Callback URI
Set Headers {"Accept":"${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"}
......
......@@ -33,7 +33,7 @@ ${objectInstanceIds} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a
${subscribe} /subscribe
${invalid_etag} 4321
${pmJobId} 29f4ff6a-be91-4ec8-856e-fcf1e2479e4e
${erroneousPmJobId} erroneousPmJobId
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment