Commit e6741a12 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

updated SOL003 VNF PM pm jobs and thresholds callaback uri

parent 940850d3
Loading
Loading
Loading
Loading
+20 −3
Original line number Original line Diff line number Diff line
@@ -5,6 +5,11 @@ 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           String
Library           String
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
@@ -126,6 +131,11 @@ PATCH Individual VNF Performance Job - Unprocessable Entity
    
    
    
    
*** 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}"}
@@ -182,10 +192,17 @@ Send Patch request for individual VNF Performance 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/PMJobModifications.json
    ${template}=    Get File    jsons/PMJobModifications.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_endpoint=${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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send Patch request for individual VNF Performance Job - Etag mismatch  
Send Patch request for individual VNF Performance Job - Etag mismatch  
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
@@ -193,7 +210,7 @@ Send Patch request for individual VNF Performance Job - Etag mismatch
    Set Headers  {"If-Match": "${invalid_etag}"} 
    Set Headers  {"If-Match": "${invalid_etag}"} 
    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/PMJobModifications.json
    ${template}=    Get File    jsons/PMJobModifications.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_endpoint=${callback_endpoint} 
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -204,7 +221,7 @@ Send Patch request for individual VNF Performance Job with unprocessable entity
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    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/PMJobModifications.json
    ${template}=    Get File    jsons/PMJobModifications.json
    ${body}=        Format String   ${template}    callback_uri=${unreachable_callback_uri}:${callback_port}
    ${body}=        Format String   ${template}    callback_uri=${unreachable_callback_uri}    callback_port=${callback_port}    callback_endpoint=${callback_endpoint} 
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
+18 −2
Original line number Original line Diff line number Diff line
@@ -5,6 +5,11 @@ 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           String
Library           String
Library           Process
Library           MockServerLibrary

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


*** Test Cases ***
*** Test Cases ***
GET Individual Threshold
GET Individual Threshold
@@ -125,6 +130,11 @@ PATCH Individual Threshold - Unprocessible Entity




*** 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}"}
@@ -180,9 +190,16 @@ Send Patch request for individual VNF Performance Threshold
    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/ThresholdModifications.json
    ${template}=    Get File    jsons/ThresholdModifications.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint}   
    ${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}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send Patch request for individual VNF Performance Threshold - Etag mismatch
Send Patch request for individual VNF Performance Threshold - Etag mismatch
    Log    Trying to PUT threshold
    Log    Trying to PUT threshold
@@ -196,14 +213,13 @@ Send Patch request for individual VNF Performance Threshold - Etag mismatch
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
    
Send Patch request for individual VNF Performance Threshold with unprocessable entity
Send Patch request for individual VNF Performance Threshold with unprocessable entity
    Log    Trying to PATCH threshold
    Log    Trying to PATCH threshold
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    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/ThresholdModifications.json
    ${template}=    Get File    jsons/ThresholdModifications.json
    ${body}=        Format String   ${template}    callback_uri=${unreachable_callback_uri}:${callback_port}
    ${body}=        Format String   ${template}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}     ${body}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds/${thresholdId}     ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
+18 −1
Original line number Original line Diff line number Diff line
@@ -6,6 +6,11 @@ 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
@@ -234,6 +239,11 @@ POST Create new VNF Performance Monitoring Job - Unprocessable Entity
    Check HTTP Response Body Json Schema Is    ProblemDetails 
    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}"}
@@ -335,10 +345,17 @@ 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_endpoint=${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}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send PUT Request for all VNF Performance Monitoring Jobs 
Send PUT Request for all VNF Performance Monitoring Jobs 
    Log    Trying to perform a PUT. This method should not be implemented
    Log    Trying to perform a PUT. This method should not be implemented
+19 −3
Original line number Original line Diff line number Diff line
@@ -5,6 +5,11 @@ 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           Process
Library           MockServerLibrary

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


*** Test Cases ***
*** Test Cases ***
GET All Performance Thresholds
GET All Performance Thresholds
@@ -151,6 +156,11 @@ POST create new Performance Threshold - Unprocessable Entity
    Check HTTP Response Body Json Schema Is   ProblemDetails
    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}"}
@@ -200,11 +210,17 @@ Send Post Request Create new Performance Threshold with unprocessable entity
    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
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${unreachable_callback_uri}:${callback_port}
    ${request}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${callback_uri}    callback_port=${callback_port}    callback_uri=${callback_endpoint} 
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}

    Verify Mock Expectation    ${notification_request}
	Clear Requests    ${callback_endpoint}


Send PUT Request for all Performance Thresholds
Send PUT Request for all Performance Thresholds
    Log    PUT THresholds
    Log    PUT THresholds
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ ${apiMajorVersion} v1
${apiName}        vnfpm
${apiName}        vnfpm


${callback_port}    9091
${callback_port}    9091
${callback_uri}    http://172.22.1.7:${callback_port}
${callback_uri}    http://172.22.1.7
${unreachable_callback_uri}    http://not-reachable-uri
${unreachable_callback_uri}    http://not-reachable-uri
${callback_endpoint}    /vnfpm/subscriptions
${callback_endpoint}    /vnfpm/subscriptions
${callback_endpoint_error}    /subs_404
${callback_endpoint_error}    /subs_404
Loading