Update BFD TestCase & Add Verify Tunnel Status 14/72214/14
authorSathwik Boggarapu <b.sathwik@ericsson.com>
Thu, 24 May 2018 06:35:49 +0000 (12:05 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 1 Jun 2018 19:29:55 +0000 (19:29 +0000)
Verifying tunnel status after disabling BFD and
stopping OVS.New keyword will verify the
tunnel status on given Ip & State of Tunnel.

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

index 033718604d32c53f5d8024909227ee6e6d46f064..e6cb347205f81581e3f1372d7cc5eaa1501f6738 100644 (file)
@@ -247,3 +247,25 @@ Check System Status
     [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
+
+Verify Tunnel Status
+    [Arguments]    ${tunnel_names}    ${tunnel_status}
+    [Documentation]    Verifies if all tunnels in the input, has the expected status(UP/DOWN/UNKNOWN)
+    ${tep_result} =    KarafKeywords.Issue_Command_On_Karaf_Console    ${TEP_SHOW_STATE}
+    : FOR    ${tunnel}    IN    @{tunnel_names}
+    \    ${tep_output} =    String.Get Lines Containing String    ${tep_result}    ${tunnel}
+    \    BuiltIn.Should Contain    ${tep_output}    ${tunnel_status}
+
+Get Tunnels On OVS
+    [Arguments]    ${connection_id}
+    [Documentation]    Retrieves the list of tunnel ports present on OVS
+    SSHLibrary.Switch Connection    ${connection_id}
+    ${ovs_result} =    Utils.Write Commands Until Expected Prompt    sudo ovs-vsctl show    ${DEFAULT_LINUX_PROMPT_STRICT}
+    ${tunnel_names}    BuiltIn.Create List
+    ${tunnels} =    String.Get Lines Matching Regexp    ${ovs_result}    Interface "tun.*"    True
+    @{tunnels_list} =    String.Split To Lines    ${tunnels}
+    : FOR    ${tun}    IN    @{tunnels_list}
+    \    ${tun_list}    BuiltIn.Should Match Regexp    @{tunnels_list}    tun.*\\w
+    \    Collections.Append To List    ${tunnel_names}    ${tun_list}
+    ${items_in_list} =    BuiltIn.Get Length    ${tunnel_names}
+    [Return]    ${Tunnel_Names}
index 5af43ca2121ae84e3bb6333abd602bcd4fac28e7..ef93f896ae561bc26e96d568c700d5d050beafa1 100644 (file)
@@ -64,13 +64,17 @@ 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    Check Service Status    ACTIVE    OPERATIONAL
+    Wait Until Keyword Succeeds    60    3    Genius.Check System Status
     Wait Until Keyword Succeeds    30    3    Genius.Verify Tunnel Status as UP    TZA
 
 Verify Tunnels By Disabling BFD
-    [Documentation]    This test case will verify tunnels after disabling BFD.
-    ${result}    Run Keyword And Return Status    Verify Tunnel Monitoring is on
+    [Documentation]    This test case will verify tunnels after disabling BFD and verifies tunnel status as unknown after stopping OVS.
+    ${result}    Run Keyword And Return Status    Verify Tunnel Monitoring is on
     Run Keyword If    '${result}' == 'True'    Disable_Tunnel_Monitoring
+    ${tunnels_on_OVS} =    Genius.Get Tunnels On OVS    ${conn_id_1}
+    OVSDB.Stop OVS    ${TOOLS_SYSTEM_IP}
+    Genius.Verify Tunnel Status    ${tunnels_on_OVS}    UNKNOWN
+    OVSDB.Start OVS    ${TOOLS_SYSTEM_IP}
     Genius.Verify Tunnel Status as UP    TZA
 
 Verify Tunnels By Enabling BFD