[ONOS-7765] Run SRMulticast test case 1 on Flex POD

Change-Id: I854d0ddf55754fd89ae8b29709e1589674c0a5fc
diff --git a/TestON/drivers/common/cli/emulator/scapyclidriver.py b/TestON/drivers/common/cli/emulator/scapyclidriver.py
index 0dd3b6b..6a24aa2 100644
--- a/TestON/drivers/common/cli/emulator/scapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/scapyclidriver.py
@@ -86,7 +86,7 @@
                                self.user_name +
                                "@" +
                                self.ip_address )
-                return main.TRUE
+                return self.handle
             else:
                 main.log.error( "Connection failed to the host " +
                                 self.user_name +
@@ -135,7 +135,7 @@
                       'bind_layers(MPLS, IP)' ]
 
         try:
-            self.handle.sendline( "scapy" )
+            self.handle.sendline( "sudo scapy" )
             self.handle.expect( self.scapyPrompt )
             self.handle.sendline( "conf.color_theme = NoTheme()" )
             self.handle.expect( self.scapyPrompt )
diff --git a/TestON/drivers/common/cli/hostdriver.py b/TestON/drivers/common/cli/hostdriver.py
index 4156902..86c0c38 100644
--- a/TestON/drivers/common/cli/hostdriver.py
+++ b/TestON/drivers/common/cli/hostdriver.py
@@ -27,9 +27,9 @@
 import os
 import time
 from math import pow
-from drivers.common.clidriver import CLI
+from drivers.common.cli.emulator.scapyclidriver import ScapyCliDriver
 
-class HostDriver( CLI ):
+class HostDriver( ScapyCliDriver ):
     """
     This class is created as a standalone host driver.
     """
@@ -39,6 +39,9 @@
         self.name = None
         self.shortName = None
         self.home = None
+        self.inband = False
+        self.prompt = "\$"
+        self.scapyPrompt = ">>>"
 
     def connect( self, **connectargs ):
         """
@@ -111,9 +114,7 @@
                 self.handle.sendline( "exit" )
                 i = self.handle.expect( [ "closed", pexpect.TIMEOUT ], timeout=2 )
                 if i == 1:
-                    main.log.error(
-                        self.name +
-                        ": timeout when waiting for response" )
+                    main.log.error( self.name + ": timeout when waiting for response" )
                     main.log.error( "response: " + str( self.handle.before ) )
         except TypeError:
             main.log.exception( self.name + ": Object not as expected" )
@@ -129,6 +130,70 @@
             response = main.FALSE
         return response
 
+    def connectInband( self ):
+        """
+        ssh to the host using its data plane IP
+        """
+        try:
+            if not self.options[ 'inband' ] == 'True':
+                main.log.info( "Skip connecting the host via data plane" )
+                return main.TRUE
+            self.handle.sendline( "" )
+            self.handle.expect( self.prompt )
+            self.handle.sendline( "ssh {}@{}".format( self.options[ 'username' ],
+                                                      self.options[ 'ip' ] ) )
+            i = self.handle.expect( [ "password:|Password:", self.prompt, pexpect.TIMEOUT ], timeout=30 )
+            if i == 0:
+                self.handle.sendline( self.options[ 'password' ] )
+                j = self.handle.expect( [ "password:|Password:", self.prompt, pexpect.TIMEOUT ], timeout=10 )
+                if j != 1:
+                    main.log.error( "Incorrect password" )
+                    return main.FALSE
+            elif i == 1:
+                main.log.info( "Password not required logged in" )
+            else:
+                main.log.error( "Failed to connect to the host" )
+                return main.FALSE
+            self.inband = True
+            return main.TRUE
+        except KeyError:
+            main.log.error( self.name + ": host component not as expected" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+
+    def disconnectInband( self ):
+        """
+        Terminate the ssh connection to the host's data plane IP
+        """
+        try:
+            if not self.options[ 'inband' ] == 'True':
+                main.log.info( "Skip disconnecting the host via data plane" )
+                return main.TRUE
+            self.handle.sendline( "" )
+            self.handle.expect( self.prompt )
+            self.handle.sendline( "exit" )
+            i = self.handle.expect( [ "closed", pexpect.TIMEOUT ], timeout=2 )
+            if i == 1:
+                main.log.error( self.name + ": timeout when waiting for response" )
+                main.log.error( "response: " + str( self.handle.before ) )
+            return main.TRUE
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+
     def ping( self, dst, ipv6=False, wait=3 ):
         """
         Description:
@@ -185,8 +250,6 @@
                     self.name +
                     ": timeout when waiting for response" )
                 main.log.error( "response: " + str( self.handle.before ) )
-            self.handle.sendline( "" )
-            self.handle.expect( self.prompt )
             response = self.handle.before
             return response
         except pexpect.EOF:
@@ -194,5 +257,52 @@
             main.log.error( self.name + ":     " + self.handle.before )
             main.cleanAndExit()
         except Exception:
-            main.log.exception( self.name + ": Uncaught exception!" )
+            main.log.exception( self.name + ": uncaught exception!" )
+            main.cleanAndExit()
+
+    def ip( self, options="a", wait=3 ):
+        """
+        Run ip command on host and return output
+        """
+        try:
+            command = "ip {}".format( options )
+            main.log.info( self.name + ": Sending: " + command )
+            self.handle.sendline( command )
+            i = self.handle.expect( [ self.prompt, pexpect.TIMEOUT ],
+                                    timeout=wait + 5 )
+            if i == 1:
+                main.log.error( self.name + ": timeout when waiting for response" )
+                main.log.error( "response: " + str( self.handle.before ) )
+            response = self.handle.before
+            return response
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanAndExit()
+        except Exception:
+            main.log.exception( self.name + ": uncaught exception!" )
+            main.cleanAndExit()
+
+    def command( self, cmd, wait=3 ):
+        """
+        Run shell command on host and return output
+        Required:
+            cmd: command to run on the host
+        """
+        try:
+            main.log.info( self.name + ": Sending: " + cmd )
+            self.handle.sendline( cmd )
+            i = self.handle.expect( [ self.prompt, pexpect.TIMEOUT ],
+                                    timeout=wait + 5 )
+            if i == 1:
+                main.log.error( self.name + ": timeout when waiting for response" )
+                main.log.error( "response: " + str( self.handle.before ) )
+            response = self.handle.before
+            return response
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanAndExit()
+        except Exception:
+            main.log.exception( self.name + ": uncaught exception!" )
             main.cleanAndExit()
diff --git a/TestON/drivers/common/cli/networkdriver.py b/TestON/drivers/common/cli/networkdriver.py
index 38d7531..f0d7f8b 100755
--- a/TestON/drivers/common/cli/networkdriver.py
+++ b/TestON/drivers/common/cli/networkdriver.py
@@ -29,6 +29,7 @@
 """
 import pexpect
 import os
+import re
 import types
 from drivers.common.clidriver import CLI
 
@@ -123,26 +124,154 @@
             for key, value in main.componentDictionary.items():
                 if hasattr( main, key ):
                     if value[ 'type' ] in [ 'MininetSwitchDriver', 'OFDPASwitchDriver' ]:
-                        self.switches[ key ] = getattr( main, key )
+                        component = getattr( main, key )
+                        shortName = component.options[ 'shortName' ]
+                        localName = self.name + "-" + shortName
+                        self.copyComponent( key, localName )
+                        self.switches[ shortName ] = getattr( main, localName )
                     elif value[ 'type' ] in [ 'MininetHostDriver', 'HostDriver' ]:
-                        self.hosts[ key ] = getattr( main, key )
+                        component = getattr( main, key )
+                        shortName = component.options[ 'shortName' ]
+                        localName = self.name + "-" + shortName
+                        self.copyComponent( key, localName )
+                        self.hosts[ shortName ] = getattr( main, localName )
+            main.log.debug( self.name + ": found switches: {}".format( self.switches ) )
+            main.log.debug( self.name + ": found hosts: {}".format( self.hosts ) )
             return main.TRUE
         except Exception:
             main.log.error( self.name + ": failed to connect to network" )
             return main.FALSE
 
-    def getHosts( self, verbose=False, updateTimeout=1000 ):
+    def disconnectFromNet( self ):
         """
-        Return a dictionary which maps short names to host data
+        Disconnect from the physical network connected
         """
-        hosts = {}
         try:
-            for hostComponent in self.hosts.values():
-                # TODO: return more host data
-                hosts[ hostComponent.options[ 'shortName' ] ] = {}
+            for key, value in main.componentDictionary.items():
+                if hasattr( main, key ) and key.startswith( self.name + "-" ):
+                    self.removeComponent( key )
+            self.switches = {}
+            self.hosts = {}
+            return main.TRUE
         except Exception:
-            main.log.error( self.name + ": host component not as expected" )
-        return hosts
+            main.log.error( self.name + ": failed to disconnect from network" )
+            return main.FALSE
+
+    def copyComponent( self, name, newName ):
+        """
+        Copy the component initialized from the .topo file
+        The copied components are only supposed to be called within this driver
+        Required:
+            name: name of the component to be copied
+            newName: name of the new component
+        """
+        try:
+            main.componentDictionary[ newName ] = main.componentDictionary[ name ].copy()
+            main.componentInit( newName )
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanAndExit()
+
+    def removeHostComponent( self, name ):
+        """
+        Remove host component
+        Required:
+            name: name of the component to be removed
+        """
+        try:
+            self.removeComponent( name )
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanAndExit()
+
+    def removeComponent( self, name ):
+        """
+        Remove host/switch component
+        Required:
+            name: name of the component to be removed
+        """
+        try:
+            component = getattr( main, name )
+        except AttributeError:
+            main.log.error( "Component " + name + " does not exist." )
+            return main.FALSE
+        try:
+            # Disconnect from component
+            component.disconnect()
+            # Delete component
+            delattr( main, name )
+            # Delete component from ComponentDictionary
+            del( main.componentDictionary[ name ] )
+            return main.TRUE
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanAndExit()
+
+    def createComponent( self, name ):
+        """
+        Creates switch/host component with the same parameters as the one copied to local.
+        Arguments:
+            name - The string of the name of this component. The new component
+                   will be assigned to main.<name> .
+                   In addition, main.<name>.name = str( name )
+        """
+        try:
+            # look to see if this component already exists
+            getattr( main, name )
+        except AttributeError:
+            # namespace is clear, creating component
+            localName = self.name + "-" + name
+            main.componentDictionary[ name ] = main.componentDictionary[ localName ].copy()
+            main.componentInit( name )
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanAndExit()
+        else:
+            # namespace is not clear!
+            main.log.error( name + " component already exists!" )
+            main.cleanAndExit()
+
+    def connectInbandHosts( self ):
+        """
+        Connect to hosts using data plane IPs specified
+        """
+        result = main.TRUE
+        try:
+            for hostName, hostComponent in self.hosts.items():
+                if hostComponent.options[ 'inband' ] == 'True':
+                    main.log.info( self.name + ": connecting inband host " + hostName )
+                    result = hostComponent.connectInband() and result
+            return result
+        except Exception:
+            main.log.error( self.name + ": failed to connect to inband hosts" )
+            return main.FALSE
+
+    def disconnectInbandHosts( self ):
+        """
+        Terminate the connections to hosts using data plane IPs
+        """
+        result = main.TRUE
+        try:
+            for hostName, hostComponent in self.hosts.items():
+                if hostComponent.options[ 'inband' ] == 'True':
+                    main.log.info( self.name + ": disconnecting inband host " + hostName )
+                    result = hostComponent.disconnectInband() and result
+            return result
+        except Exception:
+            main.log.error( self.name + ": failed to disconnect inband hosts" )
+            return main.FALSE
+
+    def getSwitches( self ):
+        """
+        Return a dictionary which maps short names to switch component
+        """
+        return self.switches
+
+    def getHosts( self ):
+        """
+        Return a dictionary which maps short names to host component
+        """
+        return self.hosts
 
     def getMacAddress( self, host ):
         """
@@ -150,7 +279,8 @@
         """
         import re
         try:
-            hostComponent = self.getHostComponentByShortName( host )
+            hosts = self.getHosts()
+            hostComponent = hosts[ host ]
             response = hostComponent.ifconfig()
             pattern = r'HWaddr\s([0-9A-F]{2}[:-]){5}([0-9A-F]{2})'
             macAddressSearch = re.search( pattern, response, re.I )
@@ -160,24 +290,17 @@
         except Exception:
             main.log.error( self.name + ": failed to get host MAC address" )
 
-    def getSwitchComponentByShortName( self, shortName ):
+    def runCmdOnHost( self, hostName, cmd ):
         """
-        Get switch component by its short name i.e. "s1"
+        Run shell command on specified host and return output
+        Required:
+            hostName: name of the host e.g. "h1"
+            cmd: command to run on the host
         """
-        for switchComponent in self.switches.values():
-            if switchComponent.options[ 'shortName' ] == shortName:
-                return switchComponent
-        main.log.warn( self.name + ": failed to find switch component by name " + shortName )
-        return None
-
-    def getHostComponentByShortName( self, shortName ):
-        """
-        Get host component by its short name i.e. "h1"
-        """
-        for hostComponent in self.hosts.values():
-            if hostComponent.options[ 'shortName' ] == shortName:
-                return hostComponent
-        main.log.warn( self.name + ": failed to find host component by name " + shortName )
+        hosts = self.getHosts()
+        hostComponent = hosts[ hostName ]
+        if hostComponent:
+            return hostComponent.command( cmd )
         return None
 
     def assignSwController( self, sw, ip, port="6653", ptcp="" ):
@@ -243,7 +366,7 @@
             index = 0
             for switch in switchList:
                 assigned = False
-                switchComponent = self.getSwitchComponentByShortName( switch )
+                switchComponent = self.switches[ switch ]
                 if switchComponent:
                     ptcp = ptcpList[ index ] if ptcpList else ""
                     assignResult = assignResult and switchComponent.assignSwController( ip=ip, port=port, ptcp=ptcp )
@@ -281,7 +404,8 @@
             returnValue = main.TRUE
             ipv6 = True if protocol == "IPv6" else False
             startTime = time.time()
-            hostPairs = itertools.permutations( list( self.hosts.values() ), 2 )
+            hosts = self.getHosts()
+            hostPairs = itertools.permutations( list( hosts.values() ), 2 )
             for hostPair in list( hostPairs ):
                 ipDst = hostPair[ 1 ].options[ 'ip6' ] if ipv6 else hostPair[ 1 ].options[ 'ip' ]
                 pingResult = hostPair[ 0 ].ping( ipDst, ipv6=ipv6 )
@@ -322,8 +446,9 @@
         import time
         import itertools
         hostComponentList = []
+        hosts = self.getHosts()
         for hostName in hostList:
-            hostComponent = self.getHostComponentByShortName( hostName )
+            hostComponent = hosts[ hostName ]
             if hostComponent:
                 hostComponentList.append( hostComponent )
         try:
@@ -361,3 +486,80 @@
         main.log.info( self.name + ": Simple iperf TCP test between two hosts" )
         # TODO: complete this function
         return main.TRUE
+
+    def update( self ):
+        return main.TRUE
+
+    def verifyHostIp( self, hostList=[], prefix="", update=False ):
+        """
+        Description:
+            Verify that all hosts have IP address assigned to them
+        Optional:
+            hostList: If specified, verifications only happen to the hosts
+            in hostList
+            prefix: at least one of the ip address assigned to the host
+            needs to have the specified prefix
+        Returns:
+            main.TRUE if all hosts have specific IP address assigned;
+            main.FALSE otherwise
+        """
+        try:
+            hosts = self.getHosts()
+            if not hostList:
+                hostList = hosts.keys()
+            for hostName, hostComponent in hosts.items():
+                if hostName not in hostList:
+                    continue
+                ipList = []
+                ipa = hostComponent.ip()
+                ipv4Pattern = r'inet ((?:[0-9]{1,3}\.){3}[0-9]{1,3})/'
+                ipList += re.findall( ipv4Pattern, ipa )
+                # It's tricky to make regex for IPv6 addresses and this one is simplified
+                ipv6Pattern = r'inet6 ((?:[0-9a-fA-F]{1,4})?(?:[:0-9a-fA-F]{1,4}){1,7}(?:::)?(?:[:0-9a-fA-F]{1,4}){1,7})/'
+                ipList += re.findall( ipv6Pattern, ipa )
+                main.log.debug( self.name + ": IP list on host " + str( hostName ) + ": " + str( ipList ) )
+                if not ipList:
+                    main.log.warn( self.name + ": Failed to discover any IP addresses on host " + str( hostName ) )
+                else:
+                    if not any( ip.startswith( str( prefix ) ) for ip in ipList ):
+                        main.log.warn( self.name + ": None of the IPs on host " + str( hostName ) + " has prefix " + str( prefix ) )
+                    else:
+                        main.log.debug( self.name + ": Found matching IP on host " + str( hostName ) )
+                        hostList.remove( hostName )
+            return main.FALSE if hostList else main.TRUE
+        except KeyError:
+            main.log.exception( self.name + ": host data not as expected: " + hosts )
+            return None
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanAndExit()
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception" )
+            return None
+
+    def addRoute( self, host, dstIP, interface, ipv6=False ):
+        """
+        Add a route to host
+        Ex: h1 route add -host 224.2.0.1 h1-eth0
+        """
+        try:
+            if ipv6:
+                cmd = "sudo route -A inet6 add "
+            else:
+                cmd = "sudo route add -host "
+            cmd += str( dstIP ) + " " + str( interface )
+            response = self.runCmdOnHost( host, cmd )
+            main.log.debug( "response = " + response )
+            return main.TRUE
+        except pexpect.TIMEOUT:
+            main.log.error( self.name + ": TIMEOUT exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            main.cleanAndExit()
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":     " + self.handle.before )
+            return main.FALSE
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanAndExit()
diff --git a/TestON/drivers/common/cli/ofdpa/ofdpaswitchdriver.py b/TestON/drivers/common/cli/ofdpa/ofdpaswitchdriver.py
index b080c96..ac909ee 100644
--- a/TestON/drivers/common/cli/ofdpa/ofdpaswitchdriver.py
+++ b/TestON/drivers/common/cli/ofdpa/ofdpaswitchdriver.py
@@ -56,9 +56,12 @@
             for key in connectargs:
                 vars( self )[ key ] = connectargs[ key ]
             # Get the name
-            self.name = self.options['name']
+            self.name = self.options[ 'name' ]
             # Get the dpid
             self.dpid = self.options[ 'dpid' ]
+            # Get ofagent patch
+            if 'confDir' in self.options:
+                self.switchDirectory = self.options[ 'confDir' ]
             # Parse the IP address
             try:
                 if os.getenv( str( self.ip_address ) ) is not None:
@@ -135,7 +138,7 @@
             response = main.FALSE
             return response
 
-    def assignSwController( self, ip, port="6653", ptcp=""):
+    def assignSwController( self, ip, port="6653", ptcp="", updateConf=False ):
         """
         Description:
             The assignment is realized properly creating the agent.conf
@@ -145,6 +148,9 @@
         Optional:
             port - controller port is ignored
             ptcp - ptcp information is ignored
+            updateConf - create new ofagent conf file and push to the switch if
+                         set to True; otherwise will use the existing conf file
+                         on the switch.
         Return:
             Returns main.TRUE if the switch is correctly assigned to controllers,
             otherwise it will return main.FALSE or an appropriate exception(s)
@@ -165,22 +171,23 @@
                 return main.FALSE
             # Complete the arguments adding the dpid
             opt_args += onosIp + '-i %s' % self.dpid + '"'
-            # Create a copy of the cfg file using the template
-            self.createCfg()
-            # Load the cfg file and adds the missing option
-            self.updateCfg( opt_args )
-            # Backup the cfg on the switch
-            self.backupCfg()
-            # Push the new cfg on the device
-            self.pushCfg()
-            # Start the ofagent on the device
+            if updateConf:
+                # Create a copy of the cfg file using the template
+                self.createCfg()
+                # Load the cfg file and adds the missing option
+                self.updateCfg( opt_args )
+                # Backup the cfg on the switch
+                self.backupCfg()
+                # Push the new cfg on the device
+                self.pushCfg()
+                # Start the ofagent on the device
             self.startOfAgent()
             # Enable all the ports
             assignResult = utilities.retry(
                 self.enablePorts,
                 main.FALSE,
                 kwargs={},
-                attempts=5,
+                attempts=10,
                 sleep=10)
             # Done return true
             return assignResult
@@ -317,11 +324,13 @@
         self.handle.expect( self.prompt )
         response = self.handle.before
         if "Error from ofdpaClientInitialize()" in response:
-            main.log.warn(
-                self.name +
-                ": Not yet started" )
+            main.log.warn( self.name + ": Not yet started" )
             return main.FALSE
-        main.log.info( self.name + ": started" )
-        self.handle.sendline( "sh portspeed.sh" )
+        # Change port speed
+        self.handle.sendline( "sh portspeed" )
         self.handle.expect( self.prompt )
+        response = self.handle.before
+        if "Failure calling" in response:
+            main.log.warn( self.name + ": failed to change port speed" )
+            return main.FALSE
         return main.TRUE
diff --git a/TestON/drivers/common/cli/onosclusterdriver.py b/TestON/drivers/common/cli/onosclusterdriver.py
index 5983855..b8320ba 100755
--- a/TestON/drivers/common/cli/onosclusterdriver.py
+++ b/TestON/drivers/common/cli/onosclusterdriver.py
@@ -376,6 +376,9 @@
         main.componentDictionary[name]['host'] = ipAddress
         home = main.componentDictionary[name]['COMPONENTS'].get( "onos_home", None )
         main.componentDictionary[name]['home'] = self.checkOptions( home, None )
+        # TODO: for now we use karaf user name and password also for logging to the onos nodes
+        main.componentDictionary[name]['user'] = self.karafUser
+        main.componentDictionary[name]['password'] = self.karafPass
         main.componentDictionary[name]['connect_order'] = str( int( main.componentDictionary[name]['connect_order'] ) + 1 )
         main.log.debug( main.componentDictionary[name] )
 
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex
new file mode 100644
index 0000000..c40f97e
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params.flex
@@ -0,0 +1,59 @@
+<PARAMS>
+    <testcases>1,1</testcases>
+
+    <GRAPH>
+        <nodeCluster>Fabric</nodeCluster>
+        <builds>20</builds>
+    </GRAPH>
+
+    <SCALE>
+        <size>3</size>
+        <max>3</max>
+    </SCALE>
+
+    <DEPENDENCY>
+        <useCommonConf>False</useCommonConf>
+        <useCommonTopo>True</useCommonTopo>
+        <topology>hagg_fabric.py</topology>
+        <lib>routinglib.py,trellislib.py</lib>
+        <conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+    </DEPENDENCY>
+
+    <ENV>
+        <cellName>productionCell</cellName>
+        <cellApps>drivers,segmentrouting,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,mcast,hostprobingprovider</cellApps>
+    </ENV>
+
+    <GIT>
+        <pull>False</pull>
+        <branch>master</branch>
+    </GIT>
+
+    <CTRL>
+        <port>6653</port>
+    </CTRL>
+
+    <timers>
+        <LinkDiscovery>30</LinkDiscovery>
+        <SwitchDiscovery>30</SwitchDiscovery>
+        <OnosDiscovery>30</OnosDiscovery>
+        <loadNetcfgSleep>5</loadNetcfgSleep>
+        <connectToNetSleep>30</connectToNetSleep>
+        <balanceMasterSleep>10</balanceMasterSleep>
+        <mcastSleep>5</mcastSleep>
+    </timers>
+
+    <RETRY>
+        <hostDiscovery>10</hostDiscovery>
+    </RETRY>
+
+    <SCAPY>
+        <HOSTNAMES>h1,h2</HOSTNAMES>
+    </SCAPY>
+
+    <TOPO>
+        <switchNum>10</switchNum>
+        <linkNum>48</linkNum>
+    </TOPO>
+
+</PARAMS>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.flex b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.flex
new file mode 100644
index 0000000..60d109a
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.flex
@@ -0,0 +1,198 @@
+<TOPOLOGY>
+    <COMPONENT>
+        <ONOScell>
+            <host>localhost</host>  # ONOS "bench" machine
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>OnosClusterDriver</type>
+            <connect_order>1</connect_order>
+            <COMPONENTS>
+                <cluster_name></cluster_name>  # Used as a prefix for cluster components. Defaults to 'ONOS'
+                <diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
+                <karaf_username>ubuntu</karaf_username>
+                <karaf_password>ubuntu</karaf_password>
+                <web_user></web_user>
+                <web_pass></web_pass>
+                <rest_port></rest_port>
+                <prompt></prompt>  # TODO: we technically need a few of these, one per component
+                <onos_home></onos_home>  # defines where onos home is
+                <nodes>3</nodes>  # number of nodes in the cluster
+            </COMPONENTS>
+        </ONOScell>
+
+        <OFDPASwitchLeaf201>
+            <host>10.192.21.22</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>2</connect_order>
+            <COMPONENTS>
+                <shortName>s004</shortName>
+                <dpid>0x201</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf201>
+
+        <OFDPASwitchLeaf202>
+            <host>10.192.21.23</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>3</connect_order>
+            <COMPONENTS>
+                <shortName>s005</shortName>
+                <dpid>0x202</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf202>
+
+        <OFDPASwitchLeaf203>
+            <host>10.192.21.24</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>4</connect_order>
+            <COMPONENTS>
+                <shortName>s002</shortName>
+                <dpid>0x203</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf203>
+
+        <OFDPASwitchLeaf204>
+            <host>10.192.21.25</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>5</connect_order>
+            <COMPONENTS>
+                <shortName>s003</shortName>
+                <dpid>0x204</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf204>
+
+        <OFDPASwitchLeaf205>
+            <host>10.192.21.29</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>6</connect_order>
+            <COMPONENTS>
+                <shortName>s006</shortName>
+                <dpid>0x205</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf205>
+
+        <OFDPASwitchLeaf206>
+            <host>10.192.21.30</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>7</connect_order>
+            <COMPONENTS>
+                <shortName>s001</shortName>
+                <dpid>0x206</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf206>
+
+        <OFDPASwitchLeaf225>
+            <host>10.192.21.21</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>8</connect_order>
+            <COMPONENTS>
+                <shortName>s101</shortName>
+                <dpid>0x225</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf225>
+
+        <OFDPASwitchLeaf226>
+            <host>10.192.21.26</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>9</connect_order>
+            <COMPONENTS>
+                <shortName>s102</shortName>
+                <dpid>0x226</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf226>
+
+        <OFDPASwitchLeaf227>
+            <host>10.192.21.28</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>10</connect_order>
+            <COMPONENTS>
+                <shortName>s103</shortName>
+                <dpid>0x227</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf227>
+
+        <OFDPASwitchLeaf228>
+            <host>10.192.21.31</host>
+            <user>root</user>
+            <password>weekday-dude-populism-creole</password>
+            <type>OFDPASwitchDriver</type>
+            <connect_order>11</connect_order>
+            <COMPONENTS>
+                <shortName>s104</shortName>
+                <dpid>0x228</dpid>
+                <confDir>/etc/ofdpa/</confDir>
+            </COMPONENTS>
+        </OFDPASwitchLeaf228>
+
+        <Host1>
+            <host>10.192.21.61</host>
+            <user>vyatta</user>
+            <password>vyatta</password>
+            <type>HostDriver</type>
+            <connect_order>13</connect_order>
+            <COMPONENTS>
+                <ip>10.0.202.8</ip>
+                <ip6></ip6>
+                <shortName>h1</shortName>
+                <ifaceName>bond0</ifaceName>
+                <inband>True</inband>
+                <username>ubuntu</username>
+                <password>ubuntu</password>
+            </COMPONENTS>
+        </Host1>
+
+        <Host2>
+            <host>10.192.21.61</host>
+            <user>vyatta</user>
+            <password>vyatta</password>
+            <type>HostDriver</type>
+            <connect_order>14</connect_order>
+            <COMPONENTS>
+                <ip>10.0.204.8</ip>
+                <ip6></ip6>
+                <shortName>h2</shortName>
+                <ifaceName>bond0</ifaceName>
+                <inband>True</inband>
+                <username>ubuntu</username>
+                <password>ubuntu</password>
+            </COMPONENTS>
+        </Host2>
+
+        <NetworkBench>
+            <host>localhost</host>
+            <user>sdn</user>
+            <password>rocks</password>
+            <type>NetworkDriver</type>
+            <connect_order>20</connect_order>
+            <COMPONENTS>
+            </COMPONENTS>
+        </NetworkBench>
+
+    </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.physical b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.onf
similarity index 100%
rename from TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.physical
rename to TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.topo.onf
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
index 27b6dd0..8758fd8 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/SRMulticastTest.py
@@ -37,10 +37,10 @@
     lib.installOnos( main, skipPackage=skipPackage, cliSleep=5 )
     # Load configuration files
     main.step( "Load configurations" )
-    main.cfgName = "TEST_CONFIG_ipv4=1_ipv6=1"
+    main.cfgName = "TEST_CONFIG_ipv4=1_ipv6=1" if hasattr( main, "Mininet1" ) else "flex"
     lib.loadJson( main )
     time.sleep( float( main.params[ "timers" ][ "loadNetcfgSleep" ] ) )
-    main.cfgName = "common"
+    main.cfgName = "common" if hasattr( main, "Mininet1" ) else "flex"
     lib.loadMulticastConfig( main )
     lib.loadHost( main )
 
@@ -51,9 +51,7 @@
         time.sleep( float( main.params[ "timers" ][ "startMininetSleep" ] ) )
     else:
         # Run the test with physical devices
-        lib.connectToPhysicalNetwork( main, self.switchNames )
-        # Check if the devices are up
-        lib.checkDevices( main, switches=len( self.switchNames ) )
+        lib.connectToPhysicalNetwork( main )
 
     # Create scapy components
     lib.startScapyHosts( main )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp1.conf b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp1.conf
index d4f09ea..e288bc4 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp1.conf
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp1.conf
@@ -6,4 +6,4 @@
 !
 ip route 0.0.0.0/0 172.16.0.1
 !
-fpm connection ip 10.128.100.67 port 2620
+fpm connection ip 10.192.19.151 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp2.conf b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp2.conf
index 95e97fd..47fc14a 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp2.conf
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/conf/zebradbgp2.conf
@@ -6,4 +6,4 @@
 !
 ip route 0.0.0.0/0 172.16.0.1
 !
-fpm connection ip 10.128.100.69 port 2620
+fpm connection ip 10.192.19.152 port 2620
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/flex.host b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/flex.host
new file mode 100644
index 0000000..7647b9e
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/host/flex.host
@@ -0,0 +1,12 @@
+{
+    "onos":
+    {
+        "12:1C:B7:5C:69:68/None": "10.0.202.8",
+        "A2:9B:16:E8:2A:52/None": "10.0.204.8"
+    },
+    "network":
+    {
+        "h1": "10.0.202.8",
+        "h2": "10.0.204.8"
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/json/flex.json b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/json/flex.json
new file mode 100644
index 0000000..c8f1ff2
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/json/flex.json
@@ -0,0 +1,460 @@
+{
+    "ports" : {
+        "of:0000000000000205/1" : {
+    	    "interfaces" : [{
+    		    "ips" : [ "10.0.205.254/24" ],
+    		    "vlan-untagged": 205
+    	    }]
+    	},
+        "of:0000000000000205/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.205.254/24" ],
+                "vlan-untagged": 205
+            }]
+        },
+        "of:0000000000000206/1" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.206.254/24" ],
+                "vlan-untagged": 206
+            }]
+        },
+        "of:0000000000000206/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.206.254/24" ],
+                "vlan-untagged": 206
+            }]
+        },
+        "of:0000000000000203/1" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/3" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/4" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/5" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/6" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/7" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/8" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000203/20" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-tagged": [204]
+            }]
+        },
+        "of:0000000000000204/1" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/3" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/4" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/5" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/6" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/7" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/8" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-untagged": 204
+            }]
+        },
+        "of:0000000000000204/20" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.204.254/24" ],
+                "vlan-tagged": [204]
+            }]
+        },
+        "of:0000000000000201/1" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/3" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/4" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/5" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/6" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/7" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/8" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000201/17" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.101.254/24" ],
+                "vlan-untagged": 101
+            }]
+        },
+        "of:0000000000000201/18" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.101.254/24" ],
+                "vlan-untagged": 101
+            }]
+        },
+        "of:0000000000000201/20" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-tagged": [202]
+            }]
+        },
+        "of:0000000000000202/1" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/2" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/3" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/4" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/5" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/6" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/7" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/8" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-untagged": 202
+            }]
+        },
+        "of:0000000000000202/17" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.102.254/24" ],
+                "vlan-untagged": 102
+            }]
+        },
+        "of:0000000000000202/18" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.102.254/24" ],
+                "vlan-untagged": 102
+            }]
+        },
+        "of:0000000000000202/20" : {
+            "interfaces" : [{
+                "ips" : [ "10.0.202.254/24" ],
+                "vlan-tagged": [202]
+            }]
+        }
+    },
+    "devices" : {
+        "of:0000000000000201" : {
+	        "basic" : {
+	    	    "name": "201-qmx",
+	    	    "latitude" : 34,
+	    	    "longitude": -95
+	        },
+            "segmentrouting" : {
+                "ipv4NodeSid" : 201,
+                "ipv4Loopback" : "192.168.0.201",
+                "ipv6NodeSid" : 201,
+                "ipv6Loopback" : "2000::c0a8:0201",
+                "routerMac" : "00:00:02:01:02:02",
+	    	    "pairDeviceId" : "of:0000000000000202",
+	    	    "pairLocalPort" : 20,
+                "isEdgeRouter" : true,
+                "adjacencySids" : []
+                }
+            },
+	    "of:0000000000000202" : {
+	        "basic" : {
+	    	    "name": "202-qmx",
+	    	    "latitude" : 34,
+	    	    "longitude": -90
+	        },
+	        "segmentrouting" : {
+                "ipv4NodeSid" : 202,
+                "ipv4Loopback" : "192.168.0.202",
+                "ipv6NodeSid" : 202,
+                "ipv6Loopback" : "2000::c0a8:0202",
+                "routerMac" : "00:00:02:01:02:02",
+                "isEdgeRouter" : true,
+                "pairDeviceId" : "of:0000000000000201",
+                "pairLocalPort" : 20,
+	    	    "adjacencySids" : []
+            }
+        },
+        "of:0000000000000203" : {
+	        "basic" : {
+	            "name": "203-qmx",
+	            "latitude" : 34,
+	            "longitude": -108
+	        },
+            "segmentrouting" : {
+                "name" : "Leaf2-R1",
+                "ipv4NodeSid" : 203,
+                "ipv4Loopback" : "192.168.0.203",
+                "ipv6NodeSid" : 203,
+                "ipv6Loopback" : "2000::c0a8:0203",
+                "routerMac" : "00:00:02:03:02:04",
+                "isEdgeRouter" : true,
+                "pairDeviceId" : "of:0000000000000204",
+                "pairLocalPort" : 20,
+                "adjacencySids" : []
+            }
+        },
+        "of:0000000000000204" : {
+	        "basic" : {
+	            "name": "204-qmx",
+	            "latitude" : 34,
+	            "longitude": -103
+	        },
+            "segmentrouting" : {
+                "name" : "Leaf1-R1",
+                "ipv4NodeSid" : 204,
+                "ipv4Loopback" : "192.168.0.204",
+                "ipv6NodeSid" : 204,
+                "ipv6Loopback" : "2000::c0a8:0204",
+                "routerMac" : "00:00:02:03:02:04",
+                "pairDeviceId" : "of:0000000000000203",
+                "pairLocalPort" : 20,
+                "isEdgeRouter" : true,
+                "adjacencySids" : []
+            }
+        },
+   	    "of:0000000000000225" : {
+	        "basic" : {
+	    	    "name": "225-t2",
+	    	    "latitude" : 42,
+	    	    "longitude": -100
+	        },
+        	"segmentrouting" : {
+                "name" : "SpineToma-0",
+                "ipv4NodeSid" : 225,
+                "ipv4Loopback" : "192.168.0.225",
+	    	    "ipv6NodeSid" : 225,
+                "ipv6Loopback" : "2000::c0a8:0225",
+                "routerMac" : "00:00:02:25:00:01",
+                "isEdgeRouter" : false,
+	    	    "adjacencySids" : []
+            }
+        },
+        "of:0000000000000226" : {
+	        "basic" : {
+	    	    "name": "226-tmhk",
+	    	    "latitude" : 42,
+	    	    "longitude": -95
+	        },
+            "segmentrouting" : {
+                "name" : "Spine1",
+                "ipv4NodeSid" : 226,
+                "ipv4Loopback" : "192.168.0.226",
+                "ipv6NodeSid" : 226,
+                "ipv6Loopback" : "2000::c0a8:0226",
+                "routerMac" : "00:00:02:26:00:01",
+                "isEdgeRouter" : false,
+                "adjacencySids" : []
+            }
+        },
+        "of:0000000000000205":{
+            "basic":{
+                "name":"205-qmx",
+                "latitude":34,
+                "longitude":-120
+            },
+            "segmentrouting":{
+                "name":"Leaf1",
+                "ipv4NodeSid":205,
+                "ipv4Loopback":"192.168.0.205",
+                "ipv6NodeSid":205,
+                "ipv6Loopback":"2000::c0a8:0205",
+                "routerMac":"00:00:02:05:06:01",
+                "isEdgeRouter":true,
+                "adjacencySids":[
+                ]
+            }
+        },
+        "of:0000000000000206":{
+            "basic":{
+                "name":"206-qmx",
+                "latitude":34,
+                "longitude":-115
+            },
+            "segmentrouting":{
+                "name":"Leaf2",
+                "ipv4NodeSid":206,
+                "ipv4Loopback":"192.168.0.206",
+                "ipv6NodeSid":206,
+                "ipv6Loopback":"2000::c0a8:0206",
+                "routerMac":"00:00:02:06:06:01",
+                "isEdgeRouter":true,
+                "adjacencySids":[
+                ]
+            }
+        },
+        "of:0000000000000227":{
+            "basic":{
+                "name":"227-tmhk",
+                "latitude":38,
+                "longitude":-119
+            },
+            "segmentrouting":{
+                "name":"Spine1",
+                "ipv4NodeSid":227,
+                "ipv4Loopback":"192.168.0.227",
+                "ipv6NodeSid":227,
+                "ipv6Loopback":"2000::c0a8:0227",
+                "routerMac":"00:00:02:27:00:01",
+                "isEdgeRouter":false,
+                "adjacencySids":[
+                ]
+            }
+        },
+        "of:0000000000000228":{
+            "basic":{
+                "name":"228-t2",
+                "latitude":38,
+                "longitude":-116
+            },
+            "segmentrouting":{
+                "name":"Spine2",
+                "ipv4NodeSid":228,
+                "ipv4Loopback":"192.168.0.228",
+                "ipv6NodeSid":228,
+                "ipv6Loopback":"2000::c0a8:0228",
+                "routerMac":"00:00:02:28:00:01",
+                "isEdgeRouter":false,
+                "adjacencySids":[
+                ]
+            }
+        }
+    },
+    "apps" : {
+            "org.onosproject.dhcprelay" : {
+    	    "default" : [
+    		    {
+                    "dhcpServerConnectPoint": "of:0000000000000204/8",
+                    "serverIps": ["10.0.204.8"]
+    		    }
+    	    ]
+        }
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/multicast/flex.multicastConfig b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/multicast/flex.multicastConfig
new file mode 100644
index 0000000..0e0ccc9
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/dependencies/multicast/flex.multicastConfig
@@ -0,0 +1,27 @@
+{
+    "ipv4": {
+        "ipVersion": 4,
+        "group": "224.2.0.1",
+        "src": [
+            {
+                "host": "h1",
+                "ip": "10.0.202.8",
+                "id": "12:1C:B7:5C:69:68/None",
+                "port": "of:0000000000000202/8",
+                "interface": "bond0",
+                "Ether": "01:00:5e:02:00:01",
+                "UDP": 40051,
+                "filter": "ip host 224.2.0.1",
+                "packet": "dst=01:00:5e:02:00:01 src=12:1c:b7:5c:69:68"
+            }
+        ],
+        "dst": [
+            {
+                "host": "h2",
+                "id": "A2:9B:16:E8:2A:52/None",
+                "interface": "bond0",
+                "dualHomed": "True"
+            }
+        ]
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 8221be0..4d6c1c1 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -220,7 +220,7 @@
             main.cleanAndExit()
 
     @staticmethod
-    def connectToPhysicalNetwork( main, switchNames ):
+    def connectToPhysicalNetwork( main ):
         main.step( "Connecting to physical netowrk" )
         topoResult = main.NetworkBench.connectToNet()
         stepResult = topoResult
@@ -234,15 +234,34 @@
 
         main.step( "Assign switches to controllers." )
         assignResult = main.TRUE
-        for name in switchNames:
-            assignResult = assignResult & main.NetworkBench.assignSwController( sw=name,
-                                                                                ip=main.Cluster.getIps(),
-                                                                                port='6653' )
+        switches = main.NetworkBench.getSwitches()
+        pool = []
+        for name in switches.keys():
+            thread = main.Thread( target=main.NetworkBench.assignSwController,
+                                  name="assignSwitchToController",
+                                  args=[ name, main.Cluster.getIps(), '6653' ] )
+            pool.append( thread )
+            thread.start()
+        for thread in pool:
+            thread.join( 300 )
+            if not thread.result:
+                stepResult = main.FALSE
         utilities.assert_equals( expect=main.TRUE,
                                  actual=stepResult,
                                  onpass="Successfully assign switches to controllers",
                                  onfail="Failed to assign switches to controllers" )
 
+        # Check devices
+        Testcaselib.checkDevices( main, switches=int( main.params[ 'TOPO' ][ 'switchNum' ] ) )
+        time.sleep( float( main.params[ "timers" ][ "connectToNetSleep" ] ) )
+        # Connecting to hosts that only have data plane connectivity
+        main.step( "Connecting inband hosts" )
+        stepResult = main.Network.connectInbandHosts()
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="Successfully connected inband hosts",
+                                 onfail="Failed to connect inband hosts" )
+
     @staticmethod
     def saveOnosDiagnostics( main ):
         """
@@ -821,33 +840,36 @@
         Stops Mininet
         Copies ONOS log
         """
-        try:
-            from tests.dependencies.utils import Utils
-        except ImportError:
-            main.log.error( "Utils not found exiting the test" )
-            main.cleanAndExit()
-        try:
-            main.utils
-        except ( NameError, AttributeError ):
-            main.utils = Utils()
-
+        from tests.dependencies.utils import Utils
+        main.utils = Utils()
+        # Clean up scapy hosts
         if hasattr( main, "scapyHosts" ):
             scapyResult = main.TRUE
             for host in main.scapyHosts:
                 scapyResult = host.stopScapy() and scapyResult
                 main.log.info( "Stopped Scapy Host: {0}".format( host.name ) )
             for host in main.scapyHosts:
-                scapyResult = main.Scapy.removeHostComponent( host.name ) and scapyResult
+                if hasattr( main, 'Mininet1' ):
+                    scapyResult = main.Scapy.removeHostComponent( host.name ) and scapyResult
+                else:
+                    scapyResult = main.Network.removeHostComponent( host.name ) and scapyResult
                 main.log.info( "Removed Scapy Host Component: {0}".format( host.name ) )
             main.scapyHosts = []
 
         if removeHostComponent:
             for host in main.internalIpv4Hosts + main.internalIpv6Hosts + main.externalIpv4Hosts + main.externalIpv6Hosts:
                 if hasattr( main, host ):
+                    if hasattr( main, 'Mininet1' ):
+                        pass
+                    else:
+                        getattr( main, host ).disconnectInband()
                     main.Network.removeHostComponent( host )
 
         if hasattr( main, 'Mininet1' ):
             main.utils.mininetCleanup( main.Mininet1 )
+        else:
+            main.Network.disconnectInbandHosts()
+            main.Network.disconnectFromNet()
 
         if copyKarafLog:
             main.utils.copyKarafLog( "CASE%d" % main.CurrentTestCaseNumber, before=True, includeCaseDesc=False )
@@ -1149,21 +1171,22 @@
         name of the corresponding Mininet host by mininetNames=['h1']
         """
         main.step( "Start Scapy CLIs" )
-        if scapyNames:
-            main.scapyNames = scapyNames
-        else:
-            main.scapyNames = main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' )
-        if not hasattr( main, "scapyHosts" ):
-            main.scapyHosts = []
+        main.scapyNames = scapyNames if scapyNames else main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' )
+        main.scapyHosts = [] if not hasattr( main, "scapyHosts" ) else main.scapyHosts
         for scapyName in main.scapyNames:
-            main.Scapy.createHostComponent( scapyName )
-            scapyHandle = getattr( main, scapyName )
-            main.scapyHosts.append( scapyHandle )
-            if mininetNames:
-                mininetName = mininetNames[ scapyNames.index( scapyName ) ]
+            if hasattr( main, 'Mininet1' ):
+                main.Scapy.createHostComponent( scapyName )
+                scapyHandle = getattr( main, scapyName )
+                if mininetNames:
+                    mininetName = mininetNames[ scapyNames.index( scapyName ) ]
+                else:
+                    mininetName = None
+                scapyHandle.startHostCli( mininetName )
             else:
-                mininetName = None
-            scapyHandle.startHostCli( mininetName )
+                main.Network.createComponent( scapyName )
+                scapyHandle = getattr( main, scapyName )
+                scapyHandle.connectInband()
+            main.scapyHosts.append( scapyHandle )
             scapyHandle.startScapy()
             scapyHandle.updateSelf()
             main.log.debug( scapyHandle.name )
diff --git a/TestON/tests/dependencies/Network.py b/TestON/tests/dependencies/Network.py
index e5c2200..9707533 100644
--- a/TestON/tests/dependencies/Network.py
+++ b/TestON/tests/dependencies/Network.py
@@ -53,6 +53,6 @@
         # Get a list of network components that are created in the test
         self.components = []
         for key, value in main.componentDictionary.items():
-            if value[ 'type' ] in [ 'MininetCliDriver', 'RemoteMininetDriver', 'NetworkDriver', 'OFDPASwitchDriver' ] and hasattr( main, key ):
+            if value[ 'type' ] in [ 'MininetCliDriver', 'RemoteMininetDriver', 'NetworkDriver' ] and hasattr( main, key ):
                 self.components.append( getattr( main, key ) )
         main.log.debug( "%s initialized with components: %s" % ( self.name, self.components ) )
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index 66d104d..fc6ceab 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -517,14 +517,9 @@
                        " node(s) ONOS cluster" )
             main.caseExplanation = "Set up ONOS with " + str( cluster.numCtrls ) + \
                                    " node(s) ONOS cluster"
-        atomixKillResult = self.killingAllAtomix( cluster, killRemoveMax, stopAtomix )
-        onosKillResult = self.killingAllOnos( cluster, killRemoveMax, stopOnos )
-        killResult = atomixKillResult and onosKillResult
 
         main.log.info( "NODE COUNT = " + str( cluster.numCtrls ) )
         cellResult = main.TRUE
-        packageResult = main.TRUE
-        onosCliResult = main.TRUE
         if cellApply:
             try:
                 apps = main.apps
@@ -545,6 +540,10 @@
                                                mininetIp, useSSH,
                                                tempOnosIp, installMax )
 
+        atomixKillResult = self.killingAllAtomix( cluster, killRemoveMax, stopAtomix )
+        onosKillResult = self.killingAllOnos( cluster, killRemoveMax, stopOnos )
+        killResult = atomixKillResult and onosKillResult
+
         if removeLog:
             main.log.info("Removing raft logs")
             main.ONOSbench.onosRemoveRaftLogs()
@@ -553,6 +552,7 @@
         uninstallResult = atomixUninstallResult and onosUninstallResult
         self.processList( extraApply, applyArgs )
 
+        packageResult = main.TRUE
         if not skipPack:
             packageResult = self.buildOnos(cluster)
 
@@ -565,6 +565,7 @@
 
         onosServiceResult = self.checkOnosService( cluster )
 
+        onosCliResult = main.TRUE
         if startOnos:
             onosCliResult = self.startOnosClis( cluster )