Commit 9475d73a authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

implemented deltas for SOL005 NSPM v2.8.1

parent 034b060c
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ Resource environment/variables.txt # Generic Parameters
Library           JSONLibrary
Resource          NSPerformanceManagementKeywords.robot
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library           Process

Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
GET individual NS Performance Job
@@ -74,7 +78,7 @@ PATCH Individual NS Performance Job
    ...    Test title: PATCH Individual NS Performance Job 
    ...    Test objective: The objective is to test that PATCH method modify an existing new NS Performance Monitoring Job
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Resource modified
@@ -99,11 +103,24 @@ PATCH Individual NS Performance Job - Precondition failed
    [Documentation]    Test ID: 5.3.4.2.8
    ...    Test title: PATCH Individual NS Performance Job - Precondition failed
    ...    Test objective: The objective is to attempt to Modify an individual NS Performance job fails, where the precondition was not met
    ...    Pre-conditions: The related job already exsisit
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The resource is not modified
    ...    Post-Conditions: none
    Send Patch request for individual NS Performance Job
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails

PATCH Individual NS Performance Job with Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.2.8
    ...    Test title: PATCH Individual NS Performance Job with Unprocessable Entity
    ...    Test objective: The objective is to test that modification of an individual NS Performance job fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for individual NS Performance Job with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is     ProblemDetails
 No newline at end of file
+18 −1
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@ Resource NSPerformanceManagementKeywords.robot
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library           OperatingSystem
Library    Process

Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
GET Individual Threshold
@@ -111,3 +115,16 @@ PATCH Individual Threshold - Precondition failed
    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 with Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.5.9
    ...    Test title: PATCH Individual Threshold with Unprocessable Entity
    ...    Test objective: The objective is to test that modification of an individual Threshold job fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
    ...    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 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS performance Threshold is not modified by the operation
    Send Patch request for individual NS performance Threshold with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+79 −7
Original line number Diff line number Diff line
@@ -92,7 +92,25 @@ Send Post Request Create new NS Performance Monitoring Job
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}    callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}    performanceMetric=${performanceMetric}    collectionPeriod=${collectionPeriod}    reportingPeriod=${reportingPeriod} 
    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}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Clear Requests    ${callback_endpoint}
    
Send Post Request Create new NS Performance Monitoring Job with Unprocessable Entity
    Log    Creating a new PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}    callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}    performanceMetric=${performanceMetric}    collectionPeriod=${collectionPeriod}    reportingPeriod=${reportingPeriod} 
    Log  We do not create notification endpoint so that to trigger an unprocessable entity error on the NFVO
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
@@ -239,10 +257,28 @@ Send Patch request for individual NS Performance Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/PmJobModifications.json
    ${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}
    Clear Requests    ${callback_endpoint}

Send Patch request for individual NS Performance Job with Unprocessable Entity 
    Log    Trying to perform a PATCH 
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    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  We do not create notification endpoint so that to trigger an unprocessable entity error on the NFVO
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}    ${body}
    ${output}=    Output    response

Check Postcondition NS Performance Job is not Created
    Log    Trying to get a new Pm Job
@@ -360,7 +396,25 @@ Send Post Request Create new Performance Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}    callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}    thresholdType=${thresholdType}    thresholdValue=${thresholdValue}    hysteresis=${hysteresis} 
    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}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Clear Requests    ${callback_endpoint}

Send Post Request Create new Performance Threshold with Unprocessable Entity
    Log    Creating a new THreshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${body}=        Format String   ${template}     pmJobId=${pmJobId}    callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}    thresholdType=${thresholdType}    thresholdValue=${thresholdValue}    hysteresis=${hysteresis} 
    Log  We do not create notification endpoint so that to trigger an unprocessable entity error on the NFVO
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
@@ -459,7 +513,26 @@ Send Patch request for individual NS performance Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/ThresholdModifications.json
    ${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}
    Clear Requests  ${callback_endpoint}
    
Send Patch request for individual NS performance Threshold with Unprocessable Entity
    Log    Trying to PUT threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    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  We do not create notification endpoint so that to trigger an unprocessable entity error on the NFVO
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
@@ -505,8 +578,7 @@ Check HTTP Response Header Contains
    Log    Header is present

Create Sessions
    Pass Execution If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 0    MockServer not started as NFVO is not checking the notification endpoint
    Start Process  java  -jar  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Start Process  java  -jar  ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar  -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}   
       
+20 −1
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@ Library JSONLibrary
Library           OperatingSystem
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library           MockServerLibrary
Library           Process

Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
GET all NS Performance Monitoring Jobs
@@ -130,6 +134,7 @@ Create new NS Performance Monitoring Job
    Send Post Request Create new NS Performance Monitoring Job
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is   PmJob
    Check HTTP Response Header Contains    Location
    Check Postcondition PmJob Exists

PUT all NS Performance Monitoring Jobs - Method not implemented
@@ -207,3 +212,17 @@ GET all NS Performance Monitoring Jobs with "fields" and "exclude_default" attri
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested selector

Create new NS Performance Monitoring Job with Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.1.16
    ...    Test title:  Create a new NS Performance Monitoring Job with Unprocessable Entity
    ...    Test objective: The objective is to test that the creation of a new NS performance monitoring job fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated.
    ...    Reference: Clause 7.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post Request Create new NS Performance Monitoring Job with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@ Resource NSPerformanceManagementKeywords.robot
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}    ssl_verify=false
Library           OperatingSystem
Library           Process

Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
GET All Performance Thresholds
@@ -137,3 +141,16 @@ GET Performance Thresholds - Bad Request Response too Big
    GET all Performance Thresholds
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
Create new Performance Threshold with Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.4.11
    ...    Test title:  Create new Performance Threshold with Unprocessable Entity
    ...    Test objective: The objective is to test the that creation of a new NS performance threshold fails when the request data is syntactically correct but cannot be processed, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated.
    ...    Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 005 [3] v2.8.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post Request Create new Performance Threshold with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is   ProblemDetails
 No newline at end of file
Loading