Migrate to Openstack CLI
[integration/test.git] / csit / suites / netvirt / Netvirt_Vpnservice / BFD_Monitoring.robot
index dfa0d4021715ace317174b4ee818335a2867006b..6fcd7639e2198b61e27b92c17c4866043398df54 100644 (file)
@@ -3,9 +3,10 @@ Documentation     Test suite for Tunnel Monitoring. More test cases to be added
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keyword If Test Failed    Get OvsDebugInfo
+Test Teardown     Get Test Teardown Debugs
 Library           OperatingSystem
 Library           RequestsLibrary
+Resource          ../../../libraries/CompareStream.robot
 Resource          ../../../libraries/OpenStackOperations.robot
 Resource          ../../../libraries/DevstackUtils.robot
 Resource          ../../../libraries/VpnOperations.robot
@@ -16,23 +17,26 @@ Resource          ../../../variables/netvirt/Variables.robot
 Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${STATE_UP}       UP
-${STATE_DOWN}     DOWN
-${STATE_ENABLE}    ENABLED
-${STATE_DISABLE}    DISABLE
 ${BFD_ENABLED_FALSE}    false
 ${BFD_ENABLED_TRUE}    true
 ${PING_REGEXP}    , 0% packet loss
 ${VAR_BASE}       ${CURDIR}/../../../variables/netvirt
 
 *** Test Cases ***
-TC00 Verify Tunnels Are Present
+TC00 Verify Setup
     [Documentation]    Verify if tunnels are present. If not then create new tunnel.
+    : FOR    ${VM}    IN    @{VM_INSTANCES_NET1}    @{VM_INSTANCES_NET2}
+    \    Wait Until Keyword Succeeds    25s    5s    Verify VM Is ACTIVE    ${VM}
+    ${VM_IP_NET1}    ${VM_IP_NET2}    Wait Until Keyword Succeeds    180s    10s    Verify VMs received IP
+    Set Suite Variable    ${VM_IP_NET2}
+    Set Suite Variable    ${VM_IP_NET1}
     ${output}=    ITM Get Tunnels
     Log    ${output}
     ${count}=    Get Count    ${output}    tunnel_port
     Log    ${count}
     Run Keyword If    ${count} == 0    Create Tunnel
+    [Teardown]    Run Keywords    Show Debugs    @{VM_INSTANCES_NET1}    @{VM_INSTANCES_NET2}
+    ...    AND    Get Suite Teardown Debugs
 
 TC01 Verify That Default Tunnel Type Is Set To BFD
     [Documentation]    Verify that the default tunnel type is set to BFD if both the devices support BFD
@@ -66,33 +70,161 @@ TC01 Verify That Default Tunnel Type Is Set To BFD
     Log    Verify Ping Between VMs on different Compute Nodes
     Wait Until Keyword Succeeds    30s    5s    Verify Ping
 
+TC02 Verify that Tunnel Monitoring can be disabled and monitor interval can be configured through REST
+    [Documentation]    Verify that Tunnel Monitoring can be disabled and monitor interval can be configured through REST
+    Log    Verifying ITM tunnel are present and tunnel status
+    ${output}=    ITM Get Tunnels
+    Log    ${output}
+    Wait Until Keyword Succeeds    10s    5s    Verify Tunnel Status as UP
+    Log    Verifying the BFD based tunnel configuration is on
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
+    Log    ${output}
+    Should Contain    ${output}    ${TUNNEL_MONITOR_ON}
+    Log    Disabling the tunnel monitoring from REST
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/disable_tunnel_monitoring    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_FALSE}    ${BFD}
+    Log    Verifying the default tunnel monitoring is off
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
+    Log    ${output}
+    Should Contain    ${output}    ${TUNNEL_MONITOR_OFF}
+    Wait Until Keyword Succeeds    10s    5s    Verify Tunnel Status as UP
+    Log    Verifying the default monitoring interval i.e 1000ms via REST
+    ${resp}=    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_1000}
+    Log    Change and verify the default tunnel monitoring interval after monitoring is disabled
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/monitor_interval    mapping={"int":"2000"}    session=session
+    ${resp}=    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_2000}
+
+TC03 Verify that the monitoring interval value boundaries with Monitoring Enabled
+    [Documentation]    Verify that the monitoring interval value boundaries with Monitoring Enabled
+    Log    Verifying ITM tunnel are present and tunnel status
+    ${output}=    ITM Get Tunnels
+    Log    ${output}
+    Wait Until Keyword Succeeds    10s    5s    Verify Tunnel Status as UP
+    Log    Enabling the tunnel monitoring from REST
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/enable_tunnel_monitoring    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_TRUE}    ${BFD}
+    Log    Verifying the tunnel status
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
+    Log    ${output}
+    Should Contain    ${output}    ${TUNNEL_MONITOR_ON}
+    Log    Changing and verifying the tunnel monitoring interval to 1000ms
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/monitor_interval    mapping={"int":"1000"}    session=session
+    ${resp}=    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_1000}
+    Log    Setting the tunnel monitoring interval to 30000ms
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/monitor_interval    mapping={"int":"30000"}    session=session
+    Log    Verifying the tunnel monitoring interval to 30000ms
+    Wait Until Keyword Succeeds    10s    1s    Check Tunnel Monitoring Interval    ${TMI_30000}
+    Log    Verifying the tunnel monitoring interval to greater than 30000ms cannot be set
+    ${resp}=    RequestsLibrary.Put Request    session    ${MONITOR_INTERVAL_NEW}    data=${INTERVAL_31000}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_ERROR_CODE}
+    Wait Until Keyword Succeeds    10s    1s    Check Tunnel Monitoring Interval    ${TMI_30000}
+    Log    Verifying the tunnel monitoring interval to 50ms cannot be set
+    ${resp}=    RequestsLibrary.Put Request    session    ${MONITOR_INTERVAL_NEW}    data=${INTERVAL_50}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_ERROR_CODE}
+    Wait Until Keyword Succeeds    10s    1s    Check Tunnel Monitoring Interval    ${TMI_30000}
+    Log    Verifying the tunnel monitoring interval to 0ms cannot be set
+    ${resp}=    RequestsLibrary.Put Request    session    ${MONITOR_INTERVAL_NEW}    data=${INTERVAL_0}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_ERROR_CODE}
+    Wait Until Keyword Succeeds    10s    1s    Check Tunnel Monitoring Interval    ${TMI_30000}
+    Log    Verifying the tunnel monitoring interval to a negative value cannot be set
+    ${resp}=    RequestsLibrary.Put Request    session    ${MONITOR_INTERVAL_NEW}    data=${INTERVAL_NEG}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_ERROR_CODE}
+    Wait Until Keyword Succeeds    10s    1s    Check Tunnel Monitoring Interval    ${TMI_30000}
+    Log    Restoring back to default moitor interval
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/monitor_interval    mapping={"int":"1000"}    session=session
+    ${resp}    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Contain    ${resp.content}    ${TMI_1000}
+
+TC04 Verify that the tunnel monitoring protocol can be configured to LLDP
+    [Documentation]    Verify that the tunnel monitoring protocol can be configured to LLDP
+    ${output} =    ITM Get Tunnels
+    Log    ${output}
+    Wait Until Keyword Succeeds    30s    5s    Verify Tunnel Status as UP
+    Log    Disabling the tunnel monitoring from REST in order to change the protocol
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/disable_tunnel_monitoring    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_FALSE}    ${BFD}
+    Log    Changing the tunnel monitoring to LLDP and verify
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/disablemonitor_lldp    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_FALSE}    ${LLDP}
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
+    Log    ${output}
+    Should Contain    ${output}    ${TUNNEL_MONITOR_OFF}
+    Log    Enabling tunnel monitoring
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/enablemonitor_lldp    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_TRUE}    ${LLDP}
+    Wait Until Keyword Succeeds    30s    5s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    30s    5s    Verify Ping
+    Log    Verifying the monitoring interval
+    ${resp}    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_1000}
+    Log    Changing the tunnel monitoring interval
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/monitor_interval    mapping={"int":"20000"}    session=session
+    Log    Verifying the monitoring interval got changed
+    ${resp}    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_20000}
+    Log    Changing the tunnel monitoring back to bfd and verify
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/disablemonitor_lldp    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_FALSE}    ${LLDP}
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/disable_tunnel_monitoring    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_FALSE}    ${BFD}
+    TemplatedRequests.Put_As_Json_Templated    folder=${VAR_BASE}/enable_tunnel_monitoring    session=session
+    Wait Until Keyword Succeeds    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_TRUE}    ${BFD}
+    Wait Until Keyword Succeeds    90s    5s    Verify Tunnel Status as UP
+    Wait Until Keyword Succeeds    60s    5s    Verify Ping
+
+TC05 Disconnect And Reconnect Compute Nodes
+    [Documentation]    Verify that when compute nodes are disconnected from controller tunnel goes to unknown state.
+    ${output} =    ITM Get Tunnels
+    Log    ${output}
+    Wait Until Keyword Succeeds    90s    5s    Verify Tunnel Status as UP
+    Log    Disconnect Compute Nodes
+    Disconnect Compute Nodes    ${OS_COMPUTE_1_IP}    ${ODL_SYSTEM_IP}
+    Disconnect Compute Nodes    ${OS_COMPUTE_2_IP}    ${ODL_SYSTEM_IP}
+    Disconnect Compute Nodes    ${OS_CONTROL_NODE_IP}    ${ODL_SYSTEM_IP}
+    Wait Until Keyword Succeeds    120s    5s    Verify Tunnel Status as UNKNOWN
+    Wait Until Keyword Succeeds    60s    5s    Verify Ping
+    Log    Reconect Compute Nodes
+    Reconnect Compute Nodes    ${OS_COMPUTE_1_IP}    ${ODL_SYSTEM_IP}
+    Reconnect Compute Nodes    ${OS_COMPUTE_2_IP}    ${ODL_SYSTEM_IP}
+    Reconnect Compute Nodes    ${OS_CONTROL_NODE_IP}    ${ODL_SYSTEM_IP}
+    Wait Until Keyword Succeeds    120s    5s    Verify Tunnel Status as UP
+    Log    Verifying Tunnel Monitoring
+    ${resp}    RequestsLibrary.Get Request    session    ${TUNNEL_MONITOR_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${BFD_ENABLED_TRUE}
+    Should Contain    ${resp.content}    ${BFD}
+    Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present    ${OS_COMPUTE_1_IP}
+    Wait Until Keyword Succeeds    30s    5s    Verify Flows Are Present    ${OS_COMPUTE_2_IP}
+    Wait Until Keyword Succeeds    30s    5s    Verify Ping
+
 *** Keywords ***
 Start Suite
     [Documentation]    Run before the suite execution
     DevstackUtils.Devstack Suite Setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Enable ODL Karaf Log
     Presuite Cleanup
     Create Setup
 
 Stop Suite
     [Documentation]    Run after the tests execution
     Delete Setup
-    Disable ODL Karaf Log
     Close All Connections
 
-Enable ODL Karaf Log
-    [Documentation]    Uses log:set TRACE org.opendaylight.netvirt to enable log
-    Log    "Enabled ODL Karaf log for org.opendaylight.netvirt"
-    ${output}=    Issue Command On Karaf Console    log:set TRACE org.opendaylight.netvirt
-    Log    ${output}
-
-Disable ODL Karaf Log
-    [Documentation]    Uses log:set TRACE org.opendaylight.netvirt to enable log
-    Log    "Enabled ODL Karaf log for org.opendaylight.netvirt"
-    ${output}=    Issue Command On Karaf Console    log:set INFO org.opendaylight.netvirt
-    Log    ${output}
-
 Presuite Cleanup
     [Documentation]    Clean the already existing tunnels and tep interfaces
     ${resp}    RequestsLibrary.Delete Request    session    ${TUNNEL_TRANSPORTZONE}
@@ -116,28 +248,40 @@ Create Setup
     Should Contain    ${SUB_LIST}    ${SUBNETS[0]}
     Should Contain    ${SUB_LIST}    ${SUBNETS[1]}
     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${SUBNETWORK_URL}    ${SUBNETS}
+    Neutron Security Group Create    sg-vpnservice1
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=ingress    port_range_max=65535    port_range_min=1    protocol=tcp
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    port_range_max=65535    port_range_min=1    protocol=tcp
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=ingress    protocol=icmp
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    protocol=icmp
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=ingress    port_range_max=65535    port_range_min=1    protocol=udp
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    port_range_max=65535    port_range_min=1    protocol=udp
     Log    Create four ports under previously created subnets
-    Create Port    ${NETWORKS[0]}    ${PORT_LIST[0]}    sg=sg-vpnservice
-    Create Port    ${NETWORKS[0]}    ${PORT_LIST[1]}    sg=sg-vpnservice
-    Create Port    ${NETWORKS[1]}    ${PORT_LIST[2]}    sg=sg-vpnservice
-    Create Port    ${NETWORKS[1]}    ${PORT_LIST[3]}    sg=sg-vpnservice
+    Create Port    ${NETWORKS[0]}    ${PORT_LIST[0]}    sg=sg-vpnservice1
+    Create Port    ${NETWORKS[0]}    ${PORT_LIST[1]}    sg=sg-vpnservice1
+    Create Port    ${NETWORKS[1]}    ${PORT_LIST[2]}    sg=sg-vpnservice1
+    Create Port    ${NETWORKS[1]}    ${PORT_LIST[3]}    sg=sg-vpnservice1
     Wait Until Keyword Succeeds    3s    1s    Check For Elements At URI    ${PORT_URL}    ${PORT_LIST}
     Log    Create VM Instances
-    Create Vm Instance With Port On Compute Node    ${PORT_LIST[0]}    ${VM_INSTANCES_NET1[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice
-    Create Vm Instance With Port On Compute Node    ${PORT_LIST[1]}    ${VM_INSTANCES_NET1[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice
-    Create Vm Instance With Port On Compute Node    ${PORT_LIST[2]}    ${VM_INSTANCES_NET2[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice
-    Create Vm Instance With Port On Compute Node    ${PORT_LIST[3]}    ${VM_INSTANCES_NET2[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice
-    : FOR    ${VM}    IN    @{VM_INSTANCES_NET1}    @{VM_INSTANCES_NET2}
-    \    Wait Until Keyword Succeeds    25s    5s    Verify VM Is ACTIVE    ${VM}
-    ${VM_IP_NET1}    ${VM_IP_NET2}    Wait Until Keyword Succeeds    180s    10s    Verify VMs received IP
-    Set Suite Variable    ${VM_IP_NET2}
-    Set Suite Variable    ${VM_IP_NET1}
+    Create Vm Instance With Port On Compute Node    ${PORT_LIST[0]}    ${VM_INSTANCES_NET1[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice1
+    Create Vm Instance With Port On Compute Node    ${PORT_LIST[1]}    ${VM_INSTANCES_NET1[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice1
+    Create Vm Instance With Port On Compute Node    ${PORT_LIST[2]}    ${VM_INSTANCES_NET2[0]}    ${OS_COMPUTE_1_IP}    sg=sg-vpnservice1
+    Create Vm Instance With Port On Compute Node    ${PORT_LIST[3]}    ${VM_INSTANCES_NET2[1]}    ${OS_COMPUTE_2_IP}    sg=sg-vpnservice1
 
 Verify VMs received IP
-    [Documentation]    Verify VM received IP
-    ${VM_IP_NET1}    ${DHCP_IP1}    Verify VMs Received DHCP Lease    @{VM_INSTANCES_NET1}
+    [Documentation]    Verify VMs received IP
+    ${status}    ${message}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    60s    5s    Collect VM IP Addresses
+    ...    true    @{VM_INSTANCES_NET1}
+    ${status}    ${message}    Run Keyword And Ignore Error    Wait Until Keyword Succeeds    60s    5s    Collect VM IP Addresses
+    ...    true    @{VM_INSTANCES_NET2}
+    ${VM_IP_NET1}    ${NET1_DHCP_IP}    Collect VM IP Addresses    false    @{VM_INSTANCES_NET1}
+    ${VM_IP_NET2}    ${NET2_DHCP_IP}    Collect VM IP Addresses    false    @{VM_INSTANCES_NET2}
+    ${VM_INSTANCES}=    Collections.Combine Lists    ${VM_INSTANCES_NET1}    ${VM_INSTANCES_NET2}
+    ${VM_IPS}=    Collections.Combine Lists    ${VM_IP_NET1}    ${VM_IP_NET2}
+    ${LOOP_COUNT}    Get Length    ${VM_INSTANCES_NET1}
+    : FOR    ${index}    IN RANGE    0    ${LOOP_COUNT}
+    \    ${status}    ${message}    Run Keyword And Ignore Error    Should Not Contain    @{VM_IPS}[${index}]    None
+    \    Run Keyword If    '${status}' == 'FAIL'    Write Commands Until Prompt    nova console-log @{VM_INSTANCES}[${index}]    30s
     Log    ${VM_IP_NET1}
-    ${VM_IP_NET2}    ${DHCP_IP2}    Verify VMs Received DHCP Lease    @{VM_INSTANCES_NET2}
     Log    ${VM_IP_NET2}
     Should Not Contain    ${VM_IP_NET2}    None
     Should Not Contain    ${VM_IP_NET1}    None
@@ -170,31 +314,51 @@ Verify Flows Are Present
     \    Log    ${line}
     \    ${resp}=    Should Match Regexp    ${line}    ${MAC_REGEX}
 
-Verify Tunnel Status as UP
-    [Documentation]    Verify that the tunnels are UP
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+Disconnect Compute Nodes
+    [Arguments]    ${Compute_node_ip}    ${Controller_ip}
+    ${current_ssh_connection}=    SSHLibrary.Get Connection
+    ${conn_id}=    SSHLibrary.Open Connection    ${Compute_node_ip}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=${DEFAULT_TIMEOUT}
+    Flexible SSH Login    ${DEFAULT_USER}    ${EMPTY}
+    ${cmd}=    BuiltIn.Set Variable    sudo ovs-vsctl set Controller br-int target="tcp\\:${Controller_ip}\\:6654"
+    ${cntlstdout}    Write Commands Until Prompt    ${cmd}
+    Log    ${cntlstdout}
+    ${output}=    Write Commands Until Prompt    sudo ovs-vsctl show
     Log    ${output}
-    Should Contain    ${output}    ${STATE_UP}
-    Should Not Contain    ${output}    ${STATE_DOWN}
+    SSHLibrary.Close Connection
 
-Verify Tunnel Status as DOWN
-    [Documentation]    Verify that the tunnels are DOWN
-    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+Reconnect Compute Nodes
+    [Arguments]    ${Compute_node_ip}    ${Controller_ip}
+    ${current_ssh_connection}=    SSHLibrary.Get Connection
+    ${conn_id}=    SSHLibrary.Open Connection    ${Compute_node_ip}    prompt=${DEFAULT_LINUX_PROMPT}    timeout=${DEFAULT_TIMEOUT}
+    Flexible SSH Login    ${DEFAULT_USER}    ${EMPTY}
+    ${cmd}=    BuiltIn.Set Variable    sudo ovs-vsctl set Controller br-int target="tcp\\:${Controller_ip}\\:6653"
+    ${cntlstdout}    Write Commands Until Prompt    ${cmd}
+    Log    ${cntlstdout}
+    ${output}=    Write Commands Until Prompt    sudo ovs-vsctl show
     Log    ${output}
-    Should Contain    ${output}    ${STATE_DOWN}
+    SSHLibrary.Close Connection
 
-Verify VXLAN interface
-    [Documentation]    Verify that the VXLAN interfaces are Enabled
-    ${output}=    Issue Command On Karaf Console    ${VXLAN_SHOW}
-    Log    ${output}
-    Should Contain    ${output}    ${STATE_UP}
-    Should Contain    ${output}    ${STATE_ENABLE}
-    Should Not Contain    ${output}    ${STATE_DISABLE}
+Check Tunnel Monitoring Interval
+    [Arguments]    ${TMI_INTERVAL}
+    [Documentation]    Check the tunnel monitoring interval through REST
+    ${resp}    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${TMI_INTERVAL}
+
+Verify Tunnel Monitoring
+    [Arguments]    ${BFD_STATUS}    ${PROTOCOL}
+    [Documentation]    Check the tunnel monitoring status
+    ${resp}=    RequestsLibrary.Get Request    session    ${TUNNEL_MONITOR_URL}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    ${RESP_CODE}
+    Should Contain    ${resp.content}    ${BFD_STATUS}
+    Should Contain    ${resp.content}    ${PROTOCOL}
 
 Create Tunnel
     [Documentation]    Create tunnels betwee the 2 compute nodes and Openstack controller.
     Log    If ODL version is Boron or higher then ITM tunnel should be auto configured. If not then the suite should fail. For ODL version Beryllium or lower, ITM tunnel should be created.
-    Should Not Match Regexp    ${ODL_STREAM}    boron|carbon
+    CompareStream.Run_Keyword_If_At_Least_Boron    BuiltIn.Fail    Tunnel should be auto configured for ${ODL_STREAM}
     ${node_1_dpid}=    Get DPID    ${OS_COMPUTE_1_IP}
     ${node_2_dpid}=    Get DPID    ${OS_COMPUTE_2_IP}
     ${node_3_dpid}=    Get DPID    ${OS_CONTROL_NODE_IP}
@@ -229,3 +393,4 @@ Delete Setup
     Log    Delete networks
     : FOR    ${Network}    IN    @{NETWORKS}
     \    Delete Network    ${Network}
+    Delete SecurityGroup    sg-vpnservice1