diff --git a/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..6cc466661d3bc86498e51d944fa421876034689b --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/NotificationConsumer.robot @@ -0,0 +1,94 @@ +*** Settings *** +Library String +Resource environment/variables.txt +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +Ns Lcm Operation Occurrence Notification + [Documentation] Test ID: 5.3.2.26.1 + ... Test title: Ns Lcm Operation Occurrence Notification + ... Test objective: The objective is to test that Ns Lcm Operation Occurrence Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for NS LCM Operation Occurrence notifications is available in the NFVO. + ... Reference: Clause 6.4.18.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Ns Lcm Operation Occurrence Notification + Check HTTP Response Status Code Is 204 + +Ns Identifier Creation Notification + [Documentation] Test ID: 5.3.2.26.2 + ... Test title: Ns Identifier Creation Notification + ... Test objective: The objective is to test that Ns Identifier Creation Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for Ns Identifier Creation notification is available in the NFVO. + ... Reference: Clause 6.4.18.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Ns Identifier Creation Notification + Check HTTP Response Status Code Is 204 + +Ns Identifier Deletion Notification + [Documentation] Test ID: 5.3.2.26.3 + ... Test title: Ns Identifier Deletion Notification + ... Test objective: The objective is to test that Ns Identifier Deletion Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for Ns Identifier Deletion notification is available in the NFVO. + ... Reference: Clause 6.4.18.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Ns Identifier Deletion Notification + Check HTTP Response Status Code Is 204 + +*** Keywords *** +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body subscription.schema.json + Set Global Variable ${callbackResp} response body callbackUri + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Post Ns Lcm Operation Occurrence Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/NsLcmOperationOccurrenceNotification.json + ${body}= Format String ${template} nsInstanceId=${nsInstanceId} nsLcmOpOccId=${nsLcmOpOccId} subscriptionId=${subscriptionId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Post Ns Identifier Creation Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/NsIdentifierCreationNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} nsInstanceId=${nsInstanceId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Post Ns Identifier Deletion Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/NsIdentifierDeletionNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} nsInstanceId=${nsInstanceId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index c9c31a4ce3bc1f089d59296380631aa9c12650f2..02b7d79a87c0f41bd7198f675d48dbbf36309065 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -74,4 +74,6 @@ ${Etag_modified}= a modified etag ${NEG_FILTER} attribute_not_exist=some_value ${NEG_SELECTOR} fields=wrong_field -${json} {"notificationStatus": ""} \ No newline at end of file +${json} {"notificationStatus": ""} + +${callbackResp} 127.0.0.1 \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierCreationNotification.json b/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierCreationNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..152d85523d8a39e28c76ebdce9f327df2d722a92 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierCreationNotification.json @@ -0,0 +1,8 @@ +{{ + "id":"", + "notificationType":"NsIdentifierCreationNotification", + "subscriptionId":"{subscriptionId}", + "timeStamp":"", + "nsInstanceId":"{nsInstanceId}", + "_links":"" +}} diff --git a/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierDeletionNotification.json b/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierDeletionNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..320d5ee3b4a29d2ac652bc75930f2b3cb4da2fd4 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/NsIdentifierDeletionNotification.json @@ -0,0 +1,8 @@ +{{ + "id":"", + "notificationType":"NsIdentifierDeletionNotification", + "subscriptionId":"{subscriptionId}", + "timeStamp":"", + "nsInstanceId":"{nsInstanceId}", + "_links":"" +}} diff --git a/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json b/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..d5ed27cbaa573fa64680295cbcadd0d95a5e1bb0 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/NsLcmOperationOccurrenceNotification.json @@ -0,0 +1,13 @@ +{{ + "id":"", + "nsInstanceId":"{nsInstanceId}", + "nsLcmOpOccId":"{nsLcmOpOccId}" + "operation":"INSTANTIATE", + "notificationType":"NsLcmOperationOccurrenceNotification", + "subscriptionId":"{subscriptionId}", + "timeStamp":"", + "notificationStatus":"START", + "operationState":"PROCESSING", + "isAutomaticInvocation":"True", + "_links":"" +}}