From 065c26254660c855188163d7296dfe0d1e161a91 Mon Sep 17 00:00:00 2001 From: Irina Date: Tue, 30 Jun 2020 14:47:37 +0300 Subject: [PATCH] RIC-547 - E2M publish SDL event - Automation Change-Id: Id05cbd972bbcc75c7d4e136cf1ed182545c3bf0a Signed-off-by: Irina --- .../Lost_Connection/LostConnectionTestConnectedRan.robot | 15 ++++++++++----- Automation/Tests/RedButton/RedButton_CONNECTED.robot | 9 +++++++++ .../RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot | 10 ++++++++++ .../Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot | 12 +++++++++++- Automation/Tests/Resource/scripts_variables.robot | 3 ++- E2Manager/services/rnib_data_service.go | 2 +- 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/Automation/Tests/Lost_Connection/LostConnectionTestConnectedRan.robot b/Automation/Tests/Lost_Connection/LostConnectionTestConnectedRan.robot index f172c5b..e19efed 100644 --- a/Automation/Tests/Lost_Connection/LostConnectionTestConnectedRan.robot +++ b/Automation/Tests/Lost_Connection/LostConnectionTestConnectedRan.robot @@ -23,6 +23,8 @@ Suite Setup Prepare Enviorment Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot +Resource ../Resource/scripts_variables.robot +Library ../Scripts/find_error_script.py Library ../Scripts/e2mdbscripts.py Library OperatingSystem Library Collections @@ -31,11 +33,6 @@ Library REST ${url} *** Test Cases *** -prepare logs for tests - Remove log files - Save logs - - Setup Ran and verify it's CONNECTED and associated Get Request node b gnb Integer response status 200 @@ -54,6 +51,14 @@ Verify connection status is DISCONNECTED and RAN is not associated with E2T inst Missing response body associatedE2tInstanceAddress String response body connectionStatus DISCONNECTED +prepare logs for tests + Remove log files + Save logs + Verify E2T instance is NOT associated with RAN ${result} e2mdbscripts.verify_ran_is_associated_with_e2t_instance ${ranname} ${e2tinstanceaddress} Should Be True ${result} == False + +Verify e2mgr logs - Set and Publish Disconnect True + ${result} find_error_script.find_error ${EXECDIR} ${e2mgr_log_filename} ${set_and_publish_disconnect} + Should Be Equal As Strings ${result} True \ No newline at end of file diff --git a/Automation/Tests/RedButton/RedButton_CONNECTED.robot b/Automation/Tests/RedButton/RedButton_CONNECTED.robot index dffc874..1dd345c 100644 --- a/Automation/Tests/RedButton/RedButton_CONNECTED.robot +++ b/Automation/Tests/RedButton/RedButton_CONNECTED.robot @@ -24,7 +24,9 @@ Suite Setup Prepare Enviorment Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot +Resource ../Resource/scripts_variables.robot Resource red_button_keywords.robot +Library ../Scripts/find_error_script.py Library OperatingSystem Library Collections Library REST ${url} @@ -38,9 +40,16 @@ Verify gnb nodeb connection status is CONNECTED and it's associated to an e2t in Execute Shutdown Execute Shutdown +prepare logs for tests + Remove log files + Save logs + Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance Verify shutdown for gnb Verify E2T instance has no associated RANs Verify E2T instance has no associated RANs +Verify e2mgr logs - Set and Publish Disconnect + ${result} find_error_script.find_error ${EXECDIR} ${e2mgr_log_filename} ${set_and_publish_disconnect} + Should Be Equal As Strings ${result} True \ No newline at end of file diff --git a/Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot b/Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot index d20a1fa..4637808 100644 --- a/Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot +++ b/Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot @@ -25,6 +25,8 @@ Suite Setup Prepare Enviorment Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Resource red_button_keywords.robot +Resource ../Resource/scripts_variables.robot +Library ../Scripts/find_error_script.py Library OperatingSystem Library Collections Library REST ${url} @@ -37,6 +39,14 @@ Verify gnb nodeb connection status is CONNECTED and it's associated to an e2t in Execute Shutdown Execute Shutdown +prepare logs for tests + Remove log files + Save logs + +Verify e2mgr logs - Set and Publish Disconnect + ${result} find_error_script.find_error ${EXECDIR} ${e2mgr_log_filename} ${set_and_publish_disconnect} + Should Be Equal As Strings ${result} True + Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance Verify shutdown for gnb Verify E2T instance has no associated RANs diff --git a/Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot b/Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot index 7cdf0a6..9561973 100644 --- a/Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot +++ b/Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot @@ -25,24 +25,34 @@ Suite Setup Prepare Enviorment Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Resource red_button_keywords.robot +Resource ../Resource/scripts_variables.robot +Library ../Scripts/find_error_script.py Library OperatingSystem Library Collections Library REST ${url} *** Test Cases *** + Verify nodeb connection status is CONNECTED and it's associated to an e2t instance Verify connected and associated Execute Shutdown Execute Shutdown +prepare logs for tests + Remove log files + Save logs + +Verify e2mgr logs - Set and Publish Disconnect True + ${result} find_error_script.find_error ${EXECDIR} ${e2mgr_log_filename} ${set_and_publish_disconnect} + Should Be Equal As Strings ${result} True + Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance Verify shutdown for gnb Verify E2T instance has no associated RANs Verify E2T instance has no associated RANs - Execute second Shutdown Execute Shutdown diff --git a/Automation/Tests/Resource/scripts_variables.robot b/Automation/Tests/Resource/scripts_variables.robot index 13b044a..5ddb394 100644 --- a/Automation/Tests/Resource/scripts_variables.robot +++ b/Automation/Tests/Resource/scripts_variables.robot @@ -32,4 +32,5 @@ ${first_retry_to_retrieve_from_db} RnibDataService.retry - retrying 1 GetNo ${third_retry_to_retrieve_from_db} RnibDataService.retry - after 3 attempts of GetNodeb ${RIC_RES_STATUS_REQ_message_type_successfully_sent} Message type: 10090 - Successfully sent RMR message ${E2_TERM_KEEP_ALIVE_REQ_message_type_successfully_sent} Message type: 1101 - Successfully sent RMR message -${save_general_configuration} SetGeneralConfigurationHandler.Handle - save general configuration to rnib: {EnableRic:false} \ No newline at end of file +${save_general_configuration} SetGeneralConfigurationHandler.Handle - save general configuration to rnib: {EnableRic:false} +${set_and_publish_disconnect} RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - stateChangeMessageChannel: RAN_CONNECTION_STATUS_CHANGE, event: gnb_208_092_303030_DISCONNECTED \ No newline at end of file diff --git a/E2Manager/services/rnib_data_service.go b/E2Manager/services/rnib_data_service.go index e96ba48..5e3df8d 100644 --- a/E2Manager/services/rnib_data_service.go +++ b/E2Manager/services/rnib_data_service.go @@ -304,7 +304,7 @@ func (w *rNibDataService) PingRnib() bool { } func (w *rNibDataService) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error { - w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - nodebInfo: %s", nodebInfo) + w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - stateChangeMessageChannel: %s, event: %s, nodebInfo: %s", w.stateChangeMessageChannel, event, nodebInfo) err := w.retry("UpdateNodebInfoOnConnectionStatusInversion", func() (err error) { err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, w.stateChangeMessageChannel, event) -- 2.16.6