Migrate check system status to clustermanagement 66/73966/7
authorSathwik Boggarapu <b.sathwik@ericsson.com>
Thu, 12 Jul 2018 06:59:54 +0000 (12:29 +0530)
committerSam Hague <shague@redhat.com>
Fri, 13 Jul 2018 13:48:11 +0000 (13:48 +0000)
1) Migrating keyword genius.check system status to
clustermanagement.robot.
2)changed usage of it in genius.robot and coe.robot

Change-Id: Ic1056b08497b9cec316b33c176b27b126e79cfb8
Signed-off-by: Sathwik Boggarapu <b.sathwik@ericsson.com>
csit/libraries/ClusterManagement.robot
csit/libraries/Coe.robot
csit/libraries/Genius.robot
csit/suites/genius/ITM_Direct_Tunnels.robot

index b2e0a8736116d78170099c8a4a6fc439a57759af..89d2f3371115e28b37f7f0a95058f4882226805e 100644 (file)
@@ -846,3 +846,18 @@ Return_Member_IP
     ${member_int} =    BuiltIn.Convert_To_Integer    ${member_index}
     ${member_ip} =    Collections.Get_From_Dictionary    dictionary=${ClusterManagement__index_to_ip_mapping}    key=${member_int}
     [Return]    ${member_ip}
+
+Check Service Status
+    [Arguments]    ${odl_ip}    ${system_ready_state}    ${service_state}    @{service_list}
+    [Documentation]    Issues the karaf shell command showSvcStatus to verify the ready and service states are the same as the arguments passed
+    ${service_status_output} =    BuiltIn.Run Keyword If    ${NUM_ODL_SYSTEM} > 1    KarafKeywords.Issue_Command_On_Karaf_Console    showSvcStatus -n ${odl_ip}    ${odl_ip}    ${KARAF_SHELL_PORT}
+    ...    ELSE    KarafKeywords.Issue_Command_On_Karaf_Console    showSvcStatus    ${odl_ip}    ${KARAF_SHELL_PORT}
+    BuiltIn.Should Contain    ${service_status_output}    ${system_ready_state}
+    : FOR    ${service}    IN    @{service_list}
+    \    BuiltIn.Should Match Regexp    ${service_status_output}    ${service} +: ${service_state}
+
+Check Status of Services
+    [Arguments]    @{service_list}
+    [Documentation]    This keyword will verify whether all the services are operational in all the ODL nodes
+    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
+    \    ClusterManagement.Check Service Status    ${ODL_SYSTEM_${i+1}_IP}    ACTIVE    OPERATIONAL    @{service_list}
index 373cbb877b1e6a8c96b75383431c1f476ae0b65c..1304a2bfbe0c7ec716c85f036e1190bb6c0f3e17 100644 (file)
@@ -37,7 +37,7 @@ Start Suite
     Coe.Verify Watcher Is Running
     BuiltIn.Wait Until Keyword Succeeds    40s    2s    Coe.Check Node Status Is Ready
     Coe.Label Nodes
-    BuiltIn.Wait Until Keyword Succeeds    60    2    Genius.Check System Status    @{COE_DIAG_SERVICES}
+    BuiltIn.Wait Until Keyword Succeeds    60    2    ClusterManagement.Check Status of Services    @{COE_DIAG_SERVICES}
     Genius.Verify Tunnel Status as UP    default-transport-zone
     Coe.Derive Coe Data Models
 
index b8e9991f4238f5b7b76c58a1670d184feba4b632..4b1f597056649ea6b179dfddad376ff89397c8c1 100644 (file)
@@ -2,17 +2,18 @@
 Documentation     This suite is a common keywords file for genius project.
 Library           Collections
 Library           OperatingSystem
+Library           re
 Library           RequestsLibrary
 Library           SSHLibrary
-Library           re
 Library           string
+Resource          ClusterManagement.robot
+Resource          DataModels.robot
 Resource          KarafKeywords.robot
+Resource          OVSDB.robot
 Resource          Utils.robot
+Resource          VpnOperations.robot
 Resource          ../variables/Variables.robot
-Resource          OVSDB.robot
 Resource          ../variables/netvirt/Variables.robot
-Resource          VpnOperations.robot
-Resource          DataModels.robot
 
 *** Variables ***
 @{itm_created}    TZA
@@ -37,7 +38,7 @@ Genius Suite Teardown
 
 Start Suite
     [Documentation]    Initial setup for Genius test suites
-    Run_Keyword_If_At_Least_Oxygen    Wait Until Keyword Succeeds    60    2    Check System Status    @{GENIUS_DIAG_SERVICES}
+    Run_Keyword_If_At_Least_Oxygen    Wait Until Keyword Succeeds    60    2    ClusterManagement.Check Status of Services    @{GENIUS_DIAG_SERVICES}
     Log    Start the tests
     ${conn_id_1}=    Open Connection    ${TOOLS_SYSTEM_IP}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=30s
     Set Global Variable    ${conn_id_1}
@@ -94,15 +95,6 @@ check establishment
     Should contain    ${check_establishment}    ESTABLISHED
     [Return]    ${check_establishment}
 
-Check Service Status
-    [Arguments]    ${odl_ip}    ${system_ready_state}    ${service_state}    @{service_list}
-    [Documentation]    Issues the karaf shell command showSvcStatus to verify the ready and service states are the same as the arguments passed
-    ${service_status_output} =    Run Keyword If    ${NUM_ODL_SYSTEM} > 1    Issue_Command_On_Karaf_Console    showSvcStatus -n ${odl_ip}    ${odl_ip}    ${KARAF_SHELL_PORT}
-    ...    ELSE    Issue_Command_On_Karaf_Console    showSvcStatus    ${odl_ip}    ${KARAF_SHELL_PORT}
-    Should Contain    ${service_status_output}    ${system_ready_state}
-    : FOR    ${service}    IN    @{service_list}
-    \    Should Match Regexp    ${service_status_output}    ${service} +: ${service_state}
-
 Create Vteps
     [Arguments]    ${Dpn_id_1}    ${Dpn_id_2}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
     [Documentation]    This keyword creates VTEPs between ${TOOLS_SYSTEM_IP} and ${TOOLS_SYSTEM_2_IP}
@@ -248,12 +240,6 @@ Verify Tunnel Status as UP
     ${Expected_Tunnel_Count}    Set Variable    ${Expected_Node_Count*${Expected_Node_Count - 1}}
     Should Be Equal As Strings    ${Actual_Tunnel_Count}    ${Expected_Tunnel_Count}
 
-Check System Status
-    [Arguments]    @{service_list}
-    [Documentation]    This keyword will verify whether all the services are in operational and all nodes are active based on the number of odl systems
-    : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    Check Service Status    ${ODL_SYSTEM_${i+1}_IP}    ACTIVE    OPERATIONAL    @{service_list}
-
 Verify Tunnel Status
     [Arguments]    ${tunnel_names}    ${tunnel_status}
     [Documentation]    Verifies if all tunnels in the input, has the expected status(UP/DOWN/UNKNOWN)
index 8fa0d1d926baeb02124e83b25280f6dac8748bf6..7ed3b1adc088e72d1a227f249daaaee9f70dc675 100644 (file)
@@ -65,7 +65,7 @@ Verify VTEP After Restarting Controller
     Genius.Verify Tunnel Status as UP    TZA
     ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Start_Members_From_List_Or_All
-    Wait Until Keyword Succeeds    60    3    Genius.Check System Status
+    Wait Until Keyword Succeeds    60    3    ClusterManagement.Check Status of Services
     Wait Until Keyword Succeeds    30    3    Genius.Verify Tunnel Status as UP    TZA
 
 Verify Tunnels By Disabling BFD