Use static uplink vlans (configurable) if the device is not found in the uplink map for the subscriber.
Plus other misc. changes related to voltha config

Change-Id: Icf2548af82229e984f16005950a34a73bdcd9cbc
diff --git a/src/test/cordSubscriber/cordSubscriberTest.json b/src/test/cordSubscriber/cordSubscriberTest.json
index 07c20f1..3a03f11 100644
--- a/src/test/cordSubscriber/cordSubscriberTest.json
+++ b/src/test/cordSubscriber/cordSubscriberTest.json
@@ -4,5 +4,6 @@
     "VOLTHA_IGMP_ITERATIONS" : 100,
     "VOLTHA_CONFIG_FAKE" : true,
     "VOLTHA_OLT_TYPE" : "ponsim_olt",
-    "VOLTHA_OLT_MAC"  : "00:0c:e2:31:12:00"
+    "VOLTHA_OLT_MAC"  : "00:0c:e2:31:12:00",
+    "VOLTHA_UPLINK_VLAN_START" : 333
 }
diff --git a/src/test/cordSubscriber/cordSubscriberTest.py b/src/test/cordSubscriber/cordSubscriberTest.py
index 442b092..0c79cc6 100644
--- a/src/test/cordSubscriber/cordSubscriberTest.py
+++ b/src/test/cordSubscriber/cordSubscriberTest.py
@@ -269,6 +269,7 @@
       VOLTHA_HOST = None
       VOLTHA_REST_PORT = 8881
       VOLTHA_UPLINK_VLAN_MAP = { 'of:0001000000000001' : '222' }
+      VOLTHA_UPLINK_VLAN_START = 333
       VOLTHA_IGMP_ITERATIONS = 100
       VOLTHA_CONFIG_FAKE = True
       VOLTHA_OLT_TYPE = 'simulated_olt'
diff --git a/src/test/utils/CordTestConfig.py b/src/test/utils/CordTestConfig.py
index f41d0da..f17fcf8 100644
--- a/src/test/utils/CordTestConfig.py
+++ b/src/test/utils/CordTestConfig.py
@@ -80,7 +80,8 @@
                         config_fake = False,
                         olt_type = 'ponsim_olt',
                         olt_mac = '00:0c:e2:31:12:00',
-                        uplink_vlan_map = { 'of:0000000000000001' : '222' }
+                        uplink_vlan_map = { 'of:0000000000000001' : '222' },
+                        uplink_vlan_start = 333
                         )
     voltha_enabled = bool(int(os.getenv('VOLTHA_ENABLED', 0)))
     voltha_configure = True
diff --git a/src/test/utils/VolthaCtrl.py b/src/test/utils/VolthaCtrl.py
index 4c5b780..fe2761c 100644
--- a/src/test/utils/VolthaCtrl.py
+++ b/src/test/utils/VolthaCtrl.py
@@ -139,15 +139,17 @@
         os.system(service_stop_cmd)
 
 class VolthaCtrl(object):
-
+    UPLINK_VLAN_START = 333
     UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' }
     REST_PORT = 8881
+    HOST = '172.17.0.1'
 
-    def __init__(self, host, rest_port = REST_PORT, uplink_vlan_map = UPLINK_VLAN_MAP):
+    def __init__(self, host = HOST, rest_port = REST_PORT, uplink_vlan_map = UPLINK_VLAN_MAP, uplink_vlan_start = UPLINK_VLAN_START):
         self.host = host
         self.rest_port = rest_port
         self.rest_url = 'http://{}:{}/api/v1'.format(host, rest_port)
         self.uplink_vlan_map = uplink_vlan_map
+        VolthaCtrl.UPLINK_VLAN_START = uplink_vlan_start
         self.switches = []
         self.switch_map = {}
 
@@ -165,8 +167,11 @@
             nni_ports = filter(lambda p: p['isEnabled'] and 'annotations' in p and p['annotations']['portName'].startswith('nni'), ports)
             uni_ports = filter(lambda p: p['isEnabled'] and 'annotations' in p and p['annotations']['portName'].startswith('uni'), ports)
             if device_id not in self.uplink_vlan_map:
-                log.info('Skipping voltha device %s as uplink vlan does not exist' %device_id)
-                continue
+                uplink_vlan = VolthaCtrl.UPLINK_VLAN_START
+                VolthaCtrl.UPLINK_VLAN_START += 1
+                log.info('Voltha device %s not in map. Using uplink vlan %d' %(device_id, uplink_vlan))
+            else:
+                uplink_vlan = self.uplink_vlan_map[device_id]
             if not nni_ports:
                 log.info('Voltha device %s has no NNI ports' %device_id)
                 if fake is True:
@@ -183,7 +188,6 @@
                 else:
                     log.info('Skip configuring device %s' %device_id)
                     continue
-            uplink_vlan = self.uplink_vlan_map[device_id]
             onu_ports = map(lambda uni: uni['port'], uni_ports)
             self.switch_map[device_id] = dict(uplink_vlan = uplink_vlan, ports = onu_ports)
             device_config['devices'][device_id] = {}
@@ -323,9 +327,12 @@
 def voltha_setup(host = '172.17.0.1', rest_port = VolthaCtrl.REST_PORT,
                  olt_type = 'ponsim_olt', olt_mac = '00:0c:e2:31:12:00',
                  uplink_vlan_map = VolthaCtrl.UPLINK_VLAN_MAP,
+                 uplink_vlan_start = VolthaCtrl.UPLINK_VLAN_START,
                  config_fake = False, olt_app = None):
 
-    voltha = VolthaCtrl(host, rest_port = rest_port, uplink_vlan_map = uplink_vlan_map)
+    voltha = VolthaCtrl(host, rest_port = rest_port,
+                        uplink_vlan_map = uplink_vlan_map,
+                        uplink_vlan_start = uplink_vlan_start)
     if olt_type.startswith('ponsim'):
         ponsim_address = '{}:50060'.format(host)
         log.info('Enabling ponsim olt')
diff --git a/src/test/voltha/volthaTest.json b/src/test/voltha/volthaTest.json
index d397700..6ad9afd 100644
--- a/src/test/voltha/volthaTest.json
+++ b/src/test/voltha/volthaTest.json
@@ -2,5 +2,6 @@
     "OLT_TYPE" : "simulated_olt",
     "OLT_MAC"  : "00:0c:e2:31:12:00",
     "VOLTHA_HOST" : "172.17.0.1",
-    "VOLTHA_REST_PORT" : 8881
+    "VOLTHA_REST_PORT" : 8881,
+    "VOLTHA_UPLINK_VLAN_START" : 444
 }
diff --git a/src/test/voltha/volthaTest.py b/src/test/voltha/volthaTest.py
index a6a6103..1be45ba 100644
--- a/src/test/voltha/volthaTest.py
+++ b/src/test/voltha/volthaTest.py
@@ -166,6 +166,7 @@
     VOLTHA_OLT_MAC = '00:0c:e2:31:12:00'
     VOLTHA_IGMP_ITERATIONS = 100
     voltha = None
+    voltha_attrs = None
     success = True
     olt_device_id = None
     apps = ('org.opencord.aaa', 'org.onosproject.dhcp', 'org.onosproject.dhcprelay')
@@ -208,9 +209,9 @@
     INTF_RX_DEFAULT = 'veth0'
     INTF_2_RX_DEFAULT = 'veth6'
     TESTCASE_TIMEOUT = 300
-#    VOLTHA_CONFIG_FAKE = True
     VOLTHA_CONFIG_FAKE = False
     VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' }
+    VOLTHA_UPLINK_VLAN_START = 444
     VOLTHA_ONU_UNI_PORT = 'veth0'
 
     dhcp_server_config = {
@@ -369,7 +370,11 @@
     @classmethod
     def setUpClass(cls):
         cls.update_apps_version()
-        cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
+        cls.voltha_attrs = dict(host = cls.VOLTHA_HOST,
+                                rest_port = cls.VOLTHA_REST_PORT,
+                                uplink_vlan_map = cls.VOLTHA_UPLINK_VLAN_MAP,
+                                uplink_vlan_start = cls.VOLTHA_UPLINK_VLAN_START)
+        cls.voltha = VolthaCtrl(**cls.voltha_attrs)
         cls.install_app_table()
         cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
         cls.port_map, cls.port_list = cls.olt.olt_port_map()
@@ -1262,9 +1267,7 @@
 
     def voltha_subscribers(self, services, cbs = None, num_subscribers = 1, num_channels = 1, src_list = None):
           """Test subscriber join next for channel surfing"""
-          voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+          voltha = VolthaCtrl(**self.voltha_attrs)
           if self.VOLTHA_OLT_TYPE.startswith('ponsim'):
              ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
              log_test.info('Enabling ponsim olt')
@@ -1411,9 +1414,7 @@
         time.sleep(10)
         switch_map = None
         olt_configured = False
-        voltha = VolthaCtrl(self.VOLTHA_HOST,
-                            rest_port = self.VOLTHA_REST_PORT,
-                            uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+        voltha = VolthaCtrl(**self.voltha_attrs)
         try:
             switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
             if not switch_map:
@@ -1453,9 +1454,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1497,9 +1496,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1540,9 +1537,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1586,9 +1581,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1638,9 +1631,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1693,9 +1684,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1748,9 +1737,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1806,9 +1793,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1863,9 +1848,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1920,9 +1903,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -1981,9 +1962,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2042,9 +2021,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2102,9 +2079,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2159,9 +2134,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2218,9 +2191,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2277,9 +2248,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2338,9 +2307,7 @@
 
             onu_device_id = devices_list['items'][1]['id']
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                              rest_port = self.VOLTHA_REST_PORT,
-                              uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2446,9 +2413,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2490,9 +2455,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2536,9 +2499,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2579,9 +2540,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2624,9 +2583,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2670,9 +2627,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2715,9 +2670,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2760,9 +2713,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2806,9 +2757,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2849,9 +2798,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2892,9 +2839,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2939,9 +2884,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -2992,9 +2935,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3037,9 +2978,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3084,9 +3023,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3141,9 +3078,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3201,9 +3136,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3258,9 +3191,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3314,9 +3245,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3368,9 +3297,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3427,9 +3354,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3488,9 +3413,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3545,9 +3468,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3602,9 +3523,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3658,9 +3577,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3713,9 +3630,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3767,9 +3682,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3821,9 +3734,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3878,9 +3789,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3935,9 +3844,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -3996,9 +3903,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -4053,9 +3958,7 @@
             ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
             device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
             assert_not_equal(device_id, None)
-            voltha = VolthaCtrl(self.VOLTHA_HOST,
-                                rest_port = self.VOLTHA_REST_PORT,
-                                uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
+            voltha = VolthaCtrl(**self.voltha_attrs)
             time.sleep(10)
             switch_map = None
             olt_configured = False
@@ -5302,4 +5205,3 @@
         self.voltha_subscribers(services, cbs = cbs,
                                     num_subscribers = num_subscribers,
                                     num_channels = num_channels)
-