Commit ebf00f0a authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

implemented deltas for SOL003 VNF PM v2.8.1

parent 8c4e7597
Loading
Loading
Loading
Loading
+43 −2
Original line number Original line Diff line number Diff line
@@ -4,6 +4,10 @@ Library JSONSchemaLibrary schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           MockServerLibrary
Library           Process
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
GET individual VNF Performance Job
GET individual VNF Performance Job
@@ -109,7 +113,26 @@ PATCH Individual VNF 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
    Check Postcondition VNF Performance Job is Unmodified (Implicit)
    Check Postcondition VNF Performance Job is Unmodified (Implicit)
    
PATCH Individual VNF Performance Job with Unprocessable Entity
    [Documentation]    Test ID: 7.3.4.2.9
    ...    Test title: PATCH Individual VNF Performance Job with Unprocessable Entity
    ...    Test objective: The objective is to test that PATCH method to modify individual performace management 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 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 003 [1] v2.8.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Patch request for individual VNF Performance Job with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is   ProblemDetails
  
*** Keywords ***
*** Keywords ***
Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
    
GET individual VNF Performance Job
GET individual VNF Performance Job
    Log    Trying to get a Pm Job present in the NFVO Catalogue
    Log    Trying to get a Pm Job present in the NFVO Catalogue
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -165,9 +188,27 @@ Send Patch request for individual VNF Performance Job
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    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}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    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}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send Patch request for individual VNF Performance Job with Unprocessable Entity 
    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/PMJobModifications.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    Log    Do not create any mock for notification endpoint
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


+45 −2
Original line number Original line Diff line number Diff line
@@ -4,6 +4,10 @@ Resource environment/variables.txt # Generic Parameters
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           OperatingSystem
Library           OperatingSystem
Library           MockServerLibrary
Library           Process
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
GET Individual Threshold
GET Individual Threshold
@@ -91,7 +95,7 @@ PATCH Individual Threshold
    ...    Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1
    ...    Reference: Clause 6.4.6.3.4 - ETSI GS NFV-SOL 003 [1] v2.8.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    Send Patch request for individual VNF Performance Threshold
    Send Patch request for individual VNF Performance Threshold
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ThresholdModifications
    Check HTTP Response Body Json Schema Is    ThresholdModifications
@@ -109,7 +113,26 @@ PATCH Individual Threshold - 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
    Check Postcondition VNF Performance Threshold is Unmodified (Implicit)
    Check Postcondition VNF Performance Threshold is Unmodified (Implicit)

PATCH Individual Threshold with Unprocessable Entity
    [Documentation]    Test ID: 7.3.4.5.9
    ...    Test title: PATCH Individual Threshold with Unprocessable Entity
    ...    Test objective: The objective is to test that PATCH method to modify an Individual threshold resource 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 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 003 [1] v2.8.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for individual VNF Performance Threshold with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
*** Keywords ***
*** Keywords ***
Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
    
GET Individual VNF Performance Threshold
GET Individual VNF Performance Threshold
    Log    Trying to get a Threhsold present in the VNFM
    Log    Trying to get a Threhsold present in the VNFM
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -163,7 +186,27 @@ Send Patch request for individual VNF Performance Threshold
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_JSON}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    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}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    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}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}

Send Patch request for individual VNF Performance Threshold with Unprocessable Entity
    Log    Trying to PUT threshold
    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/ThresholdModifications.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    Log  Do not create any mock for notification endpoint    
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
+41 −1
Original line number Original line Diff line number Diff line
@@ -6,6 +6,9 @@ Library OperatingSystem
Library           String
Library           String
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           MockServerLibrary
Library           MockServerLibrary
Library           Process
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
GET all VNF Performance Monitoring Jobs
GET all VNF Performance Monitoring Jobs
@@ -208,7 +211,25 @@ GET all VNF Performance Monitoring Jobs with fields and exclude_default attribut
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested fields selector
    Check HTTP Response Body PmJobs Matches the requested fields selector


Create new VNF Performance Monitoring Job with Unprocessable Entity
    [Documentation]    Test ID: 7.3.4.1.16
    ...    Test title:  Create a new VNF Performance Monitoring Job with Unprocessable Entity
    ...    Test objective: The objective is to test that the creation of a new VNF 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 VNF instance is instantiated.
    ...    Reference: Clause 6.4.2.3.1 - ETSI GS NFV-SOL 003 [1] v2.8.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post Request Create new VNF Performance Monitoring Job with Unprocessable Entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
*** Keywords ***
*** Keywords ***
Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
    
GET all VNF Performance Monitoring Jobs
GET all VNF Performance Monitoring Jobs
    Log    Trying to get all PM Jobs present in the VNFM
    Log    Trying to get all PM Jobs present in the VNFM
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -290,7 +311,26 @@ Send Post Request Create new VNF Performance Monitoring Job
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    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}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}

Send Post Request Create new VNF 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}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    Log  Do not create mock for notification endpoint
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
+43 −1
Original line number Original line Diff line number Diff line
@@ -5,6 +5,10 @@ Resource environment/variables.txt # Generic Parameters
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           OperatingSystem
Library           OperatingSystem
Library           MockServerLibrary
Library           Process
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
GET All Performance Thresholds
GET All Performance Thresholds
@@ -136,7 +140,26 @@ GET Performance Thresholds - Bad Request Response too Big
    GET all Performance Thresholds
    GET all Performance Thresholds
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Check HTTP Response Body Json Schema Is   ProblemDetails

Create new Performance Threshold with Unprocessable Entity
    [Documentation]    Test ID: 7.3.4.4.11
    ...    Test title:  Create new Performance Threshold with Unprocessable Entity
    ...    Test objective: The objective is to test that the creation of a new VNF 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 VNF instance is instantiated.
    ...    Reference: Clause 6.4.5.3.1 - ETSI GS NFV-SOL 003 [1] v2.8.1
    ...    Config ID: Config_prod_VNFM
    ...    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

*** Keywords ***
*** Keywords ***
Create Sessions
    Start Process  java  -jar  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}:${callback_port}
    
GET all Performance Thresholds
GET all Performance Thresholds
    Log    Trying to get all thresholds present in the VNFM    
    Log    Trying to get all thresholds present in the VNFM    
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -175,7 +198,26 @@ Send Post Request Create new Performance Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${request}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}
    ${request}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    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    ${request}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	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
    ${request}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    Log  DO not create any mock for notification endpoint
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${request}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${request}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
+2 −2
Original line number Original line Diff line number Diff line
@@ -20,9 +20,9 @@ ${apiRoot} /
${apiMajorVersion}     v1
${apiMajorVersion}     v1
${apiName}        vnfpm
${apiName}        vnfpm


${callback_uri}    http://localhost
${callback_port}    9091
${callback_port}    9091
${callback_uri}    http://172.22.1.7:${callback_port}
${callback_endpoint}    /endpoint
${callback_endpoint}    /vnfpm/subscriptions
${callback_endpoint_error}    /subs_404
${callback_endpoint_error}    /subs_404
${sleep_interval}    20s
${sleep_interval}    20s


Loading