Stability fixes for SR Tests and small fixes for running ONOS in docker

- move checkOptions to component driver
- use karafTimeout for SR tests
- Fix some docker options
- Make sure mn docker can resolve own hostname
- Fix config file ip format for DHCP relay app

Change-Id: I85e8c52384e0fb478462fa9bbaf0b31a599b632b
(cherry picked from commit 521ecde3f8d28288303ea11129faa0cfd86b9bcd)
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
index 89f758c..99993f4 100755
--- a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.params
@@ -16,11 +16,13 @@
         <useCommonConf>True</useCommonConf>
         <useCommonTopo>True</useCommonTopo>
         <topology>cord_fabric.py</topology>
+        <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
+        <t3Oar>/home/sdn/t3-app-3.0.0-SNAPSHOT.oar</t3Oar>
     </DEPENDENCY>
 
     <ENV>
         <cellName>productionCell</cellName>
-        <cellApps>drivers,hostprovider,segmentrouting,openflow-base,netcfghostprovider,netcfglinksprovider</cellApps>
+        <cellApps>drivers,hostprovider,openflow-base,netcfghostprovider,netcfglinksprovider</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py
index f130ff2..7233000 100644
--- a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/dependencies/SROnosFailureFuncs.py
@@ -31,38 +31,42 @@
         self.topo[ '4x4' ] = ( 4, 4, '--leaf=4 --spine=4', '4x4 Leaf-spine' )
 
     def runTest( self, main, caseNum, numNodes, Topo, minFlow, killList=[ 0 ] ):
-        description = "ONOS Failure test with " + self.topo[ Topo ][ 3 ]
-        main.case( description )
-        if not hasattr( main, 'apps' ):
-            run.initTest( main )
-        main.cfgName = Topo
-        main.Cluster.setRunningNode( numNodes )
-        run.installOnos( main )
-        run.loadJson( main )
-        run.loadChart( main )
-        if hasattr( main, 'Mininet1' ):
-            run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
-        else:
-            # Run the test with physical devices
-            # TODO: connect TestON to the physical network
-            pass
-        # pre-configured routing and bridging test
-        run.checkFlows( main, minFlowCount=minFlow )
-        run.pingAll( main, 'CASE{}'.format( caseNum ) )
-        switch = '{}'.format( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] )
-        link = '{}'.format( ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ] )
-        run.killOnos( main, killList, switch, link, '{}'.format( numNodes - 1 ) )
-        run.pingAll( main, 'CASE{}_Failure'.format( caseNum ) )
-        run.recoverOnos( main, killList, switch, link, '{}'.format( numNodes ) )
-        run.checkFlows( main, minFlowCount=minFlow, tag='CASE{}_Recovery'.format( caseNum ) )
-        run.pingAll( main, 'CASE{}_Recovery'.format( caseNum ) )
-        # TODO Dynamic config of hosts in subnet
-        # TODO Dynamic config of host not in subnet
-        # TODO Dynamic config of vlan xconnect
-        # TODO Vrouter integration
-        # TODO Mcast integration
-        if hasattr( main, 'Mininet1' ):
-            run.cleanup( main )
-        else:
-            # TODO: disconnect TestON from the physical network
-            pass
+        try:
+            description = "ONOS Failure test with " + self.topo[ Topo ][ 3 ]
+            main.case( description )
+            if not hasattr( main, 'apps' ):
+                run.initTest( main )
+            main.cfgName = Topo
+            main.Cluster.setRunningNode( numNodes )
+            run.installOnos( main )
+            run.loadJson( main )
+            run.loadChart( main )
+            if hasattr( main, 'Mininet1' ):
+                run.startMininet( main, 'cord_fabric.py', args=self.topo[ Topo ][ 2 ] )
+            else:
+                # Run the test with physical devices
+                # TODO: connect TestON to the physical network
+                pass
+            # pre-configured routing and bridging test
+            run.checkFlows( main, minFlowCount=minFlow )
+            run.pingAll( main, 'CASE{}'.format( caseNum ) )
+            switch = '{}'.format( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] )
+            link = '{}'.format( ( self.topo[ Topo ][ 0 ] + self.topo[ Topo ][ 1 ] ) * self.topo[ Topo ][ 0 ] )
+            run.killOnos( main, killList, switch, link, '{}'.format( numNodes - 1 ) )
+            run.pingAll( main, 'CASE{}_Failure'.format( caseNum ) )
+            run.recoverOnos( main, killList, switch, link, '{}'.format( numNodes ) )
+            run.checkFlows( main, minFlowCount=minFlow, tag='CASE{}_Recovery'.format( caseNum ) )
+            run.pingAll( main, 'CASE{}_Recovery'.format( caseNum ) )
+            # TODO Dynamic config of hosts in subnet
+            # TODO Dynamic config of host not in subnet
+            # TODO Dynamic config of vlan xconnect
+            # TODO Vrouter integration
+            # TODO Mcast integration
+            if hasattr( main, 'Mininet1' ):
+                run.cleanup( main )
+            else:
+                # TODO: disconnect TestON from the physical network
+                pass
+        except Exception as e:
+            main.log.exception( "Error in runTest" )
+            main.skipCase( result="FAIL", msg=e )