diff --git a/SOL009/NFVMANOFaultManagement-API/ApiVersion.robot b/SOL009/NFVMANOFaultManagement-API/ApiVersion.robot index 0dde1341d855b5dd1dfe6f28c0eb17209811b99b..fc51479fd99ab3332e56ecd8e04fdcce0b4b816f 100644 --- a/SOL009/NFVMANOFaultManagement-API/ApiVersion.robot +++ b/SOL009/NFVMANOFaultManagement-API/ApiVersion.robot @@ -132,70 +132,70 @@ DELETE API Version with apiMajorVerion - Method not implemented POST API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/api_version + Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/api_version + Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/api_version + Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/api_version + Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/api_version + Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVMANOFaultManagement-API/NotificationConsumer.robot b/SOL009/NFVMANOFaultManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..3784c161231484a08791f057258a5b078f0d103f --- /dev/null +++ b/SOL009/NFVMANOFaultManagement-API/NotificationConsumer.robot @@ -0,0 +1,94 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt +Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library String +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +Alarm Notification + [Documentation] Test ID: 8.3.3.7.1 + ... Test title: Alarm Notification + ... Test objective: The objective is to test that Alarm Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for alarm notification is available in the NFV-MANO. + ... Reference: clause 7.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Alarm Notification + Check HTTP Response Status Code Is 204 + +Alarm Cleared Notification + [Documentation] Test ID: 8.3.3.7.2 + ... Test title: Alarm Cleared Notification + ... Test objective: The objective is to test that Alarm Cleared Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for alarm cleared notification is available in the NFV-MANO. + ... Reference: clause 7.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Alarm Cleared Notification + Check HTTP Response Status Code Is 204 + +Alarm List Rebuilt Notification + [Documentation] Test ID: 8.3.3.7.3 + ... Test title: Alarm List Rebuilt Notification + ... Test objective: The objective is to test that Alarm List Rebuilt Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for alarm list rebuilt notification is available in the NFV-MANO. + ... Reference: clause 7.5.7.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Alarm List Rebuilt Notification + Check HTTP Response Status Code Is 204 + +*** Keywords *** +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + 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 FmSubscription.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 Alarm Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/AlarmNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} managedObjectId=${managedObjectId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Post Alarm Cleared Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/AlarmClearedNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} alarmId=${alarmId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Post Alarm List Rebuilt Notification + log Trying to perform a POST to get notifications + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/AlarmListRebuiltNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + diff --git a/SOL009/NFVMANOFaultManagement-API/environment/variables.txt b/SOL009/NFVMANOFaultManagement-API/environment/variables.txt index fdb1ee9d30c8f52a9922a0a65a2d7c0f9a2aef44..e230f9438c7138a224081c9f529295278c109d5f 100644 --- a/SOL009/NFVMANOFaultManagement-API/environment/variables.txt +++ b/SOL009/NFVMANOFaultManagement-API/environment/variables.txt @@ -48,4 +48,6 @@ ${polling_interval} 10 sec ${notification_request} [] ${notification_response} [] -${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar \ No newline at end of file +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${callbackResp} 127.0.0.1 \ No newline at end of file diff --git a/SOL009/NFVMANOFaultManagement-API/jsons/AlarmClearedNotification.json b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmClearedNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..456d44801a509ebadea63c82c2ac357eb3dbdd05 --- /dev/null +++ b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmClearedNotification.json @@ -0,0 +1,12 @@ +{{ + "id": "", + "notificationType": "AlarmClearedNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "alarmId": "{alarmId}", + "alarmClearedTime": "", + "_links": {{ + "subscription": "", + "alarm": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVMANOFaultManagement-API/jsons/AlarmListRebuiltNotification.json b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmListRebuiltNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..11ec0adb87a26b6416246008553ec9b0c3a3ea92 --- /dev/null +++ b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmListRebuiltNotification.json @@ -0,0 +1,10 @@ +{{ + "id": "", + "notificationType": "AlarmListRebuiltNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "_links": {{ + "subscription": "", + "alarms": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVMANOFaultManagement-API/jsons/AlarmNotification.json b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..65510f3f96aafa3bfed9f9f1ae4e4b70fe39227b --- /dev/null +++ b/SOL009/NFVMANOFaultManagement-API/jsons/AlarmNotification.json @@ -0,0 +1,21 @@ +{{ + "id": "", + "notificationType": "AlarmNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "alarm": {{ + "id": "{alarmId}", + "managedObjectId": "{managedObjectId}", + "perceivedSeverity": "MAJOR", + "eventTime": "", + "eventType": "COMMUNICATIONS_ALARM", + "probableCause": "", + "isRootCause": "TRUE", + "_links": {{ + "self": "" + }} + }}, + "_links": {{ + "subscription": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVMANOLogManagement-API/ApiVersion.robot b/SOL009/NFVMANOLogManagement-API/ApiVersion.robot index f97546b9e232bdcce292101455a5250b2c2da258..ddd681ced2080c304368d4442e2282fdbef1c164 100644 --- a/SOL009/NFVMANOLogManagement-API/ApiVersion.robot +++ b/SOL009/NFVMANOLogManagement-API/ApiVersion.robot @@ -132,70 +132,70 @@ DELETE API Version with apiMajorVerion - Method not implemented POST API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/api_version + Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/api_version + Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/api_version + Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/api_version + Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/api_version + Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVMANOLogManagement-API/NotificationConsumer.robot b/SOL009/NFVMANOLogManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..f124cf4b97480117593e53be62542e7dd0028123 --- /dev/null +++ b/SOL009/NFVMANOLogManagement-API/NotificationConsumer.robot @@ -0,0 +1,47 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt +Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library String +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +Log Report Available Notification + [Documentation] Test ID: 8.3.4.9.1 + ... Test title: Log Report Available Notification + ... Test objective: The objective is to test that Log Report Available Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for log report available notification is available in the NFV-MANO. + ... Reference: clause 8.5.9.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Post Log Report Available Notification + Check HTTP Response Status Code Is 204 + +*** Keywords *** +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body LogmSubscription.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 Log Report Available Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/LogReportAvailableNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} objectInstanceId=${objectInstanceId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVMANOLogManagement-API/environment/variables.txt b/SOL009/NFVMANOLogManagement-API/environment/variables.txt index 82c8646ff8ad555bb371ee2b8a187c71c70a9587..0b09b860f399dbd0ad24987b8b8d39561308bf8d 100644 --- a/SOL009/NFVMANOLogManagement-API/environment/variables.txt +++ b/SOL009/NFVMANOLogManagement-API/environment/variables.txt @@ -63,4 +63,6 @@ ${erroneousSubscriptionId} erroneousSubscriptionId ${newSubscriptionId} newSubsciptionId ${objectInstanceId} 4bd7-94b4-6bbb86-9c79aa -${notification_type} LogReportAvailableNotification \ No newline at end of file +${notification_type} LogReportAvailableNotification + +${callbackResp} 127.0.0.1 \ No newline at end of file diff --git a/SOL009/NFVMANOLogManagement-API/jsons/LogReportAvailableNotification.json b/SOL009/NFVMANOLogManagement-API/jsons/LogReportAvailableNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..d585acf5604797ba9debecc71ec6ceb27cdf69bd --- /dev/null +++ b/SOL009/NFVMANOLogManagement-API/jsons/LogReportAvailableNotification.json @@ -0,0 +1,12 @@ +{{ + "id": "", + "notificationType": "LogReportAvailableNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "objectInstanceId": "{objectInstanceId}", + "_links": {{ + "subscription": "", + "LoggingJob": "", + "logReports": [] + }} +}} \ No newline at end of file diff --git a/SOL009/NFVMANOPerformanceManagement-API/ApiVersion.robot b/SOL009/NFVMANOPerformanceManagement-API/ApiVersion.robot index 104a87b268336de0a098d4cfd2ca376414cd6fbb..466df91aef17be514ec94a601301a81e220de42d 100644 --- a/SOL009/NFVMANOPerformanceManagement-API/ApiVersion.robot +++ b/SOL009/NFVMANOPerformanceManagement-API/ApiVersion.robot @@ -132,70 +132,70 @@ DELETE API Version with apiMajorVerion - Method not implemented POST API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/api_version + Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/api_version + Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/api_version + Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/api_version + Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/api_version + Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVMANOPerformanceManagement-API/NotificationConsumer.robot b/SOL009/NFVMANOPerformanceManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..9fcc1ca51fb453160d44f53cce5864e64675fd03 --- /dev/null +++ b/SOL009/NFVMANOPerformanceManagement-API/NotificationConsumer.robot @@ -0,0 +1,79 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt +Resource environment/individualThresholds.txt +Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library String +Suite Setup Check resource existence and get CallbackUri + + +*** Test Cases *** +Performance Information Available Notification + [Documentation] Test ID: 8.3.2.10.1 + ... Test title: Performance Information Available Notification + ... Test objective: The objective is to test that Performance Available Notification is delivered with success to the notification consumer + ... Pre-conditions: A subscription for performance available notification is available in the NFV-MANO. + ... Reference: clause 6.5.10.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Performance Information Available Notification + Check HTTP Response Status Code Is 204 + +Threshold Crossed Notification + [Documentation] Test ID: 8.3.2.10.2 + ... Test title: Threshold Crossed Notification + ... Test objective: The objective is to test that Threshold Crossed Notification is delivered with success to the notification consumer + ... Pre-conditions: A subscription for threshold crosssed notification is available in the NFV-MANO. + ... Reference: clause 6.5.10.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Threshold Crossed Notification + Check HTTP Response Status Code Is 204 + +*** Keywords *** +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body PmSubscription.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 Performance Information Available Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/PerformanceInformationAvailabilityNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} objectInstanceId=${objectInstanceIds} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST Threshold Crossed Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/ThresholdCrossedNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} thresholdId=${thresholdId} objectInstanceId=${objectInstanceIds} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + + + + + + + diff --git a/SOL009/NFVMANOPerformanceManagement-API/environment/variables.txt b/SOL009/NFVMANOPerformanceManagement-API/environment/variables.txt index 0d578a2769edb323a6ac4fef20018be45c2c8f00..877c07bfe72ea1d7e84a317f518ec1c9dc64fb2f 100644 --- a/SOL009/NFVMANOPerformanceManagement-API/environment/variables.txt +++ b/SOL009/NFVMANOPerformanceManagement-API/environment/variables.txt @@ -35,4 +35,6 @@ ${subscriptionId} 17563e75-0e14-4bd7-94b4-6bbb869c79aa ${response} -${objectInstanceIds} daca910b0-00d4f1a2b675d-604257e42 \ No newline at end of file +${objectInstanceIds} daca910b0-00d4f1a2b675d-604257e42 + +${callbackResp} 127.0.0.1 \ No newline at end of file diff --git a/SOL009/NFVMANOPerformanceManagement-API/jsons/PerformanceInformationAvailabilityNotification.json b/SOL009/NFVMANOPerformanceManagement-API/jsons/PerformanceInformationAvailabilityNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..5be4a1a38fdb5aa214d625aeb63391615fe5a7c5 --- /dev/null +++ b/SOL009/NFVMANOPerformanceManagement-API/jsons/PerformanceInformationAvailabilityNotification.json @@ -0,0 +1,14 @@ +{{ + "id": "", + "notificationType": "PerformanceInformationAvailableNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "objectType": "", + "objectInstanceId": "{objectInstanceId}", + "_links": {{ + "subscription": "" + "objectInstance": "", + "pmJob": "", + "performanceReport": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVMANOPerformanceManagement-API/jsons/ThresholdCrossedNotification.json b/SOL009/NFVMANOPerformanceManagement-API/jsons/ThresholdCrossedNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..8984e0f666ec9005f390e552b9b1446d6c68fcac --- /dev/null +++ b/SOL009/NFVMANOPerformanceManagement-API/jsons/ThresholdCrossedNotification.json @@ -0,0 +1,17 @@ +{{ + "id": "", + "notificationType": "ThresholdCrossedNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "thresholdId": "{thresholdId}", + "crossingDirection": "UP", + "objectType": "", + "objectInstanceId": "{objectInstanceId}", + "performanceMetric": "", + "performanceValue": "", + "_links": {{ + "subscription": "" + "objectInstance": "", + "threshold": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVManoConfigurationAndInformationManagement-API/ApiVersion.robot b/SOL009/NFVManoConfigurationAndInformationManagement-API/ApiVersion.robot index b9c86942f07fb90374c422033c16bb208ed0ce5d..35c1952423dce3921f24521268e0366433b385a4 100644 --- a/SOL009/NFVManoConfigurationAndInformationManagement-API/ApiVersion.robot +++ b/SOL009/NFVManoConfigurationAndInformationManagement-API/ApiVersion.robot @@ -132,70 +132,70 @@ DELETE API Version with apiMajorVerion - Method not implemented POST API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/api_version + Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/api_version + Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/api_version + Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/api_version + Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/api_version + Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Post ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Get ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Put ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Patch ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion Set Headers {"Accept":"${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} - Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_version + Delete ${apiRoot}/${apiName}/${apiMajorVersion} /api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVManoConfigurationAndInformationManagement-API/NotificationConsumer.robot b/SOL009/NFVManoConfigurationAndInformationManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..27fa560331711594ac004becaabbdd9b3ad2a692 --- /dev/null +++ b/SOL009/NFVManoConfigurationAndInformationManagement-API/NotificationConsumer.robot @@ -0,0 +1,70 @@ +*** Settings *** +Library JSONSchemaLibrary schemas/ +Resource environment/variables.txt +Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT} ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library String +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +Information Changed Notification + [Documentation] Test ID: 8.3.1.14.1 + ... Test title: Information Changed Notification + ... Test objective: The objective is to test that Information Changed Notification is delivered with success to the notification consumer + ... Pre-conditions: A subscription for information availability notification is available in the NFV-MANO. + ... Reference: clause 5.5.6.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Information Changed Notification + Check HTTP Response Status Code Is 204 + +Change State Notification + [Documentation] Test ID: 8.3.1.14.2 + ... Test title: Change State Notification + ... Test objective: The objective is to test that Change State Notification is delivered with success to the notification consumer + ... Pre-conditions: A subscription for change state notification is available in the NFV-MANO. + ... Reference: clause 5.5.6.3.1 - ETSI GS NFV-SOL 009 [6] V3.3.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Change State Notification + Check HTTP Response Status Code Is 204 + +*** Keywords *** +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body CimSubscription.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 Information Changed Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/InformationChangedNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Post Change State Notification + log Trying to perform a POST to get notification + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template} = Get File jsons/ChangeStateNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} changeStateOpOccId=${changeStateOpOccId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} diff --git a/SOL009/NFVManoConfigurationAndInformationManagement-API/environment/variables.txt b/SOL009/NFVManoConfigurationAndInformationManagement-API/environment/variables.txt index e94ee646dfb624f6b7b52d4e3691d84bc55bceb1..35efe08eff31a568ee26d18ca45758e1402b25e1 100644 --- a/SOL009/NFVManoConfigurationAndInformationManagement-API/environment/variables.txt +++ b/SOL009/NFVManoConfigurationAndInformationManagement-API/environment/variables.txt @@ -64,4 +64,6 @@ ${state} operational ${stateAction} START ${retry} 2 min -${polling} 10 sec \ No newline at end of file +${polling} 10 sec + +${callbackResp} 127.0.0.1 \ No newline at end of file diff --git a/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/ChangeStateNotification.json b/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/ChangeStateNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..c034b3bef0e7fa75f404510f82a71bb0aabab0be --- /dev/null +++ b/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/ChangeStateNotification.json @@ -0,0 +1,18 @@ +{{ + "id": "", + "notificationType": "ChangeStateNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "changeStateOpOccId": "{changeStateOpOccId}", + "stateChangedTime": "", + "changeStateOperationState": "PROCESSING", + "managedObjectRef": {{ + "type": "", + "objectId": "" + }} + "_links": {{ + "subscription": "" + "objectInstance": "", + "changeStateOpOcc": "" + }} +}} \ No newline at end of file diff --git a/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/InformationChangedNotification.json b/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/InformationChangedNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..4a1bd88e9acea19003a9b4b834d12fc2f462cfe8 --- /dev/null +++ b/SOL009/NFVManoConfigurationAndInformationManagement-API/jsons/InformationChangedNotification.json @@ -0,0 +1,12 @@ +{{ + "id": "", + "notificationType": "InformationChangedNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "informationChangedTime": "", + "manoEntityId": "", + "changedInfo": "", + "_links": {{ + "subscription": "" + }} +}} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7ec1190495ac1486e8197859602d284336cbbbf7..97f58058adf617a2659ec0a48b744f25a24cb2f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,5 @@ RESTinstance==1.0.0rc4 robotframework-dependencylibrary==1.0.0.post1 robotframework-jsonlibrary==0.3 robotframework-jsonschemalibrary==1.0 -robotframework-mockserver==0.0.4 +robotframework-mockserver==0.0.5