Moving DHCP check from suite setup to test case 86/51886/5
authorrahul.agarwal <rahul.agarwal3@tcs.com>
Wed, 15 Feb 2017 13:49:16 +0000 (19:19 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Wed, 22 Feb 2017 01:11:51 +0000 (01:11 +0000)
so that all test cases get exectuted.
Also adding 2 more testcases.

Change-Id: If0773039c3e3fbf74bb70969c8b9bfc1431ceb73
Signed-off-by: rahul.agarwal <rahul.agarwal3@tcs.com>
csit/libraries/OpenStackOperations.robot
csit/libraries/VpnOperations.robot
csit/suites/netvirt/Netvirt_Vpnservice/BFD_Monitoring.robot
csit/suites/netvirt/Netvirt_Vpnservice/basic_vpnservice.robot
csit/variables/netvirt/disablemonitor_lldp/data.json [new file with mode: 0644]
csit/variables/netvirt/disablemonitor_lldp/location.uri [new file with mode: 0644]
csit/variables/netvirt/enablemonitor_lldp/data.json [new file with mode: 0644]
csit/variables/netvirt/enablemonitor_lldp/location.uri [new file with mode: 0644]

index 2a509518a32afa940ecd0f3b9f5f594e36e12f40..0f89dc8be1a1838e6b6828def714847455854ef4 100644 (file)
@@ -666,6 +666,16 @@ Neutron Security Group Update
     Close Connection
     [Return]    ${output}
 
+Delete SecurityGroup
+    [Arguments]    ${sg_name}
+    [Documentation]    Delete Security group
+    ${devstack_conn_id}=    Get ControlNode Connection
+    Switch Connection    ${devstack_conn_id}
+    ${output}=    Write Commands Until Prompt    neutron security-group-delete ${sg_name}    40s
+    Log    ${output}
+    Should Match Regexp    ${output}    Deleted security_group: ${sg_name}|Deleted security_group\\(s\\): ${sg_name}
+    Close Connection
+
 Neutron Security Group Rule Create
     [Arguments]    ${Security_group_name}    &{Kwargs}
     [Documentation]    Creates neutron security rule with neutron request with or without optional params, here security group name is mandatory args, rule with optional params can be created by passing the optional args values ex: direction=${INGRESS_EGRESS}, Then these optional params are catenated with mandatory args, example of usage: "Neutron Security Group Rule Create ${SGP_SSH} direction=${RULE_PARAMS[0]} ethertype=${RULE_PARAMS[1]} ..."
index 65f94233ea6188cf42bde50be5113fb38fd85e3b..81ff3f1caeedce97e2c357b927a9283e4fa0fa29 100644 (file)
@@ -3,6 +3,7 @@ Documentation     Openstack library. This library is useful for tests to create
 Library           SSHLibrary
 Resource          Utils.robot
 Resource          TemplatedRequests.robot
+Resource          KarafKeywords.robot
 Resource          ../variables/Variables.robot
 Library           Collections
 Library           String
@@ -14,6 +15,11 @@ Library           OperatingSystem
 &{L3VPN_CREATE_DEFAULT}    vpnid=4ae8cd92-48ca-49b5-94e1-b2921a261111    name=vpn1    rd=["2200:1"]    exportrt=["2200:1","8800:1"]    importrt=["2200:1","8800:1"]    tenantid=6c53df3a-3456-11e5-a151-feff819cdc9f
 ${VAR_BASE}       ${CURDIR}/../variables/vpnservice/
 ${ODL_FLOWTABLE_L3VPN}    21
+${STATE_UP}       UP
+${STATE_DOWN}     DOWN
+${STATE_UNKNOWN}    UNKNOWN
+${STATE_ENABLE}    ENABLED
+${STATE_DISABLE}    DISABLE
 
 *** Keywords ***
 VPN Create L3VPN
@@ -96,12 +102,23 @@ Verify Tunnel Status as UP
     Log    ${output}
     Should Contain    ${output}    ${STATE_UP}
     Should Not Contain    ${output}    ${STATE_DOWN}
+    Should Not Contain    ${output}    ${STATE_UNKNOWN}
 
 Verify Tunnel Status as DOWN
     [Documentation]    Verify that the tunnels are DOWN
     ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
     Log    ${output}
     Should Contain    ${output}    ${STATE_DOWN}
+    Should Not Contain    ${output}    ${STATE_UP}
+    Should Not Contain    ${output}    ${STATE_UNKNOWN}
+
+Verify Tunnel Status as UNKNOWN
+    [Documentation]    Verify that the tunnels are in Unknown state
+    ${output}=    Issue Command On Karaf Console    ${TEP_SHOW_STATE}
+    Log    ${output}
+    Should Not Contain    ${output}    ${STATE_UP}
+    Should Not Contain    ${output}    ${STATE_DOWN}
+    Should Contain    ${output}    ${STATE_UNKNOWN}
 
 Verify VXLAN interface
     [Documentation]    Verify that the VXLAN interfaces are Enabled
index 1efb5383badb2eb5749a1b6be615da9f0b0da00e..8ff7ac49432a9c2e6322e19dbd532bade21fb210 100644 (file)
@@ -17,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
@@ -79,12 +82,7 @@ TC02 Verify that Tunnel Monitoring can be disabled and monitor interval can be c
     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
-    Log    Verifying the tunnel monitoring after disable
-    ${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_FALSE}
-    Should Contain    ${resp.content}    ${BFD}
+    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}
@@ -110,12 +108,7 @@ TC03 Verify that the monitoring interval value boundaries with Monitoring Enable
     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
-    Log    Verifying the tunnel monitoring is enabled
-    ${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    10s    1s    Verify Tunnel Monitoring    ${BFD_ENABLED_TRUE}    ${BFD}
     Log    Verifying the tunnel status
     ${output}=    Issue Command On Karaf Console    ${TEP_SHOW}
     Log    ${output}
@@ -129,23 +122,95 @@ TC03 Verify that the monitoring interval value boundaries with Monitoring Enable
     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    ${TMI_30000}
+    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    ${TMI_30000}
+    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    ${TMI_30000}
+    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    ${TMI_30000}
+    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    ${TMI_30000}
+    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
@@ -183,24 +248,24 @@ 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    remote_ip_prefix=0.0.0.0/0
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    port_range_max=65535    port_range_min=1    protocol=tcp    remote_ip_prefix=0.0.0.0/0
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=ingress    protocol=icmp    remote_ip_prefix=0.0.0.0/0
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    protocol=icmp    remote_ip_prefix=0.0.0.0/0
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=ingress    port_range_max=65535    port_range_min=1    protocol=udp    remote_ip_prefix=0.0.0.0/0
+    Neutron Security Group Rule Create    sg-vpnservice1    direction=egress    port_range_max=65535    port_range_min=1    protocol=udp    remote_ip_prefix=0.0.0.0/0
     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}
-    [Teardown]    Run Keywords    Show Debugs    @{VM_INSTANCES_NET1}    @{VM_INSTANCES_NET2}
-    ...    AND    Get Suite Teardown Debugs
+    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
@@ -239,7 +304,31 @@ Verify Flows Are Present
     \    Log    ${line}
     \    ${resp}=    Should Match Regexp    ${line}    ${MAC_REGEX}
 
-Check Tunnel Monitoring
+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}
+    SSHLibrary.Close Connection
+
+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}
+    SSHLibrary.Close Connection
+
+Check Tunnel Monitoring Interval
     [Arguments]    ${TMI_INTERVAL}
     [Documentation]    Check the tunnel monitoring interval through REST
     ${resp}    RequestsLibrary.Get Request    session    ${MONITOR_INTERVAL_URL}
@@ -247,6 +336,15 @@ Check Tunnel Monitoring
     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.
@@ -285,3 +383,4 @@ Delete Setup
     Log    Delete networks
     : FOR    ${Network}    IN    @{NETWORKS}
     \    Delete Network    ${Network}
+    Delete SecurityGroup    sg-vpnservice1
index 98d24cb52f1bbfd2ce762fefcf377d03a7b8464f..c0e474867171e741cb93ae30103ba7adee853f0a 100644 (file)
@@ -4,7 +4,7 @@ Documentation     Test suite to validate vpnservice functionality in an openstac
 ...               integration bridges and vxlan tunnels.
 Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_Teardown
 ...               AND    DevstackUtils.Devstack Suite Setup
-Suite Teardown    Close All Connections
+Suite Teardown    Basic Vpnservice Suite Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     Get Test Teardown Debugs
 Library           OperatingSystem
@@ -371,7 +371,8 @@ Basic Vpnservice Suite Setup
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
 
 Basic Vpnservice Suite Teardown
-    Delete All Sessions
+    Delete SecurityGroup    sg-vpnservice
+    Close All Connections
 
 Wait For Routes To Propogate
     ${devstack_conn_id} =    Get ControlNode Connection
diff --git a/csit/variables/netvirt/disablemonitor_lldp/data.json b/csit/variables/netvirt/disablemonitor_lldp/data.json
new file mode 100644 (file)
index 0000000..c9550bf
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "tunnel-monitor-params": {
+    "enabled": false,
+    "monitor-protocol": "odl-interface:tunnel-monitoring-type-lldp"
+                           }
+}
diff --git a/csit/variables/netvirt/disablemonitor_lldp/location.uri b/csit/variables/netvirt/disablemonitor_lldp/location.uri
new file mode 100644 (file)
index 0000000..5686cb5
--- /dev/null
@@ -0,0 +1 @@
+/restconf/config/itm-config:tunnel-monitor-params/
diff --git a/csit/variables/netvirt/enablemonitor_lldp/data.json b/csit/variables/netvirt/enablemonitor_lldp/data.json
new file mode 100644 (file)
index 0000000..f8f543d
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "tunnel-monitor-params": {
+    "enabled": true,
+    "monitor-protocol": "odl-interface:tunnel-monitoring-type-lldp"
+                           }
+}
diff --git a/csit/variables/netvirt/enablemonitor_lldp/location.uri b/csit/variables/netvirt/enablemonitor_lldp/location.uri
new file mode 100644 (file)
index 0000000..5686cb5
--- /dev/null
@@ -0,0 +1 @@
+/restconf/config/itm-config:tunnel-monitor-params/