Introduce: voltha_enable config to run tests with voltha environment enabled.
This is needed if one is running voltha externally and wants to run cord-tester from another node to test voltha.
(subscriber side pc to talk to olt connected voltha node)
Otherwise it defaults to enabled if voltha_loc is set (running locally with voltha).

Change-Id: I6956b6b20c3452e5acf7a00411ac1ff4a7eaf199
diff --git a/src/test/setup/cord-test.py b/src/test/setup/cord-test.py
index 4b8958c..d414735 100755
--- a/src/test/setup/cord-test.py
+++ b/src/test/setup/cord-test.py
@@ -726,7 +726,7 @@
                      'HEAD_NODE': head_node if head_node else CORD_TEST_HOST,
                      'MAAS_API_KEY': maas_api_key,
                      'KARAF_VERSION' : test_manifest.karaf_version,
-                     'VOLTHA_ENABLED' : 1 if voltha_loc else 0
+                     'VOLTHA_ENABLED' : int(test_manifest.voltha_enable)
                    }
 
     if ssh_key_file:
@@ -1016,7 +1016,7 @@
                          'HEAD_NODE': head_node if head_node else CORD_TEST_HOST,
                          'MAAS_API_KEY': maas_api_key,
                          'KARAF_VERSION' : test_manifest.karaf_version,
-                         'VOLTHA_ENABLED' : 1 if voltha_loc else 0
+                         'VOLTHA_ENABLED' : int(test_manifest.voltha_enable)
                        }
 
         if ssh_key_file:
@@ -1338,7 +1338,8 @@
                             help='Specify the voltha location in order to start voltha')
     parser_run.add_argument('-voltha-intf', '--voltha-intf', default='eth0', type=str,
                             help='Specify the voltha interface for voltha to listen')
-
+    parser_run.add_argument('-voltha-enable', '--voltha-enable', action='store_true',
+                            help='Run the tests with voltha environment enabled')
     parser_run.set_defaults(func=runTest)
 
     parser_setup = subparser.add_parser('setup', help='Setup cord tester environment')
@@ -1386,6 +1387,8 @@
                               help='Specify the voltha location in order to start voltha')
     parser_setup.add_argument('-voltha-intf', '--voltha-intf', default='eth0', type=str,
                               help='Specify the voltha interface for voltha to listen')
+    parser_setup.add_argument('-voltha-enable', '--voltha-enable', action='store_true',
+                              help='Run the tests with voltha environment enabled')
     parser_setup.set_defaults(func=setupCordTester)
 
     parser_xos = subparser.add_parser('xos', help='Building xos into cord tester environment')
diff --git a/src/test/setup/manifest-olt-voltha.json b/src/test/setup/manifest-olt-voltha.json
index 276e480..7629045 100644
--- a/src/test/setup/manifest-olt-voltha.json
+++ b/src/test/setup/manifest-olt-voltha.json
@@ -8,5 +8,6 @@
     "onos_image": "onosproject/onos:latest",
     "log_level" : "INFO",
     "jvm_heap_size" : "1G",
-    "karaf_version" : "3.0.5"
+    "karaf_version" : "3.0.5",
+    "voltha_enable" : true
 }
diff --git a/src/test/utils/TestManifest.py b/src/test/utils/TestManifest.py
index 26c5130..9d4825b 100644
--- a/src/test/utils/TestManifest.py
+++ b/src/test/utils/TestManifest.py
@@ -52,6 +52,7 @@
             self.karaf_version = args.karaf
             self.voltha_loc = args.voltha_loc
             self.voltha_intf = args.voltha_intf
+            self.voltha_enable = args.voltha_enable
         else:
             with open(self.manifest, 'r') as fd:
                 data = json.load(fd)
@@ -80,3 +81,7 @@
             self.karaf_version = data.get('karaf_version', '3.0.8')
             self.voltha_loc = data.get('voltha_loc', '')
             self.voltha_intf = data.get('voltha_intf', 'eth0')
+            voltha_enable = False
+            if self.voltha_loc:
+                voltha_enable = True
+            self.voltha_enable = data.get('voltha_enable', voltha_enable)