Add test cases for l2switch link down/up and port remove/add
authorLuis Gomez <ecelgp@gmail.com>
Wed, 3 Jun 2015 02:51:37 +0000 (19:51 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 3 Jun 2015 05:38:59 +0000 (05:38 +0000)
This will uncover these 2 bugs:

https://bugs.opendaylight.org/show_bug.cgi?id=3345
https://bugs.opendaylight.org/show_bug.cgi?id=3346

Finally reduce timeouts in case of failure

Change-Id: I7c086ea91bf09933425cedbe2bc54f8fcb636a83
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
test/csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.robot
test/csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.robot
test/csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.robot
test/csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.robot

index 126be9b9d83dc3aa66ffd2d8d0bede4ed0016c31..aa513fd15f596ddbd347877cf1128ce7b45a7a97 100644 (file)
@@ -14,20 +14,20 @@ ${IP_3}           "10.0.0.3"
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
 
 Check No Host Is Present
     [Documentation]    Get the invnetory, should not contain any host address
     @{list}    Create List    ${IP_1}    ${IP_2}    ${IP_3}
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
 
 Ping All
     [Documentation]    Pingall, verify no packet loss
@@ -38,17 +38,17 @@ Ping All
 Check node 1 addresses
     [Documentation]    Get the address observations for node 1
     @{list}    Create List    ${IP_2}    ${IP_3}
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${IP_1}    1
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${IP_1}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:1    ${list}
 
 Check node 2 addresses
     [Documentation]    Get the address observations for node 2
     @{list}    Create List    ${IP_1}    ${IP_3}
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${IP_2}    1
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${IP_2}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:2    ${list}
 
 Check node 3 addresses
     [Documentation]    Get the address observations for node 3
     @{list}    Create List    ${IP_1}    ${IP_2}
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${IP_3}    1
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${IP_3}    1
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}/node/openflow:3    ${list}
index 3a5ad2ed98c1cd7939810ea53f8f2bd5f9ab5ede..07dea93dda100e9743dad845e2091e612f3c4b48 100644 (file)
@@ -12,19 +12,19 @@ Variables         ../../../variables/Variables.py
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
 
 Check Flows
     [Documentation]    Check all flows are present
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "output-node-connector"    21
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    "output-node-connector"    21
 
 Ping All Test
     [Documentation]    Ping all, verify no packet loss or duplicates
index f5e35a5a3e16327241d2e7f501c22784e9ac6f89..d8c3a18341afe1c185446e6e995ae3ddc03dee90 100644 (file)
@@ -17,25 +17,25 @@ ${IP_3}           10.0.0.3
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
 
 Check Switch Links
     [Documentation]    Get the topology and check links
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
 
 Check No Host Is Present
     [Documentation]    Get the network topology, should not contain any host address
     @{list}    Create List    ${MAC_1}    ${MAC_2}    ${MAC_3}
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    4
 
 Ping All
     [Documentation]    Pingall, verify no packet loss
@@ -45,16 +45,52 @@ Ping All
 
 Check Host Links
     [Documentation]    Get the topology and check links
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    10
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    link-id    10
 
 Host Tracker host1
-    [Documentation]    Get the network topology,
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
+    [Documentation]    Get the network topology, should contain host1 one time
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
 
 Host Tracker host2
-    [Documentation]    Get the network topology,
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_2}"    1
+    [Documentation]    Get the network topology, should contain host 2 one time
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_2}"    1
 
 Host Tracker host3
-    [Documentation]    Get the network topology,
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_3}"    1
+    [Documentation]    Get the network topology, should contain hos 3 one time
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_3}"    1
+
+Link Down
+    [Documentation]    Take link s1-h1 down and verify host1 goes away
+    Write    link s1 h1 down
+    Read Until    mininet>
+    @{list}    Create List    "link-down":true
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    @{list}    Create List    ${MAC_1}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Link Up
+    [Documentation]    Take link s1-h1 up and verify host1 comes back
+    Write    link s1 h1 up
+    Read Until    mininet>
+    @{list}    Create List    "link-down":false
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    Write    pingall
+    Read Until    mininet>
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
+
+Remove Port
+    [Documentation]    Remove port s1-eth1 and verify host1 goes away
+    Write    sh ovs-vsctl del-port s1 s1-eth1
+    Read Until    mininet>
+    @{list}    Create List    ${MAC_1}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Add Port
+    [Documentation]    Add port s2-eth1 and verify host1 comes back
+    Write    sh ovs-vsctl add-port s1 s1-eth1 -- set interface s1-eth1 ofport=1
+    Read Until    mininet>
+    @{list}    Create List    "link-down":false
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1    ${list}
+    Write    pingall
+    Read Until    mininet>
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_1}"    1
index 4b308d7512c2847f5e3a00ab906f3b07b8ee919e..90c7ea62ff1fa9625475d0c6bb30c1a60d7a9547 100644 (file)
@@ -13,26 +13,26 @@ ${DISCARD}        "stp-status-aware-node-connector:status":"discarding"
 *** Test Cases ***
 Check Stats for node 1
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:1
 
 Check Stats for node 2
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:2
 
 Check Stats for node 3
     [Documentation]    Get the stats for a node
-    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
+    Wait Until Keyword Succeeds    10s    2s    Check Nodes Stats    openflow:3
 
 Check Ports
     [Documentation]    Check all ports are present
     @{list}    Create List    openflow:1:1    openflow:1:2    openflow:1:3    openflow:2:1    openflow:2:2
     ...    openflow:2:3    openflow:3:1    openflow:3:2    openflow:3:3
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements At URI    ${OPERATIONAL_NODES_API}    ${list}
 
 Check Ports STP status
     [Documentation]    Check the stp status of the ports (forwarding/discarding)
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
-    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
 
 Ping Test
     [Documentation]    Ping h1 to h2, verify no packet loss or duplicates
@@ -41,6 +41,51 @@ Ping Test
     Should Contain    ${result}    1 received, 0% packet loss
     Should Not Contain    ${result}    duplicates
 
+Link Down
+    [Documentation]    Take link s1-s2 down and verify ping works
+    Write    link s1 s2 down
+    Read Until    mininet>
+    @{list}    Create List    ${DISCARD}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Write    h1 ping -w 1 h2
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    received, 0% packet loss
+    Should Not Contain    ${result}    duplicates
+
+Link Up
+    [Documentation]    Take link s1-s2 up and verify ping works
+    Write    link s1 s2 up
+    Read Until    mininet>
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Write    h1 ping -w 1 h2
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    received, 0% packet loss
+    Should Not Contain    ${result}    duplicates
+
+Remove Port
+    [Documentation]    Remove port s1-eth2 and verify ping works
+    Write    sh ovs-vsctl del-port s1 s1-eth2
+    Read Until    mininet>
+    @{list}    Create List    ${DISCARD}
+    Wait Until Keyword Succeeds    10s    2s    Check For Elements Not At URI    ${OPERATIONAL_NODES_API}    ${list}
+    Write    h1 ping -w 1 h2
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    received, 0% packet loss
+    Should Not Contain    ${result}    duplicates
+
+Add Port
+    [Documentation]    Add port s1-eth2 and verify ping works
+    Write    sh ovs-vsctl add-port s1 s1-eth2 -- set interface s1-eth2 ofport=2
+    Read Until    mininet>
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${FORWARD}    4
+    Wait Until Keyword Succeeds    10s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_NODES_API}    ${DISCARD}    2
+    Sleep    1
+    Write    h1 ping -w 1 h2
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    received, 0% packet loss
+    Should Not Contain    ${result}    duplicates
+
 *** Keywords ***
 Start Suite
     [Documentation]    Open controller session & mininet connection and start mininet custom topo