Commit 576468b9 authored by Mike-no's avatar Mike-no
Browse files

PATCH test for IndividualThreshold for API Producer not supporting...

PATCH test for IndividualThreshold for API Producer not supporting Last-Modified and ETag HTTP Headers
parent 61b84101
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -117,6 +117,20 @@ PATCH Individual Threshold - Precondition failed
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check Postcondition NS performance Threshold is Unmodified (Implicit)

PATCH Individual Threshold - Precondition failed HTTP Conditional Request Not Supported
    [Documentation]    Test ID: 5.3.4.5.8b
    ...    Test title: PATCH Individual Threshold - Precondition failed HTTP Conditional Request Not Supported
    ...    Test objective: The objective is to attempt to Modify an individual NS Performance threshold fails, where the API Producer does not support "Last-Modified" and "ETag" HTTP Headers
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance thresholds are set in the NFVO.
    ...    Reference: Clause 7.4.6.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 NS performance Threshold is not modified by the operation
    Send Patch request for individual NS performance Threshold - HTTP Conditional Request not supported
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check Postcondition NS performance Threshold is Unmodified (Implicit)
    
PATCH Individual Threshold - Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.2.9
    ...    Test title: PATCH Individual NS Performance Job - Unprocessable Entity
+21 −0
Original line number Diff line number Diff line
@@ -600,6 +600,27 @@ Send Patch request for individual NS performance Threshold - Etag mismatch
	Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}

Send Patch request for individual NS performance Threshold - HTTP Conditional Request not supported
    Pass Execution If    ${PRODUCER_SUPPORT_COND_REQ} == 1    NVFO allows conditional requests, skipping test
    Log    Trying to PUT threshold
    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/ThresholdModifications.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}/thresholds/${thresholdId}    ${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 Threshold with unprocessable entity
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}