GENIUS-268: Disable BFD Greater than Neon 36/79836/14
authorKarthika Panneer <r.p.karthika@ericsson.com>
Wed, 23 Jan 2019 07:13:40 +0000 (23:13 -0800)
committerKarthika Panneer <r.p.karthika@ericsson.com>
Mon, 28 Jan 2019 18:44:32 +0000 (18:44 +0000)
Changes in test cases are done because BFD
will be disabled by default for branches
greater than neon while for other branches
it will remain enabled by default.

Change-Id: I3d2819d3a198f534afce94314c5756e4cd62408c
Signed-off-by: Karthika Panneer <r.p.karthika@ericsson.com>
csit/libraries/Genius.robot
csit/suites/genius/BFD_monitoring.robot
csit/suites/genius/ITM_Direct_Tunnels.robot

index 808de018473ff9e2e6df953e372517363d4df814..205548e0eeea7247d45667dc10a3011c6078498f 100644 (file)
@@ -324,3 +324,8 @@ SRM Stop Suite
     Delete All Vteps
     Genius Suite Debugs    ${data_models}
     Genius Suite Teardown
+
+Verify Tunnel Monitoring Status
+    [Arguments]    ${tunnel_monitor_status}
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
+    Should Contain    ${output}    ${tunnel_monitor_status}
index dcf50120e01fab217c7d0e60896a18e05efa4cb3..891bd24c4008c30288fd797c56c4b8ea5457e2d4 100644 (file)
@@ -18,6 +18,7 @@ Resource          ../../libraries/OVSDB.robot
 Resource          ../../libraries/Utils.robot
 Resource          ../../libraries/VpnOperations.robot
 Resource          ../../variables/Variables.robot
+Resource          ../../libraries/CompareStream.robot
 
 *** Variables ***
 @{itm_created}    TZA
@@ -28,7 +29,6 @@ ${TUNNEL_MONITOR_ON}    Tunnel Monitoring (for VXLAN tunnels): On
 ${DEFAULT_MONITORING_INTERVAL}    Tunnel Monitoring Interval (for VXLAN tunnels): 1000
 ${TUNNEL_MONITOR_OFF}    Tunnel Monitoring (for VXLAN tunnels): Off
 ${INTERVAL_5000}    {"tunnel-monitor-interval":{"interval":5000}}
-${OK_201}         201
 ${ENABLE_MONITORING}    {"tunnel-monitor-params":{"enabled":true,"monitor-protocol":"odl-interface:tunnel-monitoring-type-bfd"}}
 ${DISABLE_MONITORING}    {"tunnel-monitor-params":{"enabled":"false","monitor-protocol":"odl-interface:tunnel-monitoring-type-bfd"}}
 ${TUNNEL_MONI_PARAMS_TRUE}    true
@@ -40,8 +40,8 @@ ${INTERFACE_DS_MONI_INT_5000}    "odl-interface:monitor-interval": 5000
 ${TUNNEL_MONI_PROTO}    tunnel-monitoring-type-bfd
 
 *** Test Cases ***
-BFD_TC00 Create ITM between DPNs Verify_BFD_Enablement
-    [Documentation]    Create ITM between DPNs Verify_BFD_Enablement
+BFD_TC00 Create ITM between DPNs
+    [Documentation]    Create ITM between DPNs
     ${Dpn_id_1}    Genius.Get Dpn Ids    ${conn_id_1}
     ${Dpn_id_2}    Genius.Get Dpn Ids    ${conn_id_2}
     ${vlan}=    Set Variable    0
@@ -49,12 +49,21 @@ BFD_TC00 Create ITM between DPNs Verify_BFD_Enablement
     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    Genius.Verify Tunnel Status as UP    TZA
 
-BFD_TC01 Verify by default BFD monitoring is enabled on Controller
-    [Documentation]    Verify by default BFD monitoring is enabled on Controller
-    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Is On
-    Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_1000}    ${TUNNEL_MONI_PROTO}
+BFD_TC01 Verify default BFD monitoring status on Controller
+    [Documentation]    Verify the default value of BFD monitoring \ on the Controller
+    CompareStream.Run_Keyword_If_At_Least_Neon    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Status    ${TUNNEL_MONITOR_OFF}
+    CompareStream.Run_Keyword_If_Less_Than_Neon    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Status    ${TUNNEL_MONITOR_ON}
+    CompareStream.Run_Keyword_If_At_Least_Neon    Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_FALSE}    ${INTERFACE_DS_MONI_INT_1000}
+    ...    ${TUNNEL_MONI_PROTO}
+    CompareStream.Run_Keyword_If_Less_Than_Neon    Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${INTERFACE_DS_MONI_INT_1000}
+    ...    ${TUNNEL_MONI_PROTO}
+
+BFD_TC02 Enable BFD Monitoring And Verify On Controller
+    [Documentation]    Enable BFD monitoring in branches greater than neon and verify that BFD is enabled in the controller.
+    CompareStream.Run_Keyword_If_Less_Than_Neon    BuiltIn.Pass Execution    Test case valid only for versions Neon and above
+    Enable BFD And Verify    ${INTERFACE_DS_MONI_INT_1000}
 
-BFD_TC02 Verify that BFD tunnel monitoring interval is set with appropriate default value i.e.,1000
+BFD_TC03 Verify that BFD tunnel monitoring interval is set with appropriate default value i.e.,1000
     [Documentation]    This will verify BFD tunnel monitoring default interval
     ${output} =    Issue Command On Karaf Console    ${TEP_SHOW}
     ${tunnel_monitoring} =    Get Lines Containing String    ${output}    Tunnel Monitoring Interval
@@ -101,20 +110,10 @@ BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected
     Wait Until Keyword Succeeds    10s    1s    Genius.Verify Tunnel Status as UP    TZA
     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
-    [Documentation]    Verify that BFD monitoring is disabled on Controller
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-params/    data=${DISABLE_MONITORING}
-    Should Be Equal As Strings    ${resp.status_code}    201
-    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_FALSE}
-    ${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    Genius.Verify Tunnel Status as UP    TZA
-    ${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}
-    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Is On
-    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 Set BFD monitoring To Default Value
+    [Documentation]    Disable BFD monitoring(setting it to default value) and verify that BFD is disabled on the controller.
+    CompareStream.Run_Keyword_If_At_Least_Neon    Disable BFD And Verify
+    CompareStream.Run_Keyword_If_Less_Than_Neon    Enable BFD And Verify    ${INTERFACE_DS_MONI_INT_5000}
 
 *** Keywords ***
 Verify Config Ietf Interface Output
@@ -139,3 +138,22 @@ Verify Tunnel Monitoring Params
     [Arguments]    ${flag}
     @{checklist}    create list    ${flag}
     Check For Elements At URI    ${OPERATIONAL_API}/itm-config:tunnel-monitor-params/    ${checklist}
+
+Enable BFD And Verify
+    [Arguments]    ${interface_ds_moni_int}
+    [Documentation]    Enable BFD Monitoring And Verify On Controller.
+    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-params/    data=${ENABLE_MONITORING}
+    Should Be Equal As Strings    ${resp.status_code}    201
+    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_TRUE}
+    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Status    ${TUNNEL_MONITOR_ON}
+    Wait Until Keyword Succeeds    10s    2s    Verify Config Ietf Interface Output    ${INTERFACE_DS_MONI_TRUE}    ${interface_ds_moni_int}    ${TUNNEL_MONI_PROTO}
+    Wait Until Keyword Succeeds    20    2    Genius.Verify Tunnel Status as UP    TZA
+
+Disable BFD And Verify
+    [Documentation]    Disable BFD Monitoring And Verify On Controller.
+    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_API}/itm-config:tunnel-monitor-params/    data=${DISABLE_MONITORING}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Params    ${TUNNEL_MONI_PARAMS_FALSE}
+    Wait Until Keyword Succeeds    10s    2s    Verify Tunnel Monitoring Status    ${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    Genius.Verify Tunnel Status as UP    TZA
index 46d4ddc372c5cff54d614dc956c5e539033e2654..7a83b0bc3e45c4d03a73f7cd387ccdba6e2b5247 100644 (file)
@@ -69,22 +69,12 @@ Verify VTEP After Restarting Controller
     Wait Until Keyword Succeeds    60    3    ClusterManagement.Check Status Of Services Is OPERATIONAL    @{GENIUS_DIAG_SERVICES}
     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 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}
-    Wait Until Keyword Succeeds    20    2    Genius.Verify Tunnel Status as UP    TZA
-
-Verify Tunnels By Enabling BFD
-    [Documentation]    This test case will check the tunnel exists by bringing up/down a switch and check tunnels exist by enabling BFD
-    ${result}    Run Keyword And Return Status    Verify Tunnel Monitoring is on
-    Run Keyword If    '${result}' == 'False'    Enable_Tunnel_monitoring
-    Verify Tunnel State After OVS Restart    ${TOOLS_SYSTEM_IP}
-    Verify Tunnel State After OVS Restart    ${TOOLS_SYSTEM_2_IP}
+Verify Tunnels By Enabling/Disabling BFD
+    [Documentation]    Verify tunnel creation by enabling and disabling BFD one after another with respect to the branch in such a way default value is retained at last.
+    CompareStream.Run_Keyword_If_At_Least_Neon    Verify Tunnels By Enabling BFD
+    CompareStream.Run_Keyword_If_At_Least_Neon    Verify Tunnels By Disabling BFD
+    CompareStream.Run_Keyword_If_Less_Than_Neon    Verify Tunnels By Disabling BFD
+    CompareStream.Run_Keyword_If_Less_Than_Neon    Verify Tunnels By Enabling BFD
 
 Delete and Verify VTEP
     [Documentation]    This Delete testcase , deletes the ITM tunnel created between 2 dpns.
@@ -157,3 +147,20 @@ Get Port Number
 Disable_Tunnel_Monitoring
     [Documentation]    In this we will disable tunnel monitoring by tep:enable command running in karaf console
     ${output}    Issue_Command_On_Karaf_Console    tep:enable-tunnel-monitor false
+
+Verify Tunnels By Enabling BFD
+    [Documentation]    Verify tunnel creation by enabling BFD monitoring.
+    ${result}    Run Keyword And Return Status    Verify Tunnel Monitoring is on
+    Run Keyword If    '${result}' == 'False'    Enable_Tunnel_monitoring
+    Verify Tunnel State After OVS Restart    ${TOOLS_SYSTEM_IP}
+    Verify Tunnel State After OVS Restart    ${TOOLS_SYSTEM_2_IP}
+
+Verify Tunnels By Disabling BFD
+    [Documentation]    Verify tunnel creation by disabling BFD monitoring.
+    ${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}
+    Wait Until Keyword Succeeds    20    2    Genius.Verify Tunnel Status as UP    TZA