--- /dev/null
+*** Settings ***
+Documentation Test suite for AddressObservations in RESTCONF inventory
+Suite Setup Create Session session http://${CONTROLLER}:8080 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
+${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}
+
+Ping All
+ [Documentation] Pingall, verify no packet loss
+ [Tags] Get
+ Write pingall
+ Sleep 5
+ ${result} Read
+ Should Contain ${result} 0% dropped
+ Should Not Contain ${result} X
+
+Get 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} address-tracker:addresses
+ Should Contain X Times ${resp.content} ${IP_1} 1
+ Should Contain X Times ${resp.content} ${IP_2} 1
+ Should Contain X Times ${resp.content} ${IP_3} 1
+
+Get 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} address-tracker:addresses
+ Should Contain X Times ${resp.content} ${IP_1} 1
+ Should Contain X Times ${resp.content} ${IP_2} 1
+ Should Contain X Times ${resp.content} ${IP_3} 1
+
+Get 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} address-tracker:addresses
+ Should Contain X Times ${resp.content} ${IP_1} 1
+ Should Contain X Times ${resp.content} ${IP_2} 1
+ Should Contain X Times ${resp.content} ${IP_3} 1
+
+
+
--- /dev/null
+*** Settings ***
+Documentation Test suite for L2switch's Address Tracking using mininet OF13
+Suite Setup Start Suite
+Suite Teardown Stop Suite
+Library SSHLibrary
+
+*** 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=>
+ Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
+ Write sudo ovs-vsctl set-manager ptcp:6644
+ Write sudo mn -c
+ Sleep 2
+ Write ${start}
+ Sleep 30
+ Read
+Stop Suite
+ Log Stop mininet
+ Read
+ Write exit
+ Sleep 6
+ Read
+ Close Connection
--- /dev/null
+*** Settings ***
+Documentation Test suite for FlowProgramming in RESTCONF inventory
+Suite Setup Create Session session http://${CONTROLLER}:8080 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 ***
+Get flows before ping through console
+ [Documentation] Dump flows shouldn't list any flows
+ Write sh ovs-ofctl dump-flows s1 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Not Contain ${result} actions
+ Write sh ovs-ofctl dump-flows s2 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Not Contain ${result} actions
+ Write sh ovs-ofctl dump-flows s3 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Not Contain ${result} actions
+
+# 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
+
+Ping All
+ [Documentation] Pingall, verify no packet loss
+ [Tags] Get
+ Write pingall
+ Sleep 5
+ ${result} Read
+ Should Contain ${result} 0% dropped
+ Should Not Contain ${result} X
+
+Get flows after ping through console
+ [Documentation] Dump flows should list flows
+ Write sh ovs-ofctl dump-flows s1 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Contain X Times ${result} actions 4
+ Write sh ovs-ofctl dump-flows s2 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Contain X Times ${result} actions 6
+ Write sh ovs-ofctl dump-flows s3 -O OpenFlow13
+ Sleep 5
+ ${result} Read
+ Should Contain X Times ${result} actions 4
+
+
+#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
--- /dev/null
+*** Settings ***
+Documentation Test suite for L2switch's Flow Programming using mininet OF13
+Suite Setup Start Suite
+Suite Teardown Stop Suite
+Library SSHLibrary
+
+*** 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=>
+ Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
+ Write sudo ovs-vsctl set-manager ptcp:6644
+ Write sudo mn -c
+ Sleep 2
+ Write ${start}
+ Sleep 30
+ Read
+Stop Suite
+ Log Stop mininet
+ Read
+ Write exit
+ Sleep 6
+ Read
+ Close All Connections
--- /dev/null
+*** Settings ***
+Documentation Test suite for Ring/Loop topology of size 3
+Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS_XML}
+Suite Teardown Delete All Sessions
+Library Collections
+Library ../../../libraries/RequestsLibrary.py
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
+
+*** 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
+
--- /dev/null
+*** Settings ***
+Documentation Test suite for Pinging in Ring/Loop topology of size 3
+Suite Setup Create Session session http://${CONTROLLER}:8080 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
+ [Tags] Get
+ Write pingall
+ Sleep 5
+ ${result} Read
+ 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
+ [Tags] Get
+ Write h1 ping -w 6 h2
+ Sleep 5
+ Write h2 ping -w 6 h1
+ Sleep 5
+ ${result} Read
+ Should Contain ${result} 0% packet loss
+ Should Not Contain ${result} duplicates
+
--- /dev/null
+*** Settings ***
+Documentation Test suite for L2switch's LoopRemoval using mininet OF13
+Suite Setup Start Suite
+Suite Teardown Stop Suite
+Library SSHLibrary
+
+*** Variables ***
+${start}= sudo mn --controller=remote,ip=${CONTROLLER} --custom ${USER_HOME}/integration/test/csit/suites/l2switch/topologies/loop.py --topo loop --switch ovsk,protocols=OpenFlow13
+
+** Keywords ***
+Start Suite
+ Log Start mininet
+ Open Connection ${MININET} prompt=>
+ Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
+ Write sudo ovs-vsctl set-manager ptcp:6644
+ Write sudo mn -c
+ Sleep 2
+ Write ${start}
+ Sleep 30
+ Read
+Stop Suite
+ Log Stop mininet
+ Read
+ Write exit
+ Sleep 6
+ Read
+ Close Connection
--- /dev/null
+#!/usr/bin/python
+
+# usage: sudo mn --controller=remote,ip=<controller_ip> --switch=ovsk,protocols=OpenFlow13 --custom <path to createtopo.py> --topo loop ...
+
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import RemoteController
+from mininet.cli import CLI
+
+class LoopTopo(Topo):
+ def __init__(self, switches = 3, hosts_per = 1, **opts):
+ Topo.__init__(self, **opts)
+ sws = []
+ hnum = 0
+ for i in range(switches):
+ sw = self.addSwitch('s%s' % (i+ 1))
+
+ for _ in range(hosts_per):
+ hnum += 1
+ host = self.addHost('h%s' % hnum)
+ self.addLink(sw, host)
+
+ for rhs in sws:
+ self.addLink(sw, rhs)
+
+ sws.append(sw)
+
+topos = { 'loop': LoopTopo }
\ No newline at end of file