Commit 9eb1681a authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

fixed issue #154 on SOL005 subscriptions - v2.7.1

parent 3289ba78
Loading
Loading
Loading
Loading
+24 −13
Original line number Original line Diff line number Diff line
@@ -789,13 +789,19 @@ Send Post Request for NSD Management Subscription
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/subscriptions.json
    ${template}=    Get File    jsons/subscriptions.json
    ${body}=        Format String   ${template}     notifCallbackUri=${notifCallbackUri}    nsdId=${NS_DescriptorID}    nsdName=${NS_Name}    nsdVersion=${NS_Version}    nsdDesigner=${Designer}    nsdInvariantId=${NS_InvariantId}
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}:${callback_port}    callback_endpoint=${callback_endpoint}    nsdId=${NS_DescriptorID}    nsdName=${NS_Name}    nsdVersion=${NS_Version}    nsdDesigner=${Designer}    nsdInvariantId=${NS_InvariantId}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    REST.POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
	${output}=    Output    response
	${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
	Set Global Variable    ${response}    ${output}
    Run Keyword If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
	Clear Requests    ${callback_endpoint}
    ...    Check Notification Endpoint  
    #Run Keyword If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1    #removed as the check of notif endpoint is done by NFVO while processing subscription reques
    #...    Check Notification Endpoint     




Send POST Request for Duplicated NSD Management Subscription
Send POST Request for Duplicated NSD Management Subscription
@@ -804,13 +810,19 @@ Send POST Request for Duplicated NSD Management Subscription
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/subscriptions.json
    ${template}=    Get File    jsons/subscriptions.json
    ${body}=        Format String   ${template}     notifCallbackUri=${notifCallbackUri}    nsdId=${NS_DescriptorID}    nsdName=${NS_Name}    nsdVersion=${NS_Version}    nsdDesigner=${Designer}    nsdInvariantId=${NS_InvariantId}
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}:${callback_port}    callback_endpoint=${callback_endpoint}    nsdId=${NS_DescriptorID}    nsdName=${NS_Name}    nsdVersion=${NS_Version}    nsdDesigner=${Designer}    nsdInvariantId=${NS_InvariantId}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    REST.POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
	${output}=    Output    response
	${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
	Set Global Variable    ${response}    ${output}
    Run Keyword If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
	Clear Requests    ${callback_endpoint}
    ...    Check Notification Endpoint  
    #Run Keyword If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1    #removed as the check of notif endpoint is done by NFVO while processing subscription reques
    #...    Check Notification Endpoint   






@@ -982,7 +994,6 @@ Check HTTP Response Header Contains Etag
    Set Suite Variable    ${original_etag}    ${response['headers]['ETag']}
    Set Suite Variable    ${original_etag}    ${response['headers]['ETag']}


Create Sessions
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  ${MOCK_SERVER_JAR}    -serverPort  ${callback_port}  alias=mockInstance
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Wait For Process  handle=mockInstance  timeout=5s  on_timeout=continue
    Create Mock Session  ${callback_uri}
    Create Mock Session  ${callback_uri}
+1 −1
Original line number Original line Diff line number Diff line
{{
{{
	"callbackUri": "{notifCallbackUri}",
	"callbackUri": "{callback_uri}{callback_endpoint}",
	"filter": {{
	"filter": {{
		"nsdId": "{nsdId}",
		"nsdId": "{nsdId}",
		"nsdName": "{nsdName}",
		"nsdName": "{nsdName}",
+11 −3
Original line number Original line Diff line number Diff line
@@ -215,9 +215,17 @@ POST Subscription
    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/fmSubscriptionRequest.json
    ${template}=    Get File    jsons/fmSubscriptionRequest.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}:${callback_port}    callback_endpoint=${callback_endpoint}
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}:${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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
    ${outputResponse}=    Output    response
	${output}=    Output    response
    Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${output}
	Clear Requests    ${callback_endpoint}
    #Run Keyword If    ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1    #removed as the check of notif endpoint is done by NFVO while processing subscription reques
    #...    Check Notification Endpoint 


# Post Create subscription - DUPLICATION
# Post Create subscription - DUPLICATION
    # Log    Trying to create a subscription with an already created content
    # Log    Trying to create a subscription with an already created content
+3 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,9 @@ Library OperatingSystem
Library  DependencyLibrary
Library  DependencyLibrary
Library    JSONLibrary
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Create Sessions
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
*** Test Cases ***
Create a new alarm subscription
Create a new alarm subscription
+19 −1
Original line number Original line Diff line number Diff line
@@ -1097,9 +1097,15 @@ POST subscriptions
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}   nsdId=${NS_DescriptorID}
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}   nsdId=${NS_DescriptorID}
    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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
	Clear Requests    ${callback_endpoint}
		
		
POST subscriptions DUPLICATION
POST subscriptions DUPLICATION
    Log    Trying to create a subscription with an already created content
    Log    Trying to create a subscription with an already created content
@@ -1110,9 +1116,15 @@ POST subscriptions DUPLICATION
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}     nsdId=${NS_DescriptorID}
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}     nsdId=${NS_DescriptorID}
    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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
	Clear Requests    ${callback_endpoint}
	
	
POST subscriptions NO DUPLICATION
POST subscriptions NO DUPLICATION
    Log    Trying to create a subscription with an already created content
    Log    Trying to create a subscription with an already created content
@@ -1123,9 +1135,15 @@ POST subscriptions NO DUPLICATION
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    Run Keyword If    ${check_descriptors} == 1    PARSE the NS Descriptor File
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}     nsdId=${NS_DescriptorID}
    ${body}=        Format String   ${template}     callbackUri=${callback_uri}   callbackEndpoint=${callback_endpoint}   callbackPort=${callback_port}     nsdId=${NS_DescriptorID}
    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 subscription request
    Create Mock Expectation  ${notification_request}  ${notification_response}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
	Clear Requests    ${callback_endpoint}


GET Subscriptions
GET Subscriptions
    Log    Get the list of active subscriptions
    Log    Get the list of active subscriptions
Loading