moving a simple test for 3 node ofp cluster from tools to csit 79/23979/4
authorPeter Gubka <pgubka@cisco.com>
Fri, 10 Jul 2015 11:49:48 +0000 (13:49 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 4 Aug 2015 08:05:22 +0000 (08:05 +0000)
DynamicMininet - adding functions to start switch(es) with multiple controllers
XmlComparator - added function to create flow xml content
removing unused code
minor improvements to robot, replacing urls with variables

Change-Id: I6c641217c5713450c932d065df0cd4b4d2a7da79
Signed-off-by: Peter Gubka <pgubka@cisco.com>
test/csit/libraries/DynamicMininet.py
test/csit/libraries/XmlComparator.py
test/csit/suites/openflowplugin/Sanity3Node/010__Flows_OF13_Cluster.robot [new file with mode: 0644]
test/csit/suites/openflowplugin/Sanity3Node/__init__.robot [moved from test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/__init__.txt with 76% similarity]
test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/010__Flows_OF13_Cluster.txt [deleted file]
test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/SanityLibrary.py [deleted file]
test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/mininetwork.py [deleted file]

index dc77db81c8783b9fa53d593029e531dfa45d85d1..6e274c6da6d6e65ea36e747ae9d1bf136bce6c69 100644 (file)
@@ -12,6 +12,7 @@ import mininet.net
 import mininet.util
 from mininet.node import RemoteController
 from mininet.node import OVSKernelSwitch
+from subprocess import call
 
 
 class DynamicMininet(cmd.Cmd):
@@ -19,11 +20,19 @@ class DynamicMininet(cmd.Cmd):
 
     - when starting this CLI the 'mininet> ' cli appears, but no switches are active
     - topology is very simple, just as many single switches without any hosts nor links
-    - how to use it:
+
+    How to use it:
+    - one possible scenario is for measuring max connected switches
        1) start cli
        2) start mininet using command 'start <controller> <num>'
        3) add another switches using 'add_switch' or 'add_switches <num>'
        4) stop mininet usinf 'exit'
+    - another scenario is connect one single switch to multiple controllers or clustered controller
+      for feature testing
+       1) start cli
+       2) start mininet with specified controllers using command 'start_with_cluster <cntl>[,<cntl>[...]]>'
+       3) stop mininet using 'exit'
+    Note: Do not mix scanarios
     """
 
     prompt = 'mininet> '
@@ -64,6 +73,73 @@ class DynamicMininet(cmd.Cmd):
         print '\tcontroller_ip - controllers ip or host name'
         print '\tnum           - number of switches at start'
 
+    def do_start_with_cluster(self, line):
+        """Starts mininet network with initial number of switches
+
+        Args:
+            :param controller_ips: list of controller ip addresses or host names
+                                   e.g.  1.1.1.1,2.2.2.2,3.3.3.3 (no spaces)
+        """
+        if self._running:
+            print 'Mininet topology is already active'
+            return
+        cntls = line.split(',')
+
+        self._topo = mininet.topo.SingleSwitchTopo()
+        switch = mininet.util.customConstructor({'ovsk': OVSKernelSwitch}, 'ovsk,protocols=OpenFlow13')
+        self._net = mininet.net.Mininet(switch=switch)
+
+        controllers = []
+        for i, cntl_ip in enumerate(cntls):
+            cnt = self._net.addController('c{0}'.format(i), controller=RemoteController, ip=cntl_ip, port=6633)
+            controllers.append(cnt)
+            print "contrller {0} created".format(cnt)
+
+        self._net.buildFromTopo(topo=self._topo)
+        self._net.start()
+        self._running = True
+
+    def help_start_with_cluster(self):
+        """Provide help message for start_with_cluster command"""
+        print 'Starts mininet with one switch'
+        print 'Usage: start <controller_ips>'
+        print '\tcontroller_ips - comma separated list of controllers ip or host names'
+
+    def do_start_switches_with_cluster(self, line):
+        """Starts mininet network with initial number of switches
+
+        Args:
+            :param swnr: number of switchers in topology
+            :param controller_ips: list of controller ip addresses or host names
+                                   e.g.  1.1.1.1,2.2.2.2,3.3.3.3 (no spaces)
+        """
+        if self._running:
+            print 'Mininet topology is already active'
+            return
+        num, contls = line.split()
+        cntls = contls.split(',')
+
+        self._topo = mininet.topo.LinearTopo(int(num))
+        switch = mininet.util.customConstructor({'ovsk': OVSKernelSwitch}, 'ovsk,protocols=OpenFlow13')
+        self._net = mininet.net.Mininet(switch=switch)
+
+        controllers = []
+        for i, cntl_ip in enumerate(cntls):
+            cnt = self._net.addController('c{0}'.format(i), controller=RemoteController, ip=cntl_ip, port=6633)
+            controllers.append(cnt)
+            print "contrller {0} created".format(cnt)
+
+        self._net.buildFromTopo(topo=self._topo)
+        self._net.start()
+        self._running = True
+
+    def help_start_switches_with_cluster(self):
+        """Provide help message for start_with_cluster command"""
+        print 'Starts mininet with one switch'
+        print 'Usage: start <swnr> <controller_ips>'
+        print '\tswnt - number of switches in topology'
+        print '\tcontroller_ips - comma separated list of controllers ip or host names'
+
     def do_add_switch(self, line):
         """Adds one switch to the network
         Args:
@@ -105,11 +181,24 @@ class DynamicMininet(cmd.Cmd):
             self._running = False
         return True
 
-    def help_exit(self, line):
+    def help_exit(self):
         """Provide help message for exit command"""
         print 'Exit mininet cli'
         print 'Usage: exit'
 
+    def do_sh(self, line):
+        """Run an external shell command
+        Args:
+            :param line: text/command to be executed
+        """
+        call(line, shell=True)
+
+    def help_sh(self, line):
+        """Provide help message for sh command"""
+        print 'Executes given commandAdds one sinle switch to the running topology'
+        print 'Usage: sh <line>'
+        print '\tline - command to be executed(e.g. ps -e'
+
     def emptyline(self):
         pass
 
index 5669bf6297dad4ce9d6f0f8ea18461f15aad54dd..7bd8fff2fdf01835b5dd07721e1f7ca85e88371f 100644 (file)
@@ -324,3 +324,47 @@ class XmlComparator:
                             new_act.appendChild(ml)
                         child.parentNode.replaceChild(new_act, child)
         return xml_dom_input.toxml(encoding='utf-8')
+
+    def get_flow_content(self, tid=1, fid=1, priority=1):
+        """Returns an xml flow content identified by given details.
+
+        Args:
+            :param tid: table id
+            :param fid: flow id
+            :param priority: flow priority
+        """
+
+        flow_template = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flow xmlns="urn:opendaylight:flow:inventory">
+    <strict>false</strict>
+    <instructions>
+        <instruction>
+            <order>0</order>
+            <apply-actions>
+                <action>
+                    <order>0</order>
+                    <drop-action/>
+                </action>
+            </apply-actions>
+        </instruction>
+    </instructions>
+    <table_id>%s</table_id>
+    <id>%s</id>
+    <cookie_mask>4294967295</cookie_mask>
+    <installHw>false</installHw>
+    <match>
+        <ethernet-match>
+            <ethernet-type>
+                <type>2048</type>
+            </ethernet-type>
+        </ethernet-match>
+        <ipv4-source>10.0.0.1/32</ipv4-source>
+    </match>
+    <cookie>%s</cookie>
+    <flow-name>%s</flow-name>
+    <priority>%s</priority>
+    <barrier>false</barrier>
+</flow>'''
+
+        flow_data = flow_template % (tid, fid, fid, 'TestFlow-{0}'.format(fid), priority)
+        return flow_data
diff --git a/test/csit/suites/openflowplugin/Sanity3Node/010__Flows_OF13_Cluster.robot b/test/csit/suites/openflowplugin/Sanity3Node/010__Flows_OF13_Cluster.robot
new file mode 100644 (file)
index 0000000..467f239
--- /dev/null
@@ -0,0 +1,407 @@
+*** Settings ***
+Suite Setup       Create Controllers Sessions
+Suite Teardown    Delete All Sessions
+Library           OperatingSystem
+Library           Collections
+Library           XML
+Library           SSHLibrary
+Library           ../../../libraries/XmlComparator.py
+Variables         ../../../variables/Variables.py
+Library           RequestsLibrary
+Library           ../../../libraries/Common.py
+
+*** Variables ***
+${switch_idx}     1
+${switch_name}    s${switch_idx}
+${url_m1_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
+${url_m2_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
+${url_m3_shard}    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
+${get_pers_url}    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
+
+*** Test Cases ***
+Logging Initial Cluster Information
+    ${resp}=    Get Controller Response    session1    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session1    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-operational,type=DistributedOperationalDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session1    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session1    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session2    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session2    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-operational,type=DistributedOperationalDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session2    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session2    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session3    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session3    /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-operational,type=DistributedOperationalDatastore
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session3    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
+    Log    ${resp.content}
+    ${resp}=    Get Controller Response    session3    /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
+    Log    ${resp.content}
+
+Add Flow 1 To Controller1
+    Init Flow Variables    1    1    1
+    Log    ${data}
+    ${resp}=    Put    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Add Flow 2 To Controller2
+    Init Flow Variables    1    2    2
+    Log    ${data}
+    ${resp}=    Put    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Add Flow 3 To Controller3
+    Init Flow Variables    1    3    3
+    Log    ${data}
+    ${resp}=    Put    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}    data=${data}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Show Switch Content After Add
+    Sleep    5s
+    Write    sh ovs-vsctl show
+    Read Until    mininet>
+    Write    sh ovs-ofctl dump-flows s1 -O OpenFlow13
+    Read Until    mininet>
+
+Check Flow 1 Configured On Controller1
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 1 Operational On Controller1
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 1 Configured On Controller2
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 1 Operational On Controller2
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 1 Configured On Controller3
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 1 Operational On Controller3
+    Init Flow Variables    1    1    1
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Configured On Controller1
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Operational On Controller1
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Configured On Controller2
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Operational On Controller2
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Configured On Controller3
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 2 Operational On Controller3
+    Init Flow Variables    1    2    2
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Configured On Controller1
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Operational On Controller1
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Configured On Controller2
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Operational On Controller2
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Configured On Controller3
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Configured    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Check Flow 3 Operational On Controller3
+    Init Flow Variables    1    3    3
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${True}    ${pres}    msg=${msg}
+
+Delete Flow 1 On Controller1
+    Init Flow Variables    1    1    1
+    ${resp}=    Delete    session1    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Delete Flow 2 On Controller2
+    Init Flow Variables    1    2    2
+    ${resp}=    Delete    session2    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Delete Flow 3 On Controller3
+    Init Flow Variables    1    3    3
+    ${resp}=    Delete    session3    ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+    Log    ${resp.content}
+    ${msg}=    Set Variable    Delete flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+    Should Be Equal As Strings    ${resp.status_code}    200    msg=${msg}
+
+Show Switch Content After Delete
+    Sleep    5s
+    Write    sh ovs-ofctl dump-flows s1 -O OpenFlow13
+    Read Until    mininet>
+
+Check Flow 1 Not Configured On Controller1
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 1 Not Operational On Controller1
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 1 Not Configured On Controller2
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 1 Not Operational On Controller2
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 1 Not Configured On Controller3
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 1 Not Operational On Controller3
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 2 Not Configured On Controller1
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 2 Not Operational On Controller1
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 2 Not Configured On Controller2
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 2 Not Operational On Controller2
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 2 Not Configured On Controller3
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 2 Not Operational On Controller3
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 3 Not Configured On Controller1
+    ${resp}=    Get Controller Response    session1    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 3 Not Operational On Controller1
+    ${resp}=    Get Controller Response    session1    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 3 Not Configured On Controller2
+    ${resp}=    Get Controller Response    session2    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 3 Not Operational On Controller2
+    ${resp}=    Get Controller Response    session2    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+Check Flow 3 Not Configured On Controller3
+    ${resp}=    Get Controller Response    session3    ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    404
+
+Check Flow 3 Not Operational On Controller3
+    ${resp}=    Get Controller Response    session3    ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${pres}    ${msg}=    Is Flow Operational2    ${data}    ${resp.content}
+    Run Keyword If    '''${msg}'''!='${EMPTY}'    Log    ${msg}
+    Should Be Equal    ${False}    ${pres}    msg=${msg}
+
+*** Keywords ***
+Init Flow Variables
+    [Arguments]    ${tableid}    ${flowid}    ${priority}
+    ${data}=    Get Flow Content    ${tableid}    ${flowid}    ${priority}
+    ${xmlroot}=    Parse Xml    ${data}
+    ${table_id}=    Set Variable    ${tableid}
+    ${flow_id}=    Set Variable    ${flowid}
+    ${flow_priority}=    Set Variable    ${priority}
+    Set Suite Variable    ${table_id}
+    Set Suite Variable    ${flow_id}
+    Set Suite Variable    ${flow_priority}
+    Set Suite Variable    ${data}
+    Set Suite Variable    ${xmlroot}
+
+Create Controllers Sessions
+    Create Session    session1    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    Create Session    session2    http://${CONTROLLER1}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+    Create Session    session3    http://${CONTROLLER2}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+
+Get Controller Response
+    [Arguments]    ${session}    ${url}
+    ${headers}=    Create Dictionary    Accept    application/xml
+    ${resp}=    Get    ${session}    ${url}    headers=${headers}
+    Return From Keyword    ${resp}
similarity index 76%
rename from test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/__init__.txt
rename to test/csit/suites/openflowplugin/Sanity3Node/__init__.robot
index b505689d4f7081e14344b5a2b3847c1ed048123e..c23a8f06167d06780d40760d621f5edead08a5f3 100644 (file)
@@ -5,7 +5,7 @@ Suite Teardown    Stop Suite
 Library           SSHLibrary
 
 *** Variables ***
-${start}          sudo python mininetwork.py --controllers=${CONTROLLER},${CONTROLLER1},${CONTROLLER2}
+${start}          sudo python DynamicMininet.py
 ${linux_prompt}    >
 
 *** Keywords ***
@@ -13,11 +13,13 @@ Start Suite
     Log    Start the test on the base edition
     Open Connection    ${MININET}    prompt=>
     Login With Public Key    ${MININET_USER}    ${USER_HOME}/.ssh/id_rsa    any
-    Put File    ${CURDIR}/mininetwork.py    mininetwork.py
+    Put File    ${CURDIR}/../../../libraries/DynamicMininet.py    .
     Execute Command    sudo ovs-vsctl set-manager ptcp:6644
     Execute Command    sudo mn -c
     Write    ${start}
     Read Until    mininet>
+    Write    start_with_cluster ${CONTROLLER},${CONTROLLER1},${CONTROLLER2}
+    Read Until    mininet>
 
 Stop Suite
     Log    Stop the test on the base edition
diff --git a/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/010__Flows_OF13_Cluster.txt b/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/010__Flows_OF13_Cluster.txt
deleted file mode 100644 (file)
index 7025b03..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-*** Settings ***
-Library        OperatingSystem
-Library        Collections
-Library        XML
-Library        SSHLibrary
-Library        ../../../../csit/libraries/XmlComparator.py
-Variables      ../../../../csit/variables/Variables.py
-Library        ../../../../csit/libraries/RequestsLibrary.py
-Library        ../../../../csit/libraries/Common.py
-Library        SanityLibrary.py
-Suite Setup       Create Controllers Sessions
-Suite Teardown    Delete All Sessions
-
-*** Variables ***
-#${member1}=        ODLVM1
-#${member2}=        ODLVM2
-#${member3}=        ODLVM3
-${switch_idx}=     1
-${switch_name}=    s${switch_idx}
-${url_m1_shard}=   /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
-${url_m2_shard}=   /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
-${url_m3_shard}=   /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
-${get_pers_url}=   /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
-
-*** Test Cases ***
-Logging Initial Cluster Information
-    ${resp}=   Get Controller Response   session1  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-config,type=DistributedConfigDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session1  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-1-shard-inventory-operational,type=DistributedOperationalDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session1  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session1  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session2  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-config,type=DistributedConfigDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session2  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-2-shard-inventory-operational,type=DistributedOperationalDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session2  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session2  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session3  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-config,type=DistributedConfigDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session3  /jolokia/read/org.opendaylight.controller:Category=Shards,name=member-3-shard-inventory-operational,type=DistributedOperationalDatastore
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session3  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-config-datastore-provider/distributed-config-store-module
-    Log   ${resp.content}
-    ${resp}=   Get Controller Response   session3  /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/distributed-datastore-provider:distributed-operational-datastore-provider/distributed-operational-store-module
-    Log   ${resp.content}
-Add Flow 1 To Controller1
-    Init Flow Variables    1   1   1
-    Log             ${data}
-    ${resp}=        Putxml    session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}   data=${data}
-    Log             ${resp.content}
-    ${msg}=  Set Variable   Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Add Flow 2 To Controller2
-    Init Flow Variables    1   2   2
-    Log             ${data}
-    ${resp}=        Putxml    session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}   data=${data}
-    Log             ${resp.content}
-    ${msg}=  Set Variable   Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Add Flow 3 To Controller3
-    Init Flow Variables    1   3   3
-    Log             ${data}
-    ${resp}=        Putxml    session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}   data=${data}
-    Log             ${resp.content}
-    ${msg}=  Set Variable   Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-    Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Show Switch Content After Add
-     Sleep  20s
-     Write    dpctl dump-flows -O OpenFlow13
-     Sleep  1s
-     ${switchouput}    Read
-     Log     ${switchouput}
-Check Flow 1 Configured On Controller1
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 1 Operational On Controller1
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 1 Configured On Controller2
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 1 Operational On Controller2
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 1 Configured On Controller3
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 1 Operational On Controller3
-   Init Flow Variables   1    1    1
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Configured On Controller1
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Operational On Controller1
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Configured On Controller2
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Operational On Controller2
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Configured On Controller3
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 2 Operational On Controller3
-   Init Flow Variables   1    2    2
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Configured On Controller1
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Operational On Controller1
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Configured On Controller2
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Operational On Controller2
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Configured On Controller3
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Configured  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Check Flow 3 Operational On Controller3
-   Init Flow Variables   1    3    3
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${True}  ${pres}   msg=${msg}
-Delete Flow 1 On Controller1
-      Init Flow Variables    1   1   1
-      ${resp}=  Delete   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-      Log             ${resp.content}
-      ${msg}=  Set Variable  Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Delete Flow 2 On Controller2
-      Init Flow Variables    1   2   2
-      ${resp}=  Delete   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-      Log             ${resp.content}
-      ${msg}=  Set Variable  Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Delete Flow 3 On Controller3
-      Init Flow Variables    1   3   3
-      ${resp}=  Delete   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
-      Log             ${resp.content}
-      ${msg}=  Set Variable  Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
-      Should Be Equal As Strings   ${resp.status_code}   200   msg=${msg}
-Show Switch Content After Delete
-     Sleep  20s
-     Write    dpctl dump-flows -O OpenFlow13
-     Sleep  1s
-     ${switchouput}    Read
-     Log     ${switchouput}
-Check Flow 1 Not Configured On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 1 Not Operational On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 1 Not Configured On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 1 Not Operational On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 1 Not Configured On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 1 Not Operational On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 2 Not Configured On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 2 Not Operational On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 2 Not Configured On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 2 Not Operational On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 2 Not Configured On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/2
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 2 Not Operational On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 3 Not Configured On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 3 Not Operational On Controller1
-   ${resp}=   Get Controller Response   session1   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 3 Not Configured On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 3 Not Operational On Controller2
-   ${resp}=   Get Controller Response   session2   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-Check Flow 3 Not Configured On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/flow/3
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  404
-Check Flow 3 Not Operational On Controller3
-   ${resp}=   Get Controller Response   session3   /restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/1
-   Log    ${resp.content}
-   Should Be Equal As Strings  ${resp.status_code}  200
-   ${pres}  ${msg}=  Is Flow Operational2  ${data}   ${resp.content}
-   Run Keyword If   '''${msg}'''!='${EMPTY}'   Log   ${msg}
-   Should Be Equal  ${False}  ${pres}   msg=${msg}
-*** Keywords ***
-Init Flow Variables   [Arguments]   ${tableid}  ${flowid}  ${priority}
-      ${data}=       Get Flow Content   ${tableid}  ${flowid}  ${priority}
-      ${xmlroot}=    Parse Xml    ${data}
-      ${table_id}=   Set Variable  ${tableid}
-      ${flow_id}=    Set Variable  ${flowid}
-      ${flow_priority}=    Set Variable  ${priority}
-      Set Suite Variable   ${table_id}
-      Set Suite Variable   ${flow_id}
-      Set Suite Variable   ${flow_priority}
-      Set Suite Variable   ${data}
-      Set Suite Variable   ${xmlroot}
-Create Controllers Sessions
-    Create Session    session1    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
-    Create Session    session2    http://${CONTROLLER1}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
-    Create Session    session3    http://${CONTROLLER2}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
-Get Controller Response  [Arguments]  ${session}  ${url}
-    ${headers}=      Create Dictionary   Accept   application/xml
-    ${resp}=   Get  ${session}  ${url}   headers=${headers}
-    Return From Keyword   ${resp}
-
diff --git a/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/SanityLibrary.py b/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/SanityLibrary.py
deleted file mode 100644 (file)
index 6f2bfa5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-import json
-
-
-class SanityLibrary:
-
-    def get_flow_content(self, tid=1, fid=1, priority=1):
-
-        flow_template = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<flow xmlns="urn:opendaylight:flow:inventory">
-    <strict>false</strict>
-    <instructions>
-        <instruction>
-            <order>0</order>
-            <apply-actions>
-                <action>
-                    <order>0</order>
-                    <drop-action/>
-                </action>
-            </apply-actions>
-        </instruction>
-    </instructions>
-    <table_id>%s</table_id>
-    <id>%s</id>
-    <cookie_mask>4294967295</cookie_mask>
-    <installHw>false</installHw>
-    <match>
-        <ethernet-match>
-            <ethernet-type>
-                <type>2048</type>
-            </ethernet-type>
-        </ethernet-match>
-        <ipv4-source>10.0.0.1</ipv4-source>
-    </match>
-    <cookie>%s</cookie>
-    <flow-name>%s</flow-name>
-    <priority>%s</priority>
-    <barrier>false</barrier>
-</flow>'''
-
-        flow_data = flow_template % (tid, fid, fid, 'TestFlow-{0}'.format(fid), priority)
-        return flow_data
-
-    def is_cluter_set_up(self, rsp1, rsp2, rsp3):
-        try:
-            states = []
-            for r in [rsp1, rsp2, rsp3]:
-                rj = json.loads(r)
-                states.append(rj['value']['RaftState'])
-                states.sort()
-            if states == ['Follower', 'Follower', 'Leader']:
-                return True
-        except Exception:
-            return False
-        return False
-
-    def get_persistence(self, rsp):
-        try:
-            rj = json.loads(rsp)
-            return rj['module'][0]['distributed-datastore-provider:config-properties']['persistent']
-        except:
-            pass
diff --git a/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/mininetwork.py b/test/tools/OF_Test/robot_suites/500__OF_Cluster_Sanity_OF/mininetwork.py
deleted file mode 100644 (file)
index ef0d2f8..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/python
-
-from mininet.net import Mininet
-from mininet.node import OVSKernelSwitch, RemoteController
-from mininet.cli import CLI
-import multiprocessing
-import time
-import argparse
-
-
-d = 11
-c = 0
-b = 0
-a = 1
-
-
-def get_next_ip():
-    global a, b, c, d
-    rip = "{0}.{1}.{2}.{3}".format(d, c, b, a)
-    a += 1
-    if a == 255:
-        a = 1
-        b += 1
-    if b == 255:
-        b = 0
-        c += 1
-    if c == 255:
-        c = 0
-        d += 1
-    return rip
-
-# switchid and hostid
-hid = 0
-sid = 0
-
-
-def get_next_hid():
-    global hid
-    hid += 1
-    return hid
-
-
-def get_next_sid():
-    global sid
-    sid += 1
-    return sid
-
-
-def get_switch(net, hosts):
-    sname = 's{0}'.format(get_next_sid())
-    s = net.addSwitch(sname)
-    for i in range(hosts):
-        hname = 'h{0}'.format(get_next_hid())
-        hip = get_next_ip()
-        h = net.addHost(hname, ip=hip)
-        s.linkTo(h)
-        print "switch {0}: host {1}-{2} added".format(sname, hname, hip)
-    return s
-
-
-def get_net(switches, hostpswtich, controllers=['10.25.2.9']):
-
-    net = Mininet(controller=RemoteController, switch=OVSKernelSwitch)
-
-    cs = []
-    for i, cip in enumerate(controllers):
-        c = net.addController('c{0}'.format(i), controller=RemoteController, ip=cip, port=6633)
-        cs.append(c)
-        print "contrller {0} created".format(c)
-
-    ss = []
-    for i in range(switches):
-        s = get_switch(net, hostpswtich)
-
-    net.build()
-    for c in cs:
-        c.start()
-
-    for s in ss:
-        s.start(cs)
-
-    return net
-
-
-class MininetworkProcess(multiprocessing.Process):
-    """Base class.
-    Do NOT use this class directly.
-    """
-    def __init__(self, swithes, hps, controllers=['10.25.2.9']):
-        super(MininetworkProcess, self).__init__()
-        self._event = multiprocessing.Event()
-        self._net = get_net(swithes, hps, controllers=controllers)
-
-    def run(self):
-        self._net.start()
-        self._net.staticArp()
-        while self._event.is_set() is False:
-            time.sleep(1)
-        self._net.stop()
-
-
-if __name__ == '__main__':
-    # setLogLevel( 'info' )
-    parser = argparse.ArgumentParser(description='Starts switches with specified controllers')
-    parser.add_argument('--controllers', default='10.25.2.9',
-                        help='Comma separated list of cluster members (default ="10.25.2.9,10.25.2.10,10.25.2.11")')
-    args = parser.parse_args()
-
-    net = get_net(3, 1, controllers=args.controllers.split(','))
-
-    net.start()
-    net.staticArp()
-    CLI(net)
-    net.stop()