Refactor keyword Verify Tunnel Status As UP 13/71413/7
authorSathwik Boggarapu <b.sathwik@ericsson.com>
Thu, 26 Apr 2018 09:52:58 +0000 (15:22 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 27 Apr 2018 20:53:57 +0000 (20:53 +0000)
Tunnel Status As UP keyword is just verifys tunnels are Up or not.
In this we are verifying no.of tunnels created are equal to
no.of expected tunnel

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

index c3d3fc4d5beafb6f1353e30916e2020f994bbaff..362c8111a528062c89a113ecb563effabd0811f1 100644 (file)
@@ -11,6 +11,7 @@ Resource          Utils.robot
 Resource          ../variables/Variables.robot
 Resource          OVSDB.robot
 Resource          ../variables/netvirt/Variables.robot
+Resource          VpnOperations.robot
 
 *** Variables ***
 @{itm_created}    TZA
@@ -226,3 +227,17 @@ Check ITM Tunnel State
     [Documentation]    Verifies the Tunnel is deleted from datastore
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_API}/itm-state:tunnels_state/
     Should Not Contain    ${resp.content}    ${tunnel1}    ${tunnel2}
+
+Verify Tunnel Status as UP
+    [Documentation]    Verify that the number of tunnels are UP
+    ${No_of_Teps}    Issue_Command_On_Karaf_Console    ${TEP_SHOW}
+    ${Lines_of_TZA}    Get Lines Containing String    ${No_of_Teps}    TZA
+    ${Expected_Node_Count}    Get Line Count    ${Lines_of_TZA}
+    ${no_of_tunnels}    Issue_Command_On_Karaf_Console    ${TEP_SHOW_STATE}
+    ${lines_of_VXLAN}    Get Lines Containing String    ${no_of_tunnels}    VXLAN
+    Should Contain    ${no_of_tunnels}    ${STATE_UP}
+    Should Not Contain    ${no_of_tunnels}    ${STATE_DOWN}
+    Should Not Contain    ${no_of_tunnels}    ${STATE_UNKNOWN}
+    ${Actual_Tunnel_Count}    Get Line Count    ${lines_of_VXLAN}
+    ${Expected_Tunnel_Count}    Set Variable    ${Expected_Node_Count*${Expected_Node_Count - 1}}
+    Should Be Equal As Strings    ${Actual_Tunnel_Count}    ${Expected_Tunnel_Count}
index 7296defe13f586e1aa7101ad04c61de7795d4ec2..5e07e465ed3c6b2e0703c1cdd1d19ea8a807b7e6 100644 (file)
@@ -48,7 +48,7 @@ BFD_TC00 Create ITM between DPNs Verify_BFD_Enablement
     ${vlan}=    Set Variable    0
     ${gateway-ip}=    Set Variable    0.0.0.0
     Genius.Create Vteps    ${Dpn_id_1}    ${Dpn_id_2}    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    ${vlan}    ${gateway-ip}
-    Wait Until Keyword Succeeds    30s    5s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    30s    5s    Genius.Verify Tunnel Status as UP
 
 BFD_TC01 Verify by default BFD monitoring is enabled on Controller
     [Documentation]    Verify by default BFD monitoring is enabled on Controller
@@ -64,7 +64,7 @@ BFD_TC02 Verify that BFD tunnel monitoring interval is set with appropriate defa
 BFD_TC04 Verify that in controller tunnel status is up when ITM tunnel interface is brought up.
     [Documentation]    Verify that in controller tunnel status is up when ITM tunnel interface is brought up.
     Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Is On
-    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    10s    1s    Genius.Verify Tunnel Status as UP
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_1000}    ${TUNNEL_MONI_PROTO}
 
 BFD_TC05 Verify BFD tunnel monitoring interval can be changed.
@@ -107,7 +107,7 @@ BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
     Log    "After connecting CSS with controller"
     Issue Command On Karaf Console    ${TEP_SHOW}
     Issue Command On Karaf Console    ${TEP_SHOW_STATE}
-    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    10s    1s    Genius.Verify Tunnel Status as UP
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_5000}    ${TUNNEL_MONI_PROTO}
 
 BFD_TC07 Verify that BFD monitoring is disabled on Controller
@@ -118,7 +118,7 @@ BFD_TC07 Verify that BFD monitoring is disabled on Controller
     ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
     Should Contain    ${output}    ${TUNNEL_MONITOR_OFF}
     Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_FALSE}    ${INTERFACE_DS_MONI_INT_5000}    ${TUNNEL_MONI_PROTO}
-    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    10s    1s    Genius.Verify Tunnel Status as UP
     ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-params/    data=${ENABLE_MONITORING}
     Should Be Equal As Strings    ${resp.status_code}    200
     Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_TRUE}
index bd0cb8054d9455baae16d3be180a43d0cdcd137c..64f5103cdcc107b93efdd8947705b66317705e36 100644 (file)
@@ -68,11 +68,11 @@ Verify VTEP After Restarting OVS
 
 Verify VTEP After Restarting Controller
     [Documentation]    Verify Testcase, Verifying tunnel state by restarting CONTROLLER
-    Verify Tunnel Status as UP
+    Genius.Verify Tunnel Status as UP
     ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Start_Members_From_List_Or_All
     Wait Until Keyword Succeeds    10    2    Check Service Status    ACTIVE    OPERATIONAL
-    Wait Until Keyword Succeeds    30    3    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    30    3    Genius.Verify Tunnel Status as UP
 
 Delete and Verify VTEP
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
@@ -118,7 +118,7 @@ Verify Tunnel State After OVS Restart
     OVSDB.Stop OVS    ${TOOLS_SYSTEM_IP}
     Wait Until Keyword Succeeds    2min    20 sec    Verify Tunnel Down
     OVSDB.Start OVS    ${TOOLS_SYSTEM_IP}
-    Wait Until Keyword Succeeds    2min    20 sec    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    2min    20 sec    Genius.Verify Tunnel Status as UP
 
 Verify Tunnel Down
     [Documentation]    In this we will check whether tunnel is in down or not