Resource ../../libraries/Utils.robot
Resource ../../libraries/VpnOperations.robot
Resource ../../variables/Variables.robot
+Resource ../../libraries/CompareStream.robot
*** Variables ***
@{itm_created} TZA
${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
${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
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
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
[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
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.
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