New L2Switch suite to catch standing issues
authorLuis Gomez <ecelgp@gmail.com>
Thu, 30 Apr 2015 22:03:57 +0000 (15:03 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 7 May 2015 04:46:43 +0000 (04:46 +0000)
Addressing Jamo's comments

Change-Id: Ida139aa9387e5c10b25ab912cfbc9d823d54b5cd
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
12 files changed:
test/csit/libraries/Utils.txt
test/csit/suites/l2switch/Address_Tracking_OF13/010__restconf_inv_addresses.robot
test/csit/suites/l2switch/Address_Tracking_OF13/__init__.robot
test/csit/suites/l2switch/Flow_Programming_OF13/010__restconf_inv_flows.robot
test/csit/suites/l2switch/Flow_Programming_OF13/__init__.robot
test/csit/suites/l2switch/Host_Tracking_OF13/010__restconf_topo_nodes.robot
test/csit/suites/l2switch/Host_Tracking_OF13/__init__.robot
test/csit/suites/l2switch/Loop_Removal_OF13/010__loop_of_3.robot
test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.robot [deleted file]
test/csit/suites/l2switch/Loop_Removal_OF13/__init__.robot [deleted file]
test/csit/testplans/l2switch-switch.txt
test/csit/variables/Variables.py

index f1a80d1fc1314297ff034d625a4952e616090bc9..199c58e00c55b8e9b4eaaef2719d1cfd42ce5875 100644 (file)
@@ -46,7 +46,7 @@ Check Nodes Stats
     [Arguments]    ${node}
     [Documentation]    A GET on the /node/${node} API is made and specific flow stat
     ...    strings are checked for existence.
-    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/${node}
+    ${resp}    RequestsLibrary.Get    session    ${OPERATIONAL_NODES_API}/node/${node}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    flow-capable-node-connector-statistics
     Should Contain    ${resp.content}    flow-table-statistics
@@ -56,7 +56,7 @@ Check That Port Count Is Ok
     [Documentation]    A GET on the /port API is made and the specified port ${count} is
     ...    verified. A more generic Keyword "Check For Specific Number Of Elements At URI"
     ...    also does this work and further consolidation should be done.
-    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/${CONTAINER}/port
+    ${resp}    RequestsLibrary.Get    session    ${OPERATIONAL_NODES_API}/${CONTAINER}/port
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain X Times    ${resp.content}    ${node}    ${count}
index 475528a41fc027598382c38ceb346d263ff20655..126be9b9d83dc3aa66ffd2d8d0bede4ed0016c31 100644 (file)
@@ -1,70 +1,54 @@
 *** Settings ***
 Documentation     Test suite for AddressObservations in RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
-Library           SSHLibrary
-Library           Collections
-Library           ../../../libraries/RequestsLibrary.py
-Library           ../../../libraries/Common.py
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 ${IP_1}           "10.0.0.1"
 ${IP_2}           "10.0.0.2"
 ${IP_3}           "10.0.0.3"
 
 *** Test Cases ***
-Get list of nodes
-    [Documentation]    Get the inventory, should not contain address observations
-        ${resp}    Get    session    ${REST_CONTEXT}
-        Should Be Equal As Strings    ${resp.status_code}    200
-        Should Contain     ${resp.content}     openflow:1
-        Should Contain     ${resp.content}     openflow:2
-        Should Contain     ${resp.content}     openflow:3
-        Should Contain X Times    ${resp.content}   forwarding  4
-        Should Not Contain    ${resp.content}    ${IP_1}
-        Should Not Contain    ${resp.content}    ${IP_2}
-        Should Not Contain    ${resp.content}    ${IP_3}
+Check Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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
+
+Check Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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}
 
 Ping All
     [Documentation]    Pingall, verify no packet loss
-        Write   pingall
-        ${result}    Read Until                mininet>
-        Should Contain   ${result}   0% dropped
-        Should Not Contain    ${result}    X
-        Sleep  3 
+    Write    pingall
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    Results: 0% dropped
 
-Get node 1 addresses
+Check node 1 addresses
     [Documentation]    Get the address observations for node 1
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:1:1
-        Should Contain     ${resp.content}      openflow:1:2
-        Should Contain     ${resp.content}      addresses
-        Should Contain X Times    ${resp.content}   ${IP_1}  1
-        Should Not Contain    ${resp.content}    ${IP_2}
-        Should Not Contain    ${resp.content}    ${IP_3}
+    @{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}
 
-Get node 2 addresses
+Check node 2 addresses
     [Documentation]    Get the address observations for node 2
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:2:1
-        Should Contain     ${resp.content}      openflow:2:2
-        Should Contain     ${resp.content}      openflow:2:3
-        Should Contain     ${resp.content}      addresses
-        Should Not Contain    ${resp.content}    ${IP_1}
-        Should Contain X Times    ${resp.content}   ${IP_2}  1
-        Should Not Contain    ${resp.content}    ${IP_3}
+    @{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}
 
-Get node 3 addresses
+Check node 3 addresses
     [Documentation]    Get the address observations for node 3
-       ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}     openflow:3:1
-        Should Contain     ${resp.content}     openflow:3:2
-        Should Contain     ${resp.content}      addresses
-        Should Not Contain    ${resp.content}    ${IP_1}
-        Should Not Contain    ${resp.content}    ${IP_2}
-        Should Contain X Times    ${resp.content}   ${IP_3}  1
+    @{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}
index 033a6cca3d6b710247ec4f6b4037a2e777c16c87..7e4cd3c3b132eaf1797bd3014082607d4fc6f18f 100644 (file)
@@ -2,28 +2,8 @@
 Documentation     Test suite for L2switch's Address Tracking using mininet OF13
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library     SSHLibrary
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13
-
-** Keywords ***
-Start Suite
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>  timeout=30
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Read Until    >
-    Write    sudo mn -c
-    Read Until    >
-    Read Until    >
-    Read Until    >
-    Write    ${start}
-    Read Until    mininet>
-    Sleep      30
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit
-    Read Until    >
-    Close Connection
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13
index f6e438966e940456994147a5f9f04fb7b0b1ea52..3a5ad2ed98c1cd7939810ea53f8f2bd5f9ab5ede 100644 (file)
@@ -1,58 +1,33 @@
-** Settings ***
+*** Settings ***
 Documentation     Test suite for FlowProgramming in RESTCONF inventory
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
-Library           SSHLibrary
 Library           Collections
-Library           ../../../libraries/RequestsLibrary.py
-Library           ../../../libraries/Common.py
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
 
 *** Test Cases ***
-Get flows before ping through console
-    [Documentation]    Dump flows should list initial flows (drop, arp, lldp, flood per port)
-        Write   sh ovs-ofctl dump-flows s1 -O OpenFlow13
-        ${result}    Read Until                mininet>
-        Should Contain X Times    ${result}    actions    4
-        Write   sh ovs-ofctl dump-flows s2 -O OpenFlow13
-        ${result}    Read Until        mininet>
-        Should Contain X Times    ${result}    actions    5
-        Write   sh ovs-ofctl dump-flows s3 -O OpenFlow13
-        ${result}    Read Until        mininet>
-        Should Contain X Times    ${result}    actions    4
+Check Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:1
 
-# Get flows before ping through restconf
-#    [Documentation]    Get the inventory, should not contain flows
-#        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1/table/0
-#        Should Be Equal As Strings    ${resp.status_code}    200
-#        Should Not Contain    ${resp.content}    flow
+Check Stats for node 2
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:2
 
-Ping All
-    [Documentation]    Pingall, verify no packet loss
-        Write   pingall
-        ${result}    Read Until                mininet>
-        Should Contain   ${result}   0% dropped
-        Should Not Contain    ${result}    X
+Check Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    2s    Check Nodes Stats    openflow:3
 
-#Get flows after ping through console
-#    [Documentation]    Dump flows should list flows
-#        Write   sh ovs-ofctl dump-flows s1 -O OpenFlow13
-#        ${result}    Read Until       mininet>
-#        Should Contain X Times    ${result}    actions    4
-#        Write   sh ovs-ofctl dump-flows s2 -O OpenFlow13
-#        Sleep   5
-#        ${result}    Read Until       mininet>
-#        Should Contain X Times    ${result}    actions    6
-#        Write   sh ovs-ofctl dump-flows s3 -O OpenFlow13
-#        Sleep   5
-#        ${result}    Read Until       mininet>
-#        Should Contain X Times    ${result}    actions    4
+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
 
-
-#Get flows after ping through restconf
-#    [Documentation]    Get the inventory, should not contain flows
-#        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1/table/0
-#        Should Be Equal As Strings    ${resp.status_code}    200
+Ping All Test
+    [Documentation]    Ping all, verify no packet loss or duplicates
+    Write    pingall
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    Results: 0% dropped
index 8bf7a108ee988a769acefe04a989a0660d74376f..67188c186572f5e2aebd8dc3d23c3b808a7c867f 100644 (file)
@@ -2,28 +2,8 @@
 Documentation     Test suite for L2switch's Flow Programming using mininet OF13
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library     SSHLibrary
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13
-
-** Keywords ***
-Start Suite
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>  timeout=30
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Read Until    >
-    Write    sudo mn -c
-    Read Until    >
-    Read Until    >
-    Read Until    >
-    Write    ${start}
-    Read Until    mininet>
-    Sleep      15
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit
-    Read Until    >
-    Close All Connections
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo=tree,2 --switch ovsk,protocols=OpenFlow13
index add2532f6dd017e543cb66a154643fc4b4bfb299..f5e35a5a3e16327241d2e7f501c22784e9ac6f89 100644 (file)
@@ -2,14 +2,11 @@
 Documentation     Test suite for Address in RESTCONF topology
 Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
-Library           SSHLibrary
-Library           Collections
-Library           ../../../libraries/RequestsLibrary.py
-Library           ../../../libraries/Common.py
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${REST_TOPO}      /restconf/operational/network-topology:network-topology
 ${MAC_1}          00:00:00:00:00:01
 ${MAC_2}          00:00:00:00:00:02
 ${MAC_3}          00:00:00:00:00:03
@@ -18,42 +15,46 @@ ${IP_2}           10.0.0.2
 ${IP_3}           10.0.0.3
 
 *** Test Cases ***
-Get list of host from network topology
+Check Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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
+
+Check Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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
+
+Check No Host Is Present
     [Documentation]    Get the network topology, should not contain any host address
-    ${resp}    Get    session    ${REST_TOPO}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain    ${resp.content}    openflow:1
-    Should Contain    ${resp.content}    openflow:2
-    Should Contain    ${resp.content}    openflow:3
-    Should Contain X Times    ${resp.content}    link-id    4
-    Should Not Contain    ${resp.content}    ${MAC_1}
-    Should Not Contain    ${resp.content}    ${MAC_2}
-    Should Not Contain    ${resp.content}    ${MAC_3}
+    @{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
 
 Ping All
     [Documentation]    Pingall, verify no packet loss
     Write    pingall
     ${result}    Read Until    mininet>
-    Should Contain    ${result}    0% dropped
-    Should Not Contain    ${result}    X
-    Sleep    3
+    Should Contain    ${result}    Results: 0% dropped
+
+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
+
+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
+
+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
 
-Host Tracker
+Host Tracker host3
     [Documentation]    Get the network topology,
-    ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Log    ${resp.content}
-    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_1}"    1
-    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_2}"    1
-    Should Contain X Times    ${resp.content}    "node-id":"host:${MAC_3}"    1
-
-Check host are deleted
-    [Documentation]    Closing mininet this will remove the switch and the host should also be deleted
-    Log    closing mininet
-    write    exit
-    Read Until    >
-    sleep    5
-    ${resp}    Get    session    ${REST_TOPO}/topology/flow:1
-    Should Be Equal as Strings    ${resp.status_code}    200
-    Should not Contain    ${resp.content}    "node-id":"host
-    Log    ${resp.content}
+    Wait Until Keyword Succeeds    30s    2s    Check For Specific Number Of Elements At URI    ${OPERATIONAL_TOPO_API}    "node-id":"host:${MAC_3}"    1
index bb8e7aa880a5ac185be97ec9d3dfcff0b49039e6..f659b29bfd0d486c89ba135b5468a2783a54743b 100644 (file)
@@ -2,24 +2,8 @@
 Documentation     Test suite for L2switch's Address Tracking using mininet OF13
 Suite Setup       Start Suite
 Suite Teardown    Stop Suite
-Library     SSHLibrary
+Library           SSHLibrary
+Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13 --mac
-
-** Keywords ***
-Start Suite
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>   timeout=20
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Read Until    >
-    Write    sudo mn -c
-    Read Until    >
-    Read Until    >
-    Read Until    >
-    Write    ${start}
-    Read Until    mininet>
-    Sleep               30
-Stop Suite
-    Close Connection
+${start}          sudo mn --controller=remote,ip=${CONTROLLER} --topo=linear,3 --switch ovsk,protocols=OpenFlow13 --mac
index 18d52aefe73b17a57039f8c89976de858f84303f..4b308d7512c2847f5e3a00ab906f3b07b8ee919e 100644 (file)
@@ -1,47 +1,66 @@
 *** Settings ***
 Documentation     Test suite for Ring/Loop topology of size 3
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
-Suite Teardown    Delete All Sessions
-Library           Collections
-Library           ../../../libraries/RequestsLibrary.py
-Library           ../../../libraries/Common.py
+Suite Setup       Start Suite
+Suite Teardown    Stop Suite
+Library           RequestsLibrary
+Resource          ../../../libraries/Utils.txt
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
+${FORWARD}        "stp-status-aware-node-connector:status":"forwarding"
+${DISCARD}        "stp-status-aware-node-connector:status":"discarding"
 
 *** Test Cases ***
-Get opendaylight-inventory
-    [Documentation]    Get all nodes and all link states (forwarding/discarding)
-       ${resp}    Get    session    ${REST_CONTEXT}
-        Should Be Equal As Strings    ${resp.status_code}    200
-        Should Contain     ${resp.content}     openflow:1
-        Should Contain     ${resp.content}     openflow:2
-        Should Contain     ${resp.content}     openflow:3
-        Should Contain X Times    ${resp.content}   forwarding  4
-        Should Contain X Times    ${resp.content}   discarding  2
-
-Get nodeconnectors for node 1
-    [Documentation]    Get the inventory for node 1
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:1
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:1:1
-        Should Contain     ${resp.content}      openflow:1:2
-        Should Contain     ${resp.content}      openflow:1:3
-
-Get nodeconnectors for node 2
-    [Documentation]    Get the inventory for node 2
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:2
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:2:1
-        Should Contain     ${resp.content}      openflow:2:2
-        Should Contain     ${resp.content}      openflow:2:3
-
-Get nodeconnectors for node 3
-    [Documentation]    Get the inventory for node 3
-        ${resp}    Get    session    ${REST_CONTEXT}/node/openflow:3
-        Should Be Equal As Strings   ${resp.status_code}    200
-        Should Contain     ${resp.content}      openflow:3:1
-        Should Contain     ${resp.content}      openflow:3:2
-        Should Contain     ${resp.content}      openflow:3:3
+Check Stats for node 1
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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
+
+Check Stats for node 3
+    [Documentation]    Get the stats for a node
+    Wait Until Keyword Succeeds    30s    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}
+
+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
+
+Ping Test
+    [Documentation]    Ping h1 to h2, verify no packet loss or duplicates
+    Write    h1 ping -w 1 h2
+    ${result}    Read Until    mininet>
+    Should Contain    ${result}    1 received, 0% packet loss
+    Should Not Contain    ${result}    duplicates
+
+*** Keywords ***
+Start Suite
+    [Documentation]    Open controller session & mininet connection and start mininet custom topo
+    Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    ${start}=    Set Variable    sudo mn --controller=remote,ip=${CONTROLLER} --custom customtopo.py --topo ring --switch ovsk,protocols=OpenFlow13
+    ${mininet_conn_id}=    Open Connection    ${MININET}    prompt=${linux_prompt}    timeout=30s
+    Set Suite Variable    ${mininet_conn_id}
+    Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
+    Put File    ${CURDIR}/../topologies/customtopo.py
+    Execute Command    sudo ovs-vsctl set-manager ptcp:6644
+    Execute Command    sudo mn -c
+    Write    ${start}
+    Read Until    mininet>
+
+Stop Suite
+    [Documentation]    Stop mininet topo and close connections & sessions
+    Log    Stop the test on the base edition
+    Switch Connection    ${mininet_conn_id}
+    Read
+    Write    exit
+    Read Until    ${linux_prompt}
+    Close Connection
+    Delete All Sessions
diff --git a/test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.robot b/test/csit/suites/l2switch/Loop_Removal_OF13/020__ping.robot
deleted file mode 100644 (file)
index 0b95906..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-*** Settings ***
-Documentation     Test suite for Pinging in Ring/Loop topology of size 3
-Suite Setup       Create Session   session   http://${CONTROLLER}:${RESTCONFPORT}   auth=${AUTH}   headers=${HEADERS_XML}
-Suite Teardown    Delete All Sessions
-Library           SSHLibrary
-Library           Collections
-Library           ../../../libraries/RequestsLibrary.py
-Library           ../../../libraries/Common.py
-Variables         ../../../variables/Variables.py
-
-*** Variables ***
-${REST_CONTEXT}    /restconf/operational/opendaylight-inventory:nodes
-
-*** Test Cases ***
-Ping All
-    [Documentation]    Pingall, verify no packet loss
-        Write   pingall
-        ${result}    Read Until                mininet>
-        Should Contain   ${result}   0% dropped
-        Should Contain X Times    ${result}   h1    3
-        Should Contain X Times    ${result}   h2    3
-        Should Contain X Times    ${result}   h3    3
-        Should Not Contain    ${result}    X
-
-
-Ping h1 to h2
-    [Documentation]    Ping h1 to h2, verify no packet loss or duplicates
-        Write   h1 ping -w 6 h2
-        Read Until     mininet>
-        Write   h2 ping -w 6 h1
-        ${result}    Read Until                mininet>
-        Should Contain   ${result}   0% packet loss
-        Should Not Contain    ${result}    duplicates
-
diff --git a/test/csit/suites/l2switch/Loop_Removal_OF13/__init__.robot b/test/csit/suites/l2switch/Loop_Removal_OF13/__init__.robot
deleted file mode 100644 (file)
index 1aeeb51..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-*** Settings ***
-Documentation     Test suite for L2switch's LoopRemoval using mininet OF13
-Suite Setup       Start Suite
-Suite Teardown    Stop Suite
-Library     SSHLibrary
-Library     OperatingSystem
-
-*** Variables ***
-${start}=  sudo mn --controller=remote,ip=${CONTROLLER} --custom customtopo.py --topo ring --switch ovsk,protocols=OpenFlow13
-
-** Keywords ***
-Start Suite
-    Log    Start mininet
-    Open Connection   ${MININET}     prompt=>  timeout=30
-    Login With Public Key    ${MININET_USER}   ${USER_HOME}/.ssh/id_rsa   any
-    Write    sudo ovs-vsctl set-manager ptcp:6644
-    Read Until    >
-    Write    sudo mn -c
-    Read Until    >
-    Read Until    >
-    Read Until    >
-    Put File    ${CURDIR}/../topologies/customtopo.py
-    Write    ${start}
-    Read Until    mininet>
-    Sleep      10
-Stop Suite
-    Log    Stop mininet
-    Read
-    Write    exit
-    Read Until    >
-    Read
-    Close Connection
index 516594098a8fa237a09856efd910a9bab8676ceb..8fbff2d258e1e7fad25b7fc85416f844061fe3a9 100644 (file)
@@ -1,5 +1,9 @@
 # Place the suites in run order:
-integration/test/csit/suites/l2switch/Address_Tracking_OF13
 integration/test/csit/suites/l2switch/Flow_Programming_OF13
-integration/test/csit/suites/l2switch/Loop_Removal_OF13
+integration/test/csit/suites/l2switch/Flow_Programming_OF13
+integration/test/csit/suites/l2switch/Address_Tracking_OF13
+integration/test/csit/suites/l2switch/Address_Tracking_OF13
+integration/test/csit/suites/l2switch/Host_Tracking_OF13
 integration/test/csit/suites/l2switch/Host_Tracking_OF13
+integration/test/csit/suites/l2switch/Loop_Removal_OF13
+integration/test/csit/suites/l2switch/Loop_Removal_OF13
index d822ea539995d60ca1c1508f51adcb70ce477dd9..3e82ad969850764e2ac17cc57c3b4b54fc73d904 100644 (file)
@@ -66,8 +66,9 @@ VLANMAP_CREATE = 'vlanmaps.json'
 # ports URL
 PORTS = 'ports/detail.json'
 
-# nodes
+# Common APIs
 OPERATIONAL_NODES_API = '/restconf/operational/opendaylight-inventory:nodes'
+OPERATIONAL_TOPO_API = '/restconf/operational/network-topology:network-topology'
 
 # TOKEN
 AUTH_TOKEN_API = '/oauth2/token'