diff --git a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot index 1ead4aa8437108f0340d7d5792b4232a0f96c5d1..68f162712bca35b87d2f458a624e4b44bfa6b6bb 100644 --- a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot +++ b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot @@ -1,128 +1,150 @@ *** Settings *** Resource environment/variables.txt -Suite Setup Create Sessions -Suite Teardown Terminate All Processes kill=true + Library MockServerLibrary Library Process Library OperatingSystem +Library Collections + +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true *** Test Cases *** -Deliver a notification - Alarm - [Documentation] Test ID: 7.4.5.1 - ... Test title: Deliver a notification - Alarm - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL002 v2.4.1 +VNF Fault Alarm Notification + [Documentation] Test ID: 6.3.4.6.1 + ... Test title: VNF Fault Alarm Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Notification when a virtualised resource within an VNF instance fails, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM. + ... Reference: section 7.4.7.3.1 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Deliver a notification - Alarm Clearance - [Documentation] Test ID: 7.4.5.2 - ... Test title: Deliver a notification - Alarm Clearance - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL002 v2.4.1 - ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmClearedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Deliver a notification - Alarm List Rebuilt - [Documentation] Test ID: 7.4.5.3 - ... Test title: Deliver a notification - Alarm List Rebuilt - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Applicability: none + ... Post-Conditions: none + Trigger the fault of a virtualised resource in the VNF instance (external action) + Check Alarm Notification Http POST Request Body Json Schema Is alarmNotification + Check Alarm Notification Http POST Request Body notificationType attribute Is alarmNotification + +VNF Fault Alarm Cleared Notification + [Documentation] Test ID: 6.3.4.6.2 + ... Test title: VNF Fault Alarm Cleared Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Cleared Notification when a faulty virtualised resource within an VNF instance is cleared, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, a virtualised resource is in faulty state, and a subscription for fault alarm cleared notifications is available in the VNFM. + ... Reference: section 7.4.7.3.1 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmListRebuiltNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Test a notification end point - [Documentation] Test ID: 7.4.5.4 - ... Test title: Test a notification end point - ... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription - ... Pre-conditions: - ... Reference: section 7.4.5 - SOL002 v2.4.1 + ... Applicability: none + ... Post-Conditions: none + Trigger the fault cleared of a virtualised resource in the VNF instance (external action) + Check Alarm cleared Notification Http POST Request Body Json Schema Is alarmClearedNotification + Check Alarm cleared Notification Http POST Request Body notificationType attribute Is alarmClearedNotification + +VNF Fault Alarm List Rebuilt Notification + [Documentation] Test ID: 6.3.4.6.3 + ... Test title: VNF Fault Alarm List Rebuilt Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm List Rebuilt Notification when the VNFM decides to rebuild the list of its VNF alarms, e.g. due to a corruption in the alarm storage, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, one or more virtualised resource are in faulty state, and a subscription for fault alarm list rebuilt notifications is available in the VNFM. + ... Reference: section 7.4.7.3.1 - SOL002 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher GET ${callback_endpoint} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} - -PUT notification - Method not implemented - Log PUT Method not implemented - &{req}= Create Mock Request Matcher PUT ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -PATCH subscriptions - Method not implemented - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -DELETE subscriptions - Method not implemented - Log DELETE Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - + ... Applicability: none + ... Post-Conditions: none + Trigger the VNF fault alarm list rebuild in the NFVO (external action) + Check Alarm list rebuilt Notification Http POST Request Body Json Schema Is alarmListRebuiltNotification + Check Alarm list rebuilt Notification Http POST Request Body notificationType attribute Is alarmListRebuiltNotification + + *** Keywords *** +Trigger the fault of a virtualised resource in the VNF instance (external action) + #do nothing + Log do nothing + +Trigger the fault cleared of a virtualised resource in the VNF instance (external action) + #do nothing + Log do nothing + +Trigger the VNF fault alarm list rebuild in the NFVO (external action) + #do nothing + Log do nothing + +Check Alarm List Rebuilt Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm List Rebuilt Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm List Rebuilt Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm cleared Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + + +Check Alarm cleared Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Cleareance Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + + +Check Alarm Clerance Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing + + +Configure Notification Alarm List Rebuilt Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Cleareance Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} + Create Sessions Start Process java -jar ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue Create Mock Session ${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL002-7.3.4 - diff --git a/SOL002/VNFFaultManagement-API/environment/variables.txt b/SOL002/VNFFaultManagement-API/environment/variables.txt index 3f9d4e99e0ed93ddd273473ba3b59c1eaa7d1809..34213bbd9de59c9566aa1e6fde681316c5d12356 100644 --- a/SOL002/VNFFaultManagement-API/environment/variables.txt +++ b/SOL002/VNFFaultManagement-API/environment/variables.txt @@ -30,8 +30,16 @@ ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f ${callback_uri} http://localhost ${callback_port} 9091 ${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check ${callback_endpoint_error} /endpoint_404 ${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec + +${notification_request} [] +${notification_response} [] + +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar ${AlarmNotification} {} ${AlarmClearedNotification} {} diff --git a/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot b/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot index c6948aacca8fa00332503aa33061166266ac8f59..9a1955e890a64bf5a2afa6df683f8e2494a0e4e6 100644 --- a/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot +++ b/SOL002/VNFPerformanceManagementNotification-API/PerformanceManagementNotification.robot @@ -1,4 +1,5 @@ *** Setting *** +Resource environment/notifications.txt Resource environment/variables.txt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true @@ -9,108 +10,104 @@ Library BuiltIn Library Collections Library String + *** Test Cases *** -Check Notification Endpoint - &{req}= Create Mock Request Matcher GET ${callback_endpoint} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} - -Post Performance Information Available Notification - ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Performance Information Availability Notification + [Documentation] Test ID: 6.3.3.8.1 + ... Test title: VNF Performance Information Availability Notification + ... Test objective: The objective is to test the dispatch of VNF Performance Information Availability Notification when new VNF perfomance information is available in the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF performance job is created, and a subscription for information availability notifications is available in the VNFM. + ... Reference: section 6.4.9.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Trigger the availability of VNF Performance Information (external action) + Check Performance Information Available Notification Http POST Request Body Json Schema Is PerformanceInformationAvailableNotification + Check Performance Information Available Notification Http POST Request Body notificationType attribute Is PerformanceInformationAvailableNotification -Post Performance Information Available Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +VNF Threshold Crossed Notification + [Documentation] Test ID: 6.3.3.8.2 + ... Test title: VNF Threshold Crossed Notification + ... Test objective: The objective is to test the dispatch of VNF Threshold Crossed Notification when a previously set VNF perfomance metric threshold is crossed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF performance job is created, and a threshold subscription is available in the VNFM. + ... Reference: section 6.4.9.3.1 - SOL002 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Trigger the cross of VNF Performance Threshold (external action) + Check Threshold Crossed Notification Http POST Request Body Json Schema Is ThresholdCrossedNotification + Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is ThresholdCrossedNotification -Post Threshold Crossed Notification - ${json}= Get File schema/ThresholdCrossedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Threshold Crossed Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -PostThreshold Crossed Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +*** Keywords *** +Trigger the availability of VNF Performance Information (external action) + #do nothing + Log do nothing + +Trigger the cross of VNF Performance Threshold (external action) + #do nothing + Log do nothing + +Check Performance Information Available Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Performance Information Available Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Performance Information Available Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Threshold Crossed Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} -PUT Performance Notification - Log PUT Method not implemented - &{req}= Create Mock Request Matcher PUT ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} + +Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Threshold Crossed Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} -PATCH Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +Check Threshold Crossed Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing -DELETE Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +Configure Notification Performance Information Available Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Threshold Crossed Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} -*** Keywords *** Create Sessions - Start Process java -jar ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.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 Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL002/VNFPerformanceManagementNotification-API/environment/notifications.txt b/SOL002/VNFPerformanceManagementNotification-API/environment/notifications.txt new file mode 100644 index 0000000000000000000000000000000000000000..cd1193ae50b7d17b51b86c8ce7582d1fbed8db59 --- /dev/null +++ b/SOL002/VNFPerformanceManagementNotification-API/environment/notifications.txt @@ -0,0 +1,12 @@ +*** Variables *** +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec + +${notification_request} [] +${notification_response} [] \ No newline at end of file diff --git a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot index a8fe24e49450e11e6fd97da8349feb1a93a22887..ca8d40fd5fdb88ef015de49c6607b743d799403b 100644 --- a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot +++ b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot @@ -1,128 +1,150 @@ *** Settings *** Resource environment/variables.txt -Suite Setup Create Sessions -Suite Teardown Terminate All Processes kill=true + Library MockServerLibrary Library Process Library OperatingSystem +Library Collections +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true *** Test Cases *** -Deliver a notification - Alarm - [Documentation] Test ID: 7.4.5.1 - ... Test title: Deliver a notification - Alarm - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL003 v2.4.1 - ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Deliver a notification - Alarm Clearance - [Documentation] Test ID: 7.4.5.2 - ... Test title: Deliver a notification - Alarm Clearance - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL003 v2.4.1 +VNF Fault Alarm Notification + [Documentation] Test ID: 7.3.5.5.1 + ... Test title: VNF Fault Alarm Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Notification when a virtualised resource within an VNF instance fails, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM. + ... Reference: section 7.4.6.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmClearedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Deliver a notification - Alarm List Rebuilt - [Documentation] Test ID: 7.4.5.3 - ... Test title: Deliver a notification - Alarm List Rebuilt - ... Test objective: The objective is to notify a VNF alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The VNF has subscribed to the VNFM alarm - ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Applicability: none + ... Post-Conditions: none + Trigger the fault of a virtualised resource in the VNF instance (external action) + Check Alarm Notification Http POST Request Body Json Schema Is alarmNotification + Check Alarm Notification Http POST Request Body notificationType attribute Is alarmNotification + +VNF Fault Alarm Cleared Notification + [Documentation] Test ID: 7.3.5.5.2 + ... Test title: VNF Fault Alarm Cleared Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Cleared Notification when a faulty virtualised resource within an VNF instance is cleared, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, a virtualised resource is in faulty state, and a subscription for fault alarm cleared notifications is available in the VNFM. + ... Reference: section 7.4.6.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - log The POST method delivers a notification - Information of a VNF alarm. - ${json}= Get File schemas/alarmListRebuiltNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle alarmNotification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Log Verifying results - Wait Until Keyword Succeeds ${sleep_interval} Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Test a notification end point - [Documentation] Test ID: 7.4.5.4 - ... Test title: Test a notification end point - ... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription - ... Pre-conditions: - ... Reference: section 7.4.5 - SOL003 v2.4.1 + ... Applicability: none + ... Post-Conditions: none + Trigger the fault cleared of a virtualised resource in the VNF instance (external action) + Check Alarm cleared Notification Http POST Request Body Json Schema Is alarmClearedNotification + Check Alarm cleared Notification Http POST Request Body notificationType attribute Is alarmClearedNotification + +VNF Fault Alarm List Rebuilt Notification + [Documentation] Test ID: 7.3.5.5.3 + ... Test title: VNF Fault Alarm List Rebuilt Notification + ... Test objective: The objective is to test the dispatch of VNF Fault Alarm List Rebuilt Notification when the VNFM decides to rebuild the list of its VNF alarms, e.g. due to a corruption in the alarm storage, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF instance is instantiated, one or more virtualised resource are in faulty state, and a subscription for fault alarm list rebuilt notifications is available in the VNFM. + ... Reference: section 7.4.6.3.1 - SOL003 v2.4.1 ... Config ID: Config_prod_VNFM - ... Applicability: - ... Post-Conditions: - Log The GET method allows the server to test the notification endpoint - &{req}= Create Mock Request Matcher GET ${callback_endpoint} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} - -PUT notification - Method not implemented - Log PUT Method not implemented - &{req}= Create Mock Request Matcher PUT ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -PATCH subscriptions - Method not implemented - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -DELETE subscriptions - Method not implemented - Log DELETE Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - + ... Applicability: none + ... Post-Conditions: none + Trigger the VNF fault alarm list rebuild in the NFVO (external action) + Check Alarm list rebuilt Notification Http POST Request Body Json Schema Is alarmListRebuiltNotification + Check Alarm list rebuilt Notification Http POST Request Body notificationType attribute Is alarmListRebuiltNotification + + *** Keywords *** +Trigger the fault of a virtualised resource in the VNF instance (external action) + #do nothing + Log do nothing + +Trigger the fault cleared of a virtualised resource in the VNF instance (external action) + #do nothing + Log do nothing + +Trigger the VNF fault alarm list rebuild in the NFVO (external action) + #do nothing + Log do nothing + +Check Alarm List Rebuilt Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm List Rebuilt Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm List Rebuilt Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm cleared Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + + +Check Alarm cleared Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Cleareance Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + + +Check Alarm Clerance Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing + + +Configure Notification Alarm List Rebuilt Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Cleareance Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} + Create Sessions - Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance + Start Process java -jar ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue - Create Mock Session ${callback_uri}:${callback_port} + Create Mock Session ${callback_uri}:${callback_port} #The API producer is set to NFVO according to SOL002-7.3.4 diff --git a/SOL003/VNFFaultManagementNotification-API/environment/variables.txt b/SOL003/VNFFaultManagementNotification-API/environment/variables.txt index 515c4e77b8e53f4057c406eb7ac0ee36fcf1c339..3c260595f44e10b016d92ead7075287d413dfd72 100644 --- a/SOL003/VNFFaultManagementNotification-API/environment/variables.txt +++ b/SOL003/VNFFaultManagementNotification-API/environment/variables.txt @@ -1,6 +1,15 @@ *** Variables *** -${callback_endpoint} /notification + ${callback_uri} http://localhost ${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 ${sleep_interval} 20s +${total_polling_time} 2 min +${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 diff --git a/SOL003/VNFPackageManagement-API/PackageManagementNotification.robot b/SOL003/VNFPackageManagement-API/PackageManagementNotification.robot index de06540a6cca40eca2d90a886aaf1ef098ca4cfb..a16af8ccc9bb3d37bf1b01dbed8199d0207bea81 100644 --- a/SOL003/VNFPackageManagement-API/PackageManagementNotification.robot +++ b/SOL003/VNFPackageManagement-API/PackageManagementNotification.robot @@ -11,106 +11,145 @@ Library String *** Test Cases *** -Check Notification Endpoint - &{req}= Create Mock Request Matcher GET ${callback_endpoint} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Verify Mock Expectation ${req} - Clear Requests ${callback_endpoint} - -Post VNF Package Onboarding Notification - ${json}= Get File schemas/PackageOnboardingNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle VNF Package Onboarding Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Package Onboarding Notification + [Documentation] Test ID: 7.3.3.8.1 + ... Test title: VNF Package Onboarding Notification + ... Test objective: The objective is to test the dispatch of VNF Package Onboarding notification when the VNF package onboarding operation is successfully completed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF package subscription for onboarding notifications is available in the NFVO. + ... Reference: section 10.4.9.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the completion of VNF Package Onboarding (external action) + Check Onboarding Notification Http POST Request Body Json Schema Is VnfPackageOnboardingNotification + Check Onboarding Notification Http POST Request Body notificationType attribute Is VnfPackageOnboardingNotification -Post VNF Package Onboarding Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle VNF Package Onboarding Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +VNF Package Operational State Change Notification + [Documentation] Test ID: 7.3.3.8.2 + ... Test title: VNF Package Operational State Change Notification + ... Test objective: The objective is to test the dispatch of VNF Package Change notification when the VNF package operational state is modified, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF package subscription for change notifications is available in the NFVO. + ... Reference: section 10.4.9.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the change of VNF Package Operational State (external action) + Check State Change Notification Http POST Request Body Json Schema Is VnfPackageChangeNotification + Check State Change Notification Http POST Request Body notificationType attribute Is VnfPackageChangeNotification + Check State Change Notification Http POST Request Body changeType attribute Is OP_STATE_CHANGE -Post VNF Package Change Notification - ${json}= Get File schema/PackageChangeNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Package Change Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Package Deletion Notification + [Documentation] Test ID: 7.3.3.8.3 + ... Test title: VNF Package Deletion Notification + ... Test objective: The objective is to test the dispatch of VNF Package Change notification when the VNF package is deleted on the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF package subscription for change notifications is available in the NFVO. + ... Reference: section 10.4.9.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the deletion of VNF Package (external action) + Check Deletion Notification Http POST Request Body Json Schema Is VnfPackageChangeNotification + Check Deletion Notification Http POST Request Body notificationType attribute Is VnfPackageChangeNotification + Check Deletion Notification Http POST Request Body changeType attribute Is PKG_DELETE -Post Package Change Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Package Change Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - + +*** Keywords *** +Trigger the completion of VNF Package Onboarding (external action) + #do nothing + Log do nothing + +Trigger the change of VNF Package Operational State (external action) + #do nothing + Log do nothing + +Trigger the deletion of VNF Package (external action) + #do nothing + Log do nothing + +Check Onboarding Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Onboarding Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Onboarding Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check State Change Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} -PUT VNF Package Management Notification - Log PUT Method not implemented - &{req}= Create Mock Request Matcher PUT ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +Check Deletion Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check State Change Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Change Status Handler ${callback_endpoint_fwd} ${type} PKG_DELETE + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} +Check Deletion Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Change Status Handler ${callback_endpoint_fwd} ${type} OP_STATE_CHANGE + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} -PATCH VNF Package Management Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +Check State Change Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing +Check Deletion Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing -DELETE VNF Package Management Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +Configure Notification Onboarding Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Delete Handler + [Arguments] ${endpoint} ${type} ${change} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} changeType ${change} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Change Status Handler + [Arguments] ${endpoint} ${type} ${change} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} changeType ${change} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} -*** 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} + Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/environment/variables.txt b/SOL003/VNFPackageManagement-API/environment/variables.txt index 519c77a6955cc50347c44699abba4da82a2a9ec6..d74e2cc53dfca55ec370c4eacf3912a4b120b9d0 100644 --- a/SOL003/VNFPackageManagement-API/environment/variables.txt +++ b/SOL003/VNFPackageManagement-API/environment/variables.txt @@ -22,11 +22,17 @@ ${NFVO_ALLOWS_DUPLICATE_SUBS} 1 ${response} +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +${callback_uri} http://localhost ${callback_port} 9091 -${callback_uri} http://172.22.1.7:${callback_port} -${callback_endpoint} /vnfpkgm/subscriptions -${callback_endpoint_error} /subs_404 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s ${total_polling_time} 2 min ${polling_interval} 10 sec -${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar \ No newline at end of file + + +${notification_request} [] +${notification_response} [] \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json b/SOL003/VNFPackageManagement-API/schemas/VnfPackageChangeNotification.schema.json similarity index 100% rename from SOL003/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json rename to SOL003/VNFPackageManagement-API/schemas/VnfPackageChangeNotification.schema.json diff --git a/SOL003/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json b/SOL003/VNFPackageManagement-API/schemas/VnfPackageOnboardingNotification.schema.json similarity index 100% rename from SOL003/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json rename to SOL003/VNFPackageManagement-API/schemas/VnfPackageOnboardingNotification.schema.json diff --git a/SOL003/VNFPerformanceManagement-API/PerformanceManagementNotification.robot b/SOL003/VNFPerformanceManagement-API/PerformanceManagementNotification.robot index 7fc29c18581a69922fdb349c7894c6b338d28563..b5696a0fe9f07e021f70631bf030522d88ae9d9b 100644 --- a/SOL003/VNFPerformanceManagement-API/PerformanceManagementNotification.robot +++ b/SOL003/VNFPerformanceManagement-API/PerformanceManagementNotification.robot @@ -1,5 +1,8 @@ *** Setting *** +Resource environment/notifications.txt Resource environment/variables.txt +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true Library MockServerLibrary Library Process Library OperatingSystem @@ -9,99 +12,102 @@ Library String *** Test Cases *** -Post Performance Information Available Notification - ${json}= Get File schemas/PerformanceInformationAvailableNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Performance Information Availability Notification + [Documentation] Test ID: 7.3.4.8.1 + ... Test title: VNF Performance Information Availability Notification + ... Test objective: The objective is to test the dispatch of VNF Performance Information Availability Notification when new VNF perfomance information is available in the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF performance job is created, and a subscription for information availability notifications is available in the VNFM. + ... Reference: section 6.4.9.3.1 - SOL003 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Trigger the availability of VNF Performance Information (external action) + Check Performance Information Available Notification Http POST Request Body Json Schema Is PerformanceInformationAvailableNotification + Check Performance Information Available Notification Http POST Request Body notificationType attribute Is PerformanceInformationAvailableNotification -Post Performance Information Available Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Performance Information Available Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +VNF Threshold Crossed Notification + [Documentation] Test ID: 7.3.4.8.2 + ... Test title: VNF Threshold Crossed Notification + ... Test objective: The objective is to test the dispatch of VNF Threshold Crossed Notification when a previously set VNF perfomance metric threshold is crossed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A VNF performance job is created, and a threshold subscription is available in the VNFM. + ... Reference: section 6.4.9.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Trigger the cross of VNF Performance Threshold (external action) + Check Threshold Crossed Notification Http POST Request Body Json Schema Is ThresholdCrossedNotification + Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is ThresholdCrossedNotification -Post Threshold Crossed Notification - ${json}= Get File schema/ThresholdCrossedNotification.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handle Threshold Crossed Notification - &{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - -Post Threshold Crossed Notification Negative 404 - ${json}= Get File schemas/ProblemDetails.schema.json - ${BODY}= evaluate json.loads('''${json}''') json - Log Creating mock request and response to handleThreshold Crossed Notification to handle 404 error - &{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY} - &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +*** Keywords *** +Trigger the availability of VNF Performance Information (external action) + #do nothing + Log do nothing + +Trigger the cross of VNF Performance Threshold (external action) + #do nothing + Log do nothing + +Check Performance Information Available Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Performance Information Available Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Performance Information Available Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Threshold Crossed Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} -PUT Performance Notification - Log PUT Method not implemented - &{req}= Create Mock Request Matcher PUT ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} + +Check Threshold Crossed Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Threshold Crossed Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} -PATCH Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher PATCH ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +Check Threshold Crossed Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing -DELETE Performance Notification - Log PATCH Method not implemented - &{req}= Create Mock Request Matcher DELETE ${callback_endpoint} - &{rsp}= Create Mock Response status_code=405 - Create Mock Expectation ${req} ${rsp} - Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +Configure Notification Performance Information Available Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Threshold Crossed Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} -*** Keywords *** Create Sessions - 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 Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL003/VNFPerformanceManagement-API/environment/notifications.txt b/SOL003/VNFPerformanceManagement-API/environment/notifications.txt new file mode 100644 index 0000000000000000000000000000000000000000..cd1193ae50b7d17b51b86c8ce7582d1fbed8db59 --- /dev/null +++ b/SOL003/VNFPerformanceManagement-API/environment/notifications.txt @@ -0,0 +1,12 @@ +*** Variables *** +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec + +${notification_request} [] +${notification_response} [] \ No newline at end of file diff --git a/SOL005/NSFaultManagement-API/NotificationEndpoint.robot b/SOL005/NSFaultManagement-API/NotificationEndpoint.robot index 521e22032f4b542da5d6daa271185dd8ac3f8048..392a9701a592efdae8b7e24013758977f69ec5ee 100644 --- a/SOL005/NSFaultManagement-API/NotificationEndpoint.robot +++ b/SOL005/NSFaultManagement-API/NotificationEndpoint.robot @@ -1,97 +1,146 @@ *** Settings *** Resource environment/variables.txt Resource NSFMOperationKeywords.robot -Suite Teardown Terminate All Processes kill=true + Library MockServerLibrary Library Process Library OperatingSystem +Library Collections + Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true *** Test Cases *** -Deliver a notification - Alarm - [Documentation] Test ID: 8.4.6.2-1 - ... Test title: Deliver a notification - Alarm - ... Test objective: The objective is to notify a NFVO alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The NFVO has subscribed to the NSFM alarm - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do POST Alarm Notification Endpoint - Check Alarm notification Endpoint has been delivered - Clean Endpoint - -Deliver a notification - Alarm Clearance - [Documentation] Test ID: 8.4.6.2-2 - ... Test title: Deliver a notification - Alarm Clearance - ... Test objective: The objective is to notify a NFVO alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The NFVO has subscribed to the NSFM alarm - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do POST Alarm Clearance Notification Endpoint - Check Alarm notification Endpoint has been delivered - Clean Endpoint - -Deliver a notification - Alarm List Rebuilt - [Documentation] Test ID: 8.4.6.2-3 - ... Test title: Deliver a notification - Alarm List Rebuilt - ... Test objective: The objective is to notify a NFVO alarm or that the alarm list has been rebuilt. - ... Pre-conditions: The NFVO has subscribed to the NSFM alarm - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do POST Alarm List Rebuilt Notification Endpoint - Check Alarm notification Endpoint has been delivered - Clean Endpoint - -Test a notification end point - [Documentation] Test ID: 8.4.6.3 - ... Test title: Test a notification end point - ... Test objective: The objective is to allow the server to test the notification endpoint that is provided by the client, e.g. during subscription - ... Pre-conditions: - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do GET Notification Endpoint - Check Alarm notification Endpoint has been delivered - Clean Endpoint +NS Fault Alarm Notification + [Documentation] Test ID: 5.3.3.5.1 + ... Test title: NS Fault Alarm Notification + ... Test objective: The objective is to test the dispatch of NS Fault Alarm Notification when a virtualised resource within an NS instance fails, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NS instance is instantiated, and a subscription for fault alarm notifications is available in the NFVO. + ... Reference: section 8.4.6.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the fault of a virtualised resource in the NS instance (external action) + Check Alarm Notification Http POST Request Body Json Schema Is alarmNotification + Check Alarm Notification Http POST Request Body notificationType attribute Is alarmNotification + +NS Fault Alarm Cleared Notification + [Documentation] Test ID: 5.3.3.5.2 + ... Test title: NS Fault Alarm Cleared Notification + ... Test objective: The objective is to test the dispatch of NS Fault Alarm Cleared Notification when a faulty virtualised resource within an NS instance is cleared, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NS instance is instantiated, a virtualised resource is in faulty state, and a subscription for fault alarm cleared notifications is available in the NFVO. + ... Reference: section 8.4.6.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the fault cleared of a virtualised resource in the NS instance (external action) + Check Alarm cleared Notification Http POST Request Body Json Schema Is alarmClearedNotification + Check Alarm cleared Notification Http POST Request Body notificationType attribute Is alarmClearedNotification + +NS Fault Alarm List Rebuilt Notification + [Documentation] Test ID: 5.3.3.5.3 + ... Test title: NS Fault Alarm List Rebuilt Notification + ... Test objective: The objective is to test the dispatch of NS Fault Alarm List Rebuilt Notification when the NFVO decides to rebuild the list of its NS alarms, e.g. due to a corruption in the alarm storage, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NS instance is instantiated, one or more virtualised resource are in faulty state, and a subscription for fault alarm list rebuilt notifications is available in the NFVO. + ... Reference: section 8.4.6.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the NS fault alarm list rebuild in the NFVO (external action) + Check Alarm list rebuilt Notification Http POST Request Body Json Schema Is alarmListRebuiltNotification + Check Alarm list rebuilt Notification Http POST Request Body notificationType attribute Is alarmListRebuiltNotification + + +*** Keywords *** +Trigger the fault of a virtualised resource in the NS instance (external action) + #do nothing + Log do nothing + +Trigger the fault cleared of a virtualised resource in the NS instance (external action) + #do nothing + Log do nothing + +Trigger the NS fault alarm list rebuild in the NFVO (external action) + #do nothing + Log do nothing + +Check Alarm List Rebuilt Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm List Rebuilt Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm List Rebuilt Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Alarm Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + +Check Alarm cleared Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + + +Check Alarm cleared Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification Alarm Cleareance Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + -PUT notification - Method not implemented - [Documentation] Test ID: 8.4.6.4 - ... Test title: PUT notification - Method not implemented - ... Test objective: The objective is to PUT a notification endpoint. The method should not be implemented - ... Pre-conditions: - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do PUT Notification - Clean Endpoint - -PATCH notification - Method not implemented - [Documentation] Test ID: 8.4.6.5 - ... Test title: PATCH notification - Method not implemented - ... Test objective: The objective is to PATCH a notification endpoint. The method should not be implemented - ... Pre-conditions: - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do PATCH Notification - Clean Endpoint +Check Alarm Clerance Notification Http POST Request Body changeType attribute Is + [Arguments] ${type} + #do nothing + Log do nothing -DELETE notification - Method not implemented - [Documentation] Test ID: 8.4.6.6 - ... Test title: DELETE notification - Method not implemented - ... Test objective: The objective is to DELETE a notification endpoint. The method should not be implemented - ... Pre-conditions: - ... Reference: section 8.4.6 - SOL005 v2.4.1 - ... Config ID: - ... Applicability: - ... Post-Conditions: - Do DELETE Notification - Clean Endpoint \ No newline at end of file + +Configure Notification Alarm List Rebuilt Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Alarm Cleareance Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index a631e5d283ce0c6679f01cd9d8669e2c970a4232..748cfcfa62b004c40e86b2bb95ef918e90d175f1 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -28,12 +28,6 @@ ${sub_filter_invalid} filter_invalid ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f -${callback_uri} http://localhost -${callback_port} 9091 -${callback_endpoint} /endpoint -${callback_endpoint_error} /endpoint_404 -${sleep_interval} 20s - ${AlarmNotification} {} ${AlarmClearedNotification} {} ${AlarmListRebuiltNotification} {} @@ -43,4 +37,14 @@ ${response} {} ${req_mock} {} ${resp_mock} {} +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec +${notification_request} [] +${notification_response} []