Commit bac0a14d authored by Mike-no's avatar Mike-no Committed by Giacomo Bernini
Browse files

PATCH tests for IndividualNSLCMOccurrences for API Producer not supporting...

PATCH tests for IndividualNSLCMOccurrences for API Producer not supporting Last-Modified and ETag HTTP Headers and ETag mismatch
parent 20d2e7d8
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -70,6 +70,32 @@ PATCH status information about Individual NS LCM occurrences - scheduled operati
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is     ProblemDetails

PATCH status information about Individual NS LCM occurrences - Precondition failed
     [Documentation]    Test ID: 5.3.2.9.4c
    ...    Test title: PATCH status information about Individual NS LCM occurrences - Precondition failed
    ...    Test objective: The objective is to test that PATCH method that modifies an existing Individual NS LCM occurrence fails if the resource was modified by another entity
    ...    Pre-conditions: An Individual NS LCM occurrence represents a scheduled operation not yet started 
    ...    Reference: Clause 6.4.10.3.4 - ETSI GS NFV-SOL 005 [3] v4.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The resource was modified by another entity
    ...    Post-Conditions: none
    PATCH Individual NS LCM OP Occurrence - ETag mismatch
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails

PATCH status information about Individual NS LCM occurrences - Precondition failed HTTP Conditional Request Not Supported
     [Documentation]    Test ID: 5.3.2.9.4d
    ...    Test title: PATCH status information about Individual NS LCM occurrences - Precondition failed HTTP Conditional Request Not Supported
    ...    Test objective: The objective is to test that PATCH method that modifies an existing Individual NS LCM occurrence fails if the API Producer does not support "Last-Modified" and "ETag" HTTP Headers
    ...    Pre-conditions: An Individual NS LCM occurrence represents a scheduled operation not yet started 
    ...    Reference: Clause 6.4.10.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: none
    PATCH Individual NS LCM OP Occurrence - HTTP Conditional Request not supported
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails

DELETE status information about Individual NS LCM occurrences - Method not implemented
         [Documentation]    Test ID: 5.3.2.9.5
    ...    Test title: DELETE status information about Individual NS LCM occurrences - Method not implemented
+37 −0
Original line number Diff line number Diff line
@@ -940,6 +940,43 @@ PATCH Individual NS LCM OP Occurrence of Already Started Scheduled Operation
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Individual NS LCM OP Occurrence - ETag mismatch
    log    Trying to perform a PATCH.
    Set Headers  {"Accept":"${ACCEPT}"}
    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}"}
    ${body}=    Get File    jsons/NsLcmInfoModificationRequest.json
    ${body}=        Format String   ${body}     scheduledTime=${schedule_for_new_operation_start}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId_scheduledOp_notStarted}    ${body}	 	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Individual NS LCM OP Occurrence - ETag mismatch
    log    Trying to perform a PATCH.
    Set Headers  {"Accept":"${ACCEPT}"}
    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}"}
    ${body}=    Get File    jsons/NsLcmInfoModificationRequest.json
    ${body}=        Format String   ${body}     scheduledTime=${schedule_for_new_operation_start}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId_scheduledOp_notStarted}    ${body}	 	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

PATCH Individual NS LCM OP Occurrence - 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}"}
    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}"}
    ${body}=    Get File    jsons/NsLcmInfoModificationRequest.json
    ${body}=        Format String   ${body}     scheduledTime=${schedule_for_new_operation_start}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_lcm_op_occs/${nsLcmOpOccId_scheduledOp_notStarted}    ${body}	 	
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

DELETE Individual NS LCM OP Occurrence
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
+4 −1
Original line number Diff line number Diff line
@@ -118,3 +118,6 @@ ${Product_Name}
${Software_Version}
${Descriptor_Version}
${Flavour_ID}

${invalid_etag}=    invalid etag
${PRODUCER_SUPPORT_COND_REQ}    1
 No newline at end of file