Add cli argument to use different .topo or .params files

- Add cli arguments
- Refactor xmlparser functions
- Cleaned up and fixed some logging
- main.testDir is now set to the directory where the test file is
  located
- main.testsRoot is now set to the full path of TestON/tests/
    - Fixed usages accordingly

Change-Id: I2a0f0c3728b5732b242a2e860e6538a6f3b65166
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 3efb3cc..3e02799 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -173,7 +173,7 @@
         main.step( "Start Mininet topology" )
         newTopo = main.params[ 'TOPO' ][ main.topoIndex ][ 'fileName' ]
         mininetDir = main.Mininet1.home + "/custom/"
-        topoPath = main.testDir + "/" + main.TEST + "/dependencies/topologies/" + newTopo
+        topoPath = main.testDir + "/dependencies/topologies/" + newTopo
         main.ONOSbench.secureCopy( main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to" )
         topoPath = mininetDir + newTopo
         startStatus = main.Mininet1.startNet( topoFile=topoPath )
diff --git a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
index d871fae..bc4f3c3 100644
--- a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
@@ -91,7 +91,7 @@
         NODElist = main.params[ "SCALE" ][ "nodelist" ].split( ',' )
         main.log.info( "onos container names are: " + ",".join( NODElist ) )
         IPlist = list()
-        main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+        main.testOnDirectory = re.sub( "(/tests)$", "", main.testsRoot )
         CTIDlist = list()
 
         main.log.info( "Check docker status, it not running, try restart it" )
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index a45bdef..573f16d 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -33,7 +33,7 @@
         """
         import os
         main.case( "Setup the Mininet testbed" )
-        main.dependencyPath = main.testDir + \
+        main.dependencyPath = main.testsRoot + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
 
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 499df34..b984b1d 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -33,7 +33,7 @@
         """
         import imp
         main.case( "Setup the Mininet testbed" )
-        main.dependencyPath = main.testDir + \
+        main.dependencyPath = main.testsRoot + \
                               main.params[ 'DEPENDENCY' ][ 'path' ]
         main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
 
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index ca10d3a..ee339be 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -46,7 +46,7 @@
         except ( NameError, AttributeError ):
             main.Cluster = Cluster( main.ONOScell.nodes )
         main.ONOSbench = main.Cluster.controllers[ 0 ].Bench
-        main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+        main.testOnDirectory = re.sub( "(/tests)$", "", main.testsRoot )
 
     def gitPulling( self, includeCaseDesc=True ):
         """