Commit 61b84101 authored by Mike-no's avatar Mike-no
Browse files

PATCH test for IndividualPmJob for API Producer not supporting Last-Modified and ETag HTTP Headers

parent c2099906
Loading
Loading
Loading
Loading
+13
Changes for SOL005/NSPerformanceManagement-API/IndividualPmJob.robot: 13 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
@@ -113,6 +113,19 @@ PATCH Individual NS Performance Job - Precondition failed
    Check HTTP Response Status Code Is    412
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails
    Check HTTP Response Body Json Schema Is     ProblemDetails


PATCH Individual NS Performance Job - Precondition failed HTTP Conditional Request Not Supported
    [Documentation]    Test ID: 5.3.4.2.8b
    ...    Test title: PATCH Individual NS Performance Job - Precondition failed HTTP Conditional Request Not Supported
    ...    Test objective: The objective is to attempt to Modify an individual NS Performance job fails, where the API Producer does not support "Last-Modified" and "ETag" HTTP Headers
    ...    Pre-conditions: The related job already exist
    ...    Reference: Clause 7.4.3.3.4, 4.5 - ETSI GS NFV-SOL 005 [3] v4.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: API Producer does not support "Last-Modified" and "ETag" HTTP Headers
    ...    Post-Conditions: The resource is not modified
    Send Patch request for individual NS Performance Job - HTTP Conditional Request not supported
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails
    
PATCH Individual NS Performance Job - Unprocessable Entity
PATCH Individual NS Performance Job - Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.2.9
    [Documentation]    Test ID: 5.3.4.2.9
    ...    Test title: PATCH Individual NS Performance Job - Unprocessable Entity
    ...    Test title: PATCH Individual NS Performance Job - Unprocessable Entity
+20
Changes for SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot: 20 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
@@ -293,6 +293,26 @@ Send Patch request for individual NS Performance Job - Etag mismatch
	Verify Mock Expectation    ${notification_request}
	Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}
	Clear Requests    ${callback_endpoint}


Send Patch request for individual NS Performance Job - HTTP Conditional Request not supported
    Pass Execution If    ${PRODUCER_SUPPORT_COND_REQ} == 1    NVFO allows conditional requests, skipping test
    Log    Trying to perform a PATCH
    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/PmJobModifications.json
    ${body}=        Format String   ${template}    callbackUri=${callback_uri}    callbackEndpoint=${callback_endpoint}    callbackPort=${callback_port}
    Log  Creating mock request and response to handle GET operation on notification endpoint
    &{notification_request}=  Create Mock Request Matcher	GET  ${callback_endpoint}
    &{notification_response}=  Create Mock Response	status_code=204
    Log    Issue the request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Log    Verify producer tested the notification endpoint
	Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send Patch request for individual NS Performance Job with unprocessable entity
Send Patch request for individual NS Performance Job with unprocessable entity
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
+2
Changes for SOL005/NSPerformanceManagement-API/environment/variables.txt: 2 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
@@ -76,3 +76,5 @@ ${FILTER_KO} criterias=erroneousFilter
${SEPERATOR}      =
${SEPERATOR}      =


${callbackResp}    127.0.0.1
${callbackResp}    127.0.0.1

${PRODUCER_SUPPORT_COND_REQ}    1
 No newline at end of file