From: aguilarherna Date: Wed, 19 May 2021 14:36:41 +0000 (+0000) Subject: Fix bug 1536: incorrect check SDNC status in EPA03 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F10889%2F1;p=osm%2Ftests.git Fix bug 1536: incorrect check SDNC status in EPA03 Modified the way to check the successful creation of SDNC in 'Check for SDNC' keyword. Corrected check on metric (should be 1) in 'Check If SDNC Is Available' keyword. Change-Id: I7f23dc9033caec8ac6ab3d00be577912a1bfa0fa Signed-off-by: aguilarherna --- diff --git a/robot-systest/lib/sdnc_lib.robot b/robot-systest/lib/sdnc_lib.robot index 13cb6dc..6c16b43 100644 --- a/robot-systest/lib/sdnc_lib.robot +++ b/robot-systest/lib/sdnc_lib.robot @@ -61,6 +61,7 @@ Delete SDNC ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm sdnc-delete ${sdnc_name} log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for SDNC To Be Deleted ${sdnc_name} @@ -71,16 +72,16 @@ Get SDNC List Check for SDNC - [Arguments] ${sdnc_name} + [Arguments] ${sdnc_id} - ${rc} ${stdout}= Run and Return RC and Output osm sdnc-list | awk '{print $2}' | grep ${sdnc_name} - Should Be Equal As Strings ${stdout} ${sdnc_name} + ${rc} ${stdout}= Run and Return RC and Output osm sdnc-show ${sdnc_id} | grep -io ENABLED + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} Check for SDNC Status - [Arguments] ${sdnc_name} ${prometheus_host} ${prometheus_port} + [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} - ${sdnc_id}= Get SDNC ID ${sdnc_name} Wait Until Keyword Succeeds ${sdnc_status_max_wait_time} ${sdnc_status_pol_time} Check If SDNC Is Available ${sdnc_id} ${prometheus_host} ${prometheus_port} @@ -97,4 +98,4 @@ Check If SDNC Is Available [Arguments] ${sdnc_id} ${prometheus_host} ${prometheus_port} ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_sdnc_status sdnc_id=${sdnc_id} - Should Be Equal As Integers ${metric} 0 msg=SDNC '${sdnc_id}' is not active values=false + Should Be Equal As Integers ${metric} 1 msg=SDNC '${sdnc_id}' is not active values=false diff --git a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py index 827baf6..029cb2b 100644 --- a/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py +++ b/robot-systest/resources/epa_03-crud_operations_on_sdnc_data.py @@ -23,7 +23,7 @@ from common_helpers import get_prometheus_info # SDNC Configuration -sdnc_name = "epa_03_crud_operations_on_sdnc_test" +sdnc_name = "epa_03" sdnc_user = os.environ.get("SDNC_USER") if not sdnc_user: raise Exception("'SDNC_USER' environment variable not found") diff --git a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot index 335d619..38816c1 100644 --- a/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot +++ b/robot-systest/testsuite/epa_03-crud_operations_on_sdnc.robot @@ -20,18 +20,24 @@ Variables %{ROBOT_DEVOPS_FOLDER}/resources/epa_03-crud_operations_on_sdnc_data Suite Teardown Run Keyword And Ignore Error Delete Basic SDNC +*** Variables *** +${sdnc_enabled_max_wait_time} 1min +${sdnc_enabled_pol_time} 10 + + *** Test Cases *** Create Basic SDNC [Tags] sdnc_crud sanity regression ${created_sdnc_id}= Create SDNC ${sdnc_name} ${sdnc_user} ${sdnc_password} ${sdnc_url} ${sdnc_type} - Check for SDNC ${sdnc_name} + Set Suite Variable ${sdnc_id} ${created_sdnc_id} + Wait Until Keyword Succeeds ${sdnc_enabled_max_wait_time} ${sdnc_enabled_pol_time} Check for SDNC ${sdnc_id} Check SDNC Status Is Healthy [Tags] sdnc_crud sanity regression - Check for SDNC Status ${sdnc_name} ${prometheus_host} ${prometheus_port} + Check for SDNC Status ${sdnc_id} ${prometheus_host} ${prometheus_port} Delete Basic SDNC