modifying FUNCoptical to use new topology

Change-Id: Ib1762ea4713eb9fc87e060d48d2a6dc04da32256
diff --git a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
index 9372a54..7dfcb1e 100644
--- a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
@@ -25,7 +25,7 @@
 
 
 class LincOEMininetDriver( MininetCliDriver ):
-    def runOpticalMnScript( self,onosDirectory = 'onos', ctrllerIP = None ):
+    def runOpticalMnScript( self,onosDirectory = 'onos', ctrllerIP = None, topology = 'opticalTest' ):
         import time
         import types
         """
@@ -35,6 +35,7 @@
                 packet layer( mn ) and optical topology
             Optional:
                 name - Name of onos directory. (ONOS | onos)
+                topology - Name of optical topology to activate, defaults to opticalTest.py
             Required:
                 ctrllerIP = Controller(s) IP address
             TODO: If no ctrllerIP is provided, a default
@@ -58,7 +59,7 @@
                 else:
                     main.log.info( "You need to specify a valid IP" )
                     return main.FALSE
-                topoFile = "~/{0}/tools/test/topos/opticalTest.py".format( onosDirectory )
+                topoFile = "~/{0}/tools/test/topos/{1}.py".format( onosDirectory, topology )
                 cmd = "sudo -E python {0} {1}".format( topoFile, controller )
                 main.log.info( self.name + ": cmd = " + cmd )
                 self.handle.sendline( cmd )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index dde65d3..f6c3143 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -2332,3 +2332,36 @@
 
         return main.TRUE if onosStatus else main.FALSE
 
+    def onosNetCfg( self, controllerIps, path, fileName ):
+        """
+        Push a specified json file to ONOS through the onos-netcfg service
+
+        Required:
+        controllerIps - the Ips of the ONOS nodes in the cluster
+        path - the location of the file to be sent
+        fileName - name of the json file to be sent
+
+        Returns main.TRUE on successfully sending json file, and main.FALSE if
+        there is an error.
+        """
+        try:
+            cmd = "onos-netcfg {0} {1}{2}.json".format( controllerIps, path, fileName )
+            main.log.info( "Sending: " + cmd )
+            main.ONOSbench.handle.sendline( cmd )
+            handle = self.handle.before
+            print handle
+            if "Error" in handle:
+                main.log.error( self.name + ":    " + self.handle.before )
+                return main.FALSE
+            else:
+                self.handle.expect( "\$" )
+                return main.TRUE
+        except pexpect.EOF:
+            main.log.error( self.name + ": EOF exception found" )
+            main.log.error( self.name + ":    " + self.handle.before )
+            main.cleanup()
+            main.exit()
+        except Exception:
+            main.log.exception( self.name + ": Uncaught exception!" )
+            main.cleanup()
+            main.exit()
\ No newline at end of file