diff --git a/SOL005/NSDManagement-API/NSDManagementNotification.robot b/SOL005/NSDManagement-API/NSDManagementNotification.robot index b978a187cc095066b3902fcdbdeb40b5de0d5944..9b01a0062cdbd3937a6b69ed8a766f79f9695004 100644 --- a/SOL005/NSDManagement-API/NSDManagementNotification.robot +++ b/SOL005/NSDManagement-API/NSDManagementNotification.robot @@ -11,6 +11,290 @@ Library String *** Test Cases *** +NSD Onboarding Notification + [Documentation] Test ID: 5.3.1.9.1 + ... Test title: NSD Onboarding Notification + ... Test objective: The objective is to test the dispatch of NSD Onboarding notification when the NSD onboarding operation is successfully completed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NSD management subscription for onboarding notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the completion of NSD Onboarding (external action) + Check NSD Onboarding Notification Http Request Body Json Schema Is NsdOnboardingNotification + Check NSD Onboarding Notification Http Request Body notificationType attribute Is NsdOnboardingNotification + +NSD Onboarding Failure Notification + [Documentation] Test ID: 5.3.1.9.2 + ... Test title: NSD Onboarding Failure Notification + ... Test objective: The objective is to test the dispatch of NSD Onboarding faulure notification when the NSD onboarding operation fails, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NSD management subscription for onboarding failure notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the failure of NSD Onboarding (external action) + Check NSD Onboarding Failure Notification Http Request Body Json Schema Is NsdOnboardingFailureNotification + Check NSD Onboarding Failure Notification Http Request Body notificationType attribute Is NsdOnboardingFailureNotification + +NSD Operational State Change Notification + [Documentation] Test ID: 5.3.1.9.3 + ... Test title: NSD Operational State Change Notification + ... Test objective: The objective is to test the dispatch of NSD Operational State Change notification when the NSD operational status change in the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NSD management subscription for operational state change notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the cross of NSD Operational State Change (external action) + Check NSD Operational State Change Notification Http Request Body Json Schema Is NsdChangeNotification + Check NSD Operational State Change Notification Http Request Body notificationType attribute Is NsdChangeNotification + +NSD Deletion Notification + [Documentation] Test ID: 5.3.1.9.4 + ... Test title: NSD Deletion Notification + ... Test objective: The objective is to test the dispatch of NSD Deletion notification when the NSD is deleted from the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NSD management subscription for deletion notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the deletion of NSD (external action) + Check NSD Deletion Notification Http Request Body Json Schema Is NsdDeletionNotification + Check NSD Deletion Notification Http Request Body notificationType attribute Is NsdDeletionNotification + +PNFD Onboarding Notification + [Documentation] Test ID: 5.3.1.9.5 + ... Test title: PNFD Onboarding Notification + ... Test objective: The objective is to test the dispatch of PNFD Onboarding notification when the PNFD onboarding operation is successfully completed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A PNFD management subscription for onboarding notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the completion of PNFD Onboarding (external action) + Check PNFD Onboarding Notification Http Request Body Json Schema Is PnfdOnboardingNotification + Check PNFD Onboarding Notification Http Request Body notificationType attribute Is PnfdOnboardingNotification + +PNFD Onboarding Failure Notification + [Documentation] Test ID: 5.3.1.9.6 + ... Test title: PNFD Onboarding Failure Notification + ... Test objective: The objective is to test the dispatch of PNFD Onboarding faulure notification when the PNFD onboarding operation fails, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A PNFD management subscription for onboarding failure notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the failure of PNFD Onboarding (external action) + Check PNFD Onboarding Failure Notification Http Request Body Json Schema Is PnfdOnboardingFailureNotification + Check PNFD Onboarding Failure Notification Http Request Body notificationType attribute Is PndfOnboardingFailureNotification + +PNFD Deletion Notification + [Documentation] Test ID: 5.3.1.9.7 + ... Test title: PNFD Deletion Notification + ... Test objective: The objective is to test the dispatch of PNFD Deletion notification when the PNFD is deleted from the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A PNFD management subscription for deletion notifications is available in the NFVO. + ... Reference: section 5.4.10.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the deletion of PNFD (external action) + Check PNFD Deletion Notification Http Request Body Json Schema Is PnfdDeletionNotification + Check PNFD Deletion Notification Http Request Body notificationType attribute Is PnfdDeletionNotification + + +*** Keywords *** +Trigger the completion of NSD Onboarding (external action) + #do nothing + Log do nothing + +Trigger the failure of NSD Onboarding (external action) + #do nothing + Log do nothing + +Trigger the cross of NSD Operational State Change (external action) + #do nothing + Log do nothing + +Trigger the deletion of NSD (external action) + #do nothing + Log do nothing + +Trigger the completion of PNFD Onboarding (external action) + #do nothing + Log do nothing + +Trigger the failure of PNFD Onboarding (external action) + #do nothing + Log do nothing + +Trigger the deletion of PNFD (external action) + #do nothing + Log do nothing + +Check PNFD Onboarding Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check PNFD Onboarding Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure PNFD 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 PNFD Onboarding Failure Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check PNFD Onboarding Failure Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification PNFD Onboarding Failure 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 PNFD Deletion Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check PNFD Deletion Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure PNFD Deletion 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 NSD Onboarding Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check NSD Onboarding Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure NSD 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 NSD Onboarding Failure Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + + +Check NSD Onboarding Failure Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure Notification NSD Onboarding Failure 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 NSD Operational State Change Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check NSD Operational State Change Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure NSD Operational State Change 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 NSD Deletion Notification Http Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check NSD Deletion Notification Http Request Body notificationType attribute Is + [Arguments] ${type} + Configure NSD Deletion 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} + +Configure PNFD Deletion 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 NSD Deletion 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 NSD Operational State Change 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 PNFD 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 PNFD Onboarding Failure 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 NSD 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 NSD Onboarding Failure 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 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} + + Check Notification Endpoint &{req}= Create Mock Request Matcher GET ${callback_endpoint} &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index d55b443ef52d72142bfa6cd11ccc98da05f12692..9f9d5956c6cffa1e8a2c3a69786c08f568e96493 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -20,6 +20,14 @@ ${callback_port} 9091 ${callback_uri} http://172.22.1.7:${callback_port} ${callback_endpoint} /nsd/subscriptions ${callback_endpoint_error} /subs_404 +${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} [] ${testOptionalMethods} 0 @@ -28,4 +36,4 @@ ${NFVO_CHECKS_NOTIF_ENDPOINT} 1 ## If true, during subscription, the F ${NFVO_ALLOWS_DUPLICATE_SUBS} 1 ${total_polling_time} 2 min ${polling_interval} 10 sec -${response} \ No newline at end of file +${response} diff --git a/SOL005/NSDManagement-API/schemas/PNFDOnboardingFailureNotification.schema.json b/SOL005/NSDManagement-API/schemas/PnfdOnboardingFailureNotification.schema.json similarity index 100% rename from SOL005/NSDManagement-API/schemas/PNFDOnboardingFailureNotification.schema.json rename to SOL005/NSDManagement-API/schemas/PnfdOnboardingFailureNotification.schema.json diff --git a/SOL005/NSDManagement-API/schemas/PNFDOnboardingNotification.schema.json b/SOL005/NSDManagement-API/schemas/PnfdOnboardingNotification.schema.json similarity index 100% rename from SOL005/NSDManagement-API/schemas/PNFDOnboardingNotification.schema.json rename to SOL005/NSDManagement-API/schemas/PnfdOnboardingNotification.schema.json diff --git a/SOL005/NSPerformanceManagement-API/Notifications.robot b/SOL005/NSPerformanceManagement-API/Notifications.robot index 8fe01e3a6eda197faad4786f3ccbb5832ca96014..28386c330696ef3dde7e509df130a5cd5f5a6633 100644 --- a/SOL005/NSPerformanceManagement-API/Notifications.robot +++ b/SOL005/NSPerformanceManagement-API/Notifications.robot @@ -12,109 +12,101 @@ 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} - +NS Performance Information Availability Notification + [Documentation] Test ID: 5.3.4.8.1 + ... Test title: NS Performance Information Availability Notification + ... Test objective: The objective is to test the dispatch of NS Performance Information Availability Notification when new NS perfomance information is available in the NFVO, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NS performance job is created, and a subscription for information availability notifications is available in the NFVO. + ... Reference: section 7.4.9.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the availability of NS 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} +NS Threshold Crossed Notification + [Documentation] Test ID: 5.3.4.8.2 + ... Test title: NS Threshold Crossed Notification + ... Test objective: The objective is to test the dispatch of NS Threshold Crossed Notification when a previously set NS perfomance metric threshold is crossed, and perform a JSON schema and content validation of the delivered notification + ... Pre-conditions: A NS performance job is created, and a threshold subscription is available in the NFVO. + ... Reference: section 7.4.9.3.1 - SOL005 v2.4.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + Trigger the cross of NS 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} - -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} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +*** Keywords *** +Trigger the availability of NS Performance Information (external action) + #do nothing + Log do nothing + +Trigger the cross of NS 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue diff --git a/SOL005/NSPerformanceManagement-API/environment/notifications.txt b/SOL005/NSPerformanceManagement-API/environment/notifications.txt index 12a19817c09edfcaefe04a105a62e1a95995bd3a..cd1193ae50b7d17b51b86c8ce7582d1fbed8db59 100644 --- a/SOL005/NSPerformanceManagement-API/environment/notifications.txt +++ b/SOL005/NSPerformanceManagement-API/environment/notifications.txt @@ -2,5 +2,11 @@ ${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/VNFPackageManagement-API/Notifications.robot b/SOL005/VNFPackageManagement-API/Notifications.robot index 6a2d01326ab792ceed58c426e3111a69dd67f22e..98b8b79651c762257cb329c1ae7fa361eeedcbfd 100644 --- a/SOL005/VNFPackageManagement-API/Notifications.robot +++ b/SOL005/VNFPackageManagement-API/Notifications.robot @@ -11,108 +11,144 @@ 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 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} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Package Onboarding Notification + [Documentation] Test ID: 5.3.5.9.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 9.4.10.3.1 - SOL005 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} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} +VNF Package Operational State Change Notification + [Documentation] Test ID: 5.3.5.9.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 9.4.10.3.1 - SOL005 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} - Sleep ${sleep_interval} - Log Verifying results - Verify Mock Expectation ${req} - Log Cleaning the endpoint - Clear Requests ${callback_endpoint} - +VNF Package Deletion Notification + [Documentation] Test ID: 5.3.5.9.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 9.4.10.3.1 - SOL005 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} - Sleep ${sleep_interval} - 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 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 - Pass Execution If ${testOptionalMethods} == 0 optional methods are not implemented on the FUT. Skipping test. - 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 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 diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt index 926291098db64c9abd3595dc64243fea40c2cfe4..80469cdfead4dc91b9668e91d26b19968ed0f798 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -23,6 +23,7 @@ ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies. ${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 @@ -31,3 +32,6 @@ ${polling_interval} 10 sec ${NFVO_CHECKS_NOTIF_ENDPOINT} 1 ${response} + +${notification_request} [] +${notification_response} [] diff --git a/SOL005/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json b/SOL005/VNFPackageManagement-API/schemas/VnfPackageChangeNotification.schema.json similarity index 100% rename from SOL005/VNFPackageManagement-API/schemas/PackageChangeNotification.schema.json rename to SOL005/VNFPackageManagement-API/schemas/VnfPackageChangeNotification.schema.json diff --git a/SOL005/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json b/SOL005/VNFPackageManagement-API/schemas/VnfPackageOnboardingNotification.schema.json similarity index 100% rename from SOL005/VNFPackageManagement-API/schemas/PackageOnboardingNotification.schema.json rename to SOL005/VNFPackageManagement-API/schemas/VnfPackageOnboardingNotification.schema.json