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

fixed issue #154 on SOL005 subscriptions - v2.7.1

parent 3289ba78
......@@ -789,13 +789,19 @@ Send Post Request for NSD Management Subscription
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${check_descriptors} == 1 PARSE the NS Descriptor File
${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}"}
REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
... Check Notification 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}
${output}= Output response
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
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}"}
Run Keyword If ${check_descriptors} == 1 PARSE the NS Descriptor File
${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}"}
REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
... Check Notification 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}
${output}= Output response
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
......@@ -982,7 +994,6 @@ Check HTTP Response Header Contains Etag
Set Suite Variable ${original_etag} ${response['headers]['ETag']}
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
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}
......
{{
"callbackUri": "{notifCallbackUri}",
"callbackUri": "{callback_uri}{callback_endpoint}",
"filter": {{
"nsdId": "{nsdId}",
"nsdName": "{nsdName}",
......
......@@ -215,9 +215,17 @@ POST Subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
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
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
# Log Trying to create a subscription with an already created content
......
......@@ -6,6 +6,9 @@ Library OperatingSystem
Library DependencyLibrary
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
Create a new alarm subscription
......
......@@ -1097,10 +1097,16 @@ POST subscriptions
Run Keyword If ${check_descriptors} == 1 PARSE the NS Descriptor File
${template}= Get File jsons/LccnSubscriptionRequest.json
${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}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Clear Requests ${callback_endpoint}
POST subscriptions DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test
......@@ -1110,9 +1116,15 @@ POST subscriptions DUPLICATION
Run Keyword If ${check_descriptors} == 1 PARSE the NS Descriptor File
${template}= Get File jsons/LccnSubscriptionRequest.json
${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}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Clear Requests ${callback_endpoint}
POST subscriptions NO DUPLICATION
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
${template}= Get File jsons/LccnSubscriptionRequest.json
${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}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Clear Requests ${callback_endpoint}
GET Subscriptions
Log Get the list of active subscriptions
......
......@@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
Library Process
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
*** Test Cases ***
POST Create a new subscription
......
......@@ -735,11 +735,17 @@ Send Post Request for VNF Package Subscription
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} vnfdId=${Descriptor_ID} vnfProvider=${Provider} vnfProductName=${Product_Name} vnfSoftwareVersion=${Software_Version} vnfdVersions=${Descriptor_Version}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
... Check Notification 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}
${output}= Output response
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
Send Post Request for Duplicated VNF Package Subscription
Log Trying to create a subscription with an already created content
......@@ -748,9 +754,17 @@ Send Post Request for Duplicated VNF Package Subscription
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
REST.POST ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
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
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
Send Put Request for VNF Package Subscriptions
Log Trying to perform a PUT. This method should not be implemented
......@@ -894,7 +908,6 @@ Check Postcondition VNF Package Subscription is not Created
Check HTTP Response Status Code Is 404
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
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}:${callback_port}
......
[
{
"id": "ABCDEFGHIJKL",
"callbackUri": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"_links": {
"self": {
"href": "ABCDEFGHIJKLMNOPQR"
}
},
"filter": {
"notificationTypes": [
"VnfPackageChangeNotification"
],
"vnfProductsFromProviders": [
{
"vnfProvider": "ABCDEFGHIJKLMNOPQRSTUVW",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGHIJKLMNOPQRSTUVWX",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQ",
"ABCDE"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZA",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
]
}
]
},
{
"vnfProductName": "ABCDEFGHIJKLM",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMN",
"vnfdVersions": [
"ABCDEF",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"vnfdVersions": [
"ABCDEFGHIJKLMNO",
"ABCDEFGH",
"ABCDEF"
]
},
{
"vnfSoftwareVersion": "ABCD",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXY",
"ABCDEFGHIJ",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST",
"vnfdVersions": [
"ABCDEFG",
"ABCDEFGHIJKLMNOPQRSTU"
]
}
]
}
]
},
{
"vnfProvider": "ABCDEF",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGH",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST",
"vnfdVersions": [
"ABCDE",
"ABCDE",
"ABCDEFGHIJKLMNOPQR"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWX",
"vnfdVersions": [
"ABCDEFGHIJKLMNOP"
]
}
]
},
{
"vnfProductName": "ABCDE",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNO",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJ",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRS"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJK",
"vnfdVersions": [
"ABCD"
]
},
{
"vnfSoftwareVersion": "ABCD",
"vnfdVersions": [
"ABCDEFGHIJKL",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
]
}
]
},
{
"vnfProductName": "ABCD",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRST",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQ",
"ABCDEFGHIJKL"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXY",
"vnfdVersions": [
"ABCDEF",
"ABCDEFGHIJKLMNOPQRST"
]
},
{
"vnfSoftwareVersion": "ABCDEF",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKLMNOPQR",
"ABCDEFGHIJKLMNOP"
]
}
]
}
]
}
],
"vnfdId": [
"ABCDEFGHIJKLMNOPQRS",
"ABCDEFGHIJKLMNO",
"ABCDEFGHIJKLM",
"ABCDEFGHIJK"
],
"vnfPkgId": [
"ABCDEFGH",
"ABCDEFGHIJKLMNOPQ",
"ABCDE",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
],
"operationalState": "DISABLED",
"usageState": {}
}
},
{
"id": "ABCDE",
"callbackUri": "ABCDEFGHIJKLM",
"_links": {
"self": {
"href": "ABCDEFGHIJKLMNOPQRSTU"
}
},
"filter": {
"notificationTypes": [
"VnfPackageOnboardingNotification",
"VnfPackageOnboardingNotification",
"VnfPackageOnboardingNotification"
],
"vnfProductsFromProviders": [
{
"vnfProvider": "ABCDEFGH",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGHIJKLMNOPQRSTUV",
"versions": [
{
"vnfSoftwareVersion": "ABCD",
"vnfdVersions": [
"ABCDEFGHIJKLMN",
"ABCDEFGHIJKLMNOPQRSTUVW",
"ABCDE",
"ABCDEFGHIJKLMNOPQRS"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRS"
]
}
]
},
{
"vnfProductName": "ABCDEFGHIJKLMN",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOP",
"vnfdVersions": [
"ABCDEFGHIJ",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQR"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMN",
"vnfdVersions": [
"ABCDEFGHIJKLMNO",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"ABCDEFGHIJKLMNOPQRSTUVW"
]
},
{
"vnfSoftwareVersion": "ABCDEF",
"vnfdVersions": [
"ABCDEFGHIJKLM",
"ABCDE",
"ABCDEFGHIJKLMNOPQRSTUVWXYZA"
]
}
]
}
]
},
{
"vnfProvider": "ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGHIJKLMNOPQ",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWXY",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQ",
"ABCDE"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMN",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC"
]
}
]
},
{
"vnfProductName": "ABCDEFGHIJKLMNOP",
"versions": [
{
"vnfSoftwareVersion": "ABCD",
"vnfdVersions": [
"ABCDEFGH",
"ABCDEFGHIJKLMN",
"ABCDEFGHIJKLMNOP"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLM",
"vnfdVersions": [
"ABCDEFGHIJKLM",
"ABCDEFGH"
]
}
]
}
]
}
],
"vnfdId": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKLM",
"ABCDEFGHIJKLMNOPQRS",
"ABCDEFGHIJKL"
],
"vnfPkgId": [
"ABCDEFGHIJKLMNOPQRSTUVWXY"
],
"operationalState": "DISABLED",
"usageState": {}
}
},
{
"id": "ABCDEF",
"callbackUri": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"_links": {
"self": {
"href": "ABCDEFGHIJKLMNOPQ"
}
},
"filter": {
"notificationTypes": [
"VnfPackageChangeNotification",
"VnfPackageOnboardingNotification",
"VnfPackageChangeNotification",
"VnfPackageOnboardingNotification"
],
"vnfProductsFromProviders": [
{
"vnfProvider": "ABCDEFGHIJKL",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGHIJK",
"versions": [
{
"vnfSoftwareVersion": "ABCDE",
"vnfdVersions": [
"ABCDEFGHI",
"ABCDEFGHIJKLMNOPQRS",
"ABCDEFGHIJKLMNOPQR"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQRSTUVWX",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWX",
"ABCDEFG",
"ABCDEFGHIJKLMNOPQRSTUVW",
"ABCDEFGHIJKLMNOPQRSTUVWXY"
]
}
]
}
]
},
{
"vnfProvider": "ABCDEFGHI",
"vnfProducts": [
{
"vnfProductName": "ABCDEFGHIJ",
"versions": [
{
"vnfSoftwareVersion": "ABCDEFGHIJKL",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZA",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKL",
"ABCDEFGHIJKLMNOPQR"
]
},
{
"vnfSoftwareVersion": "ABCDEFGHIJKLMNOPQ",
"vnfdVersions": [
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKLMNOPQRSTU",
"ABCDEFGHIJKLMNOPQRSTUVWXYZABC",
"ABCDEFGHIJKLMN"
]
}
]
}
]
},
{