Temporary workaround for testing SR after Trellis separation

Change-Id: I8259be3b823685c1fbeb9623813dbf157b3edcd2
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 6196d1f..6e4c71d 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -1357,6 +1357,38 @@
             main.log.exception( self.name + ": Uncaught exception!" )
             main.cleanAndExit()
 
+    def onosAppInstall( self, nodeIp, oarFile ):
+        """
+        Calls the command: 'onos-app nodeIp install! oarFile'
+        Installs an ONOS application from an oar file
+        """
+        try:
+            cmd = "onos-app " + str( nodeIp ) +" install! " + str(oarFile)
+            self.handle.sendline( cmd )
+            self.handle.expect( self.prompt )
+            handle = self.handle.before
+            main.log.debug( handle )
+            assert handle is not None, "Error in sendline"
+            assert "Command not found:" not in handle, handle
+            assert "error" not in handle, handle
+            assert "usage:" not in handle, handle
+            return main.TRUE
+        except AssertionError:
+            main.log.exception( "Error in onos-app output" )
+            return main.FALSE
+        except pexpect.TIMEOUT:
+            main.log.exception( self.name + ": Timeout in onosAppInstall" )
+            self.handle.send( "\x03" )  # Control-C
+            self.handle.expect( self.prompt )
+            return main.FALSE
+        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 onosRemoveRaftLogs( self ):
         """
         Removes Raft / Copy cat files from ONOS to ensure
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
index 1520489..2d50ac0 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/SRBridging.params
@@ -18,11 +18,12 @@
         <useBmv2>False</useBmv2>
         <topology>trellis_fabric.py</topology>
         <lib>routinglib.py,trellislib.py</lib>
+        <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
     </DEPENDENCY>
 
     <ENV>
         <cellName>productionCell</cellName>
-        <cellApps>drivers,segmentrouting,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
+        <cellApps>drivers,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
index 6d1ae4a..719f5f6 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDhcprelay/SRDhcprelay.params
@@ -18,11 +18,12 @@
         <topology>trellis_fabric.py</topology>
         <lib>routinglib.py,trellislib.py</lib>
         <conf>dhcpd.conf,dhcpd6.conf,bgpdr1.conf,bgpdr2.conf,bgpdbgp1.conf,zebradbgp1.conf,bgpdbgp2.conf,zebradbgp2.conf</conf>
+        <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
     </DEPENDENCY>
 
     <ENV>
         <cellName>productionCell</cellName>
-        <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
+        <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,drivers.bmv2,pipelines.fabric</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
index 284e1e3..376898b 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamicConf/SRDynamicConf.params
@@ -17,11 +17,12 @@
         <useBmv2>False</useBmv2>
         <topology>trellis_fabric.py</topology>
         <lib>routinglib.py,trellislib.py</lib>
+        <trellisOar>/home/sdn/segmentrouting-oar-3.0.0-SNAPSHOT.oar</trellisOar>
     </DEPENDENCY>
 
     <ENV>
         <cellName>productionCell</cellName>
-        <cellApps>drivers,segmentrouting,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
+        <cellApps>drivers,openflow,fpm,netcfghostprovider,drivers.bmv2,pipelines.fabric</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params
index 7ee65f6..4f61954 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRMulticast/SRMulticast.params
@@ -18,11 +18,13 @@
         <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>
+        <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,segmentrouting,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,mcast,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
+        <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,mcast,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
index 88e5736..1d057b3 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
@@ -18,11 +18,13 @@
         <topology>hagg_fabric.py</topology>
         <lib>routinglib.py,trellislib.py,trellis_fabric.py</lib>
         <conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
+        <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,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
+        <cellApps>drivers,openflow,fpm,dhcprelay,netcfghostprovider,routeradvertisement,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
     </ENV>
 
     <GIT>
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 687f915..22988d8 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -78,6 +78,8 @@
             main.bmv2 = "bmv2.py"
             main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
             main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
+            main.trellisOar = main.params[ 'DEPENDENCY' ][ 'trellisOar' ]
+            main.t3Oar = main.params[ 'DEPENDENCY' ][ 't3Oar' ] if 't3Oar' in main.params[ 'DEPENDENCY' ] else None
 
             stepResult = main.testSetUp.envSetup( False )
         except Exception as e:
@@ -110,7 +112,7 @@
                                   useSSH=Testcaselib.useSSH,
                                   installParallel=parallel, includeCaseDesc=False )
         ready = utilities.retry( main.Cluster.active( 0 ).CLI.summary,
-                                 main.FALSE,
+                                 [ None, main.FALSE ],
                                  sleep=cliSleep,
                                  attempts=10 )
         if ready:
@@ -122,6 +124,16 @@
             main.log.error( "ONOS startup failed!" )
             main.cleanAndExit()
 
+        # Install segmentrouting and t3 app
+        appInstallResult = main.ONOSbench.onosAppInstall( main.Cluster.runningNodes[0].ipAddress, main.trellisOar)
+        if main.t3Oar:
+            appInstallResult = appInstallResult and main.ONOSbench.onosAppInstall( main.Cluster.runningNodes[0].ipAddress, main.t3Oar)
+        utilities.assert_equals( expect=main.TRUE, actual=appInstallResult,
+                                 onpass="SR app installation succeded",
+                                 onfail="SR app installation failed" )
+        if not appInstallResult:
+            main.cleanAndExit()
+
         for ctrl in main.Cluster.active():
             ctrl.CLI.logSet( "DEBUG", "org.onosproject.segmentrouting" )
             ctrl.CLI.logSet( "DEBUG", "org.onosproject.driver" )
@@ -997,7 +1009,7 @@
         Testcaselib.verifyTopology( main, switches, links, expNodes )
 
         ready = utilities.retry( main.Cluster.active( 0 ).CLI.summary,
-                                 main.FALSE,
+                                 [ None, main.FALSE ],
                                  attempts=10,
                                  sleep=12 )
         if ready: