diff --git a/tests/itests/README.md b/tests/itests/README.md
new file mode 100644
index 0000000..00d4020
--- /dev/null
+++ b/tests/itests/README.md
@@ -0,0 +1,113 @@
+## VOLTHA TESTS
+
+There are two set of test cases in Voltha:
+* **Unit Tests**
+    *  These tests exercise the smallest testable parts of the code. They 
+    are designed to be fully automated and can be executed by a build 
+    machine (e.g. Jenkins).  
+ * **Integration Tests**
+    * These tests exercise a set of modules when combined together
+    
+For now, this document focuses on running the integration tests only.
+
+##### Running the Integration Tests
+
+This section provides the high level details on how to execute the Voltha 
+integration tests when running inside a Vagrant box.   They may need to be 
+adjusted when run in a different environment.
+
+* **Build_md_test**: This tests the instructions in the voltha/BUILD.md file. 
+Note that this test takes a while to run (more than 40 mins).  
+```
+cd /cord/incubator/voltha
+. ./env.sh
+nosetests -s tests/itests/docutests/build_md_test.py
+```
+* **Ofagent_multicontroller_failover**: TODO   
+
+* **Frameio**:  This tests the packet send/receive/filter capabilities of the 
+FrameIOManager.   This test needs to run as root.
+```
+cd /cord/incubator/voltha
+. ./env.sh
+make run-as-root-tests
+```
+* **Cold_activation_sequence**: This test creates the simulated_olt devices and 
+run through a cold activation sequence.  It exercises the following 
+areas:
+    * Chameleon REST interface 
+    * Voltha GRPC interface
+    * Voltha data model and business logic    
+    * Simulated Adapter
+    
+```
+cd /cord/incubator/voltha
+. ./env.sh
+docker-compose -f compose/docker-compose-system-test.yml up -d
+nosetests -s tests/itests/voltha/test_cold_activation_sequence.py
+```
+* **Device_state_changes**: This tests uses the ponsim OLT and ONUs to exercise 
+the device state changes (preprovisioning, enabled, disabled, reboot). 
+It exercises the following areas:
+    * Chameleon REST interface 
+    * Voltha GRPC interface
+    * Voltha data model and business logic
+    * Ponsim_olt and Ponsim_onu adapters
+    * Ponsim 
+
+First start the Voltha ensemble:
+```
+cd /cord/incubator/voltha
+. ./env.sh
+docker-compose -f compose/docker-compose-system-test.yml up -d
+```    
+Then start PONSIM in a separate window:
+``` 
+sudo -s
+. ./env.sh
+./ponsim/main.py -v -o 4
+``` 
+Run the test:
+``` 
+nosetests -s tests/itests/voltha/test_device_state_changes.py
+```  
+
+* **Persistence**: This test goes through several voltha restarts along with variations 
+of configurations in between to ensure data integrity is preserved.
+        
+During this test, the user will be prompted to start ponsim.  Use 
+these commands to run ponsim with 1 OLT and 4 ONUs. THis will also 
+enable alarm at a frequency of 5 seconds:
+``` 
+sudo -s
+. ./env.sh
+./ponsim/main.py -v -o 4 -a -f 5
+``` 
+
+The user will also be prompted to enable port forwarding on ponmgmt 
+bridge. Use these commands:
+``` 
+sudo -s
+echo 8 > /sys/class/net/ponmgmt/bridge/group_fwd_mask            
+``` 
+
+Run the test:
+``` 
+nosetests -s tests/itests/voltha/test_persistence.py
+```  
+
+* **Voltha_rest_apis**: This test exercises the Chameleon REST interface and 
+indirectly
+ the Voltha GPRC interface as well.  It tests both the Local and the Global 
+ interfaces.
+ 
+```
+cd /cord/incubator/voltha
+. ./env.sh
+docker-compose -f compose/docker-compose-system-test.yml up -d
+nosetests -s tests/itests/voltha/test_voltha_rest_apis.py
+```    
+
+* Voltha_alarm_events: TODO
+
+* Voltha_alarm_filters: TODO
diff --git a/tests/itests/voltha/test_cold_activation_sequence.py b/tests/itests/voltha/test_cold_activation_sequence.py
index 5a0d7ad..9a780f5 100644
--- a/tests/itests/voltha/test_cold_activation_sequence.py
+++ b/tests/itests/voltha/test_cold_activation_sequence.py
@@ -7,10 +7,18 @@
 from voltha.protos.common_pb2 import AdminState, OperStatus
 from voltha.protos import openflow_13_pb2 as ofp
 from tests.itests.voltha.rest_base import RestBase
+from common.utils.consulhelpers import get_endpoint_from_consul
 
+LOCAL_CONSUL = "localhost:8500"
 
 class TestColdActivationSequence(RestBase):
 
+    # Retrieve details of the REST entry point
+    rest_endpoint = get_endpoint_from_consul(LOCAL_CONSUL, 'chameleon-rest')
+
+    # Construct the base_url
+    base_url = 'http://' + rest_endpoint
+
     def wait_till(self, msg, predicate, interval=0.1, timeout=5.0):
         deadline = time() + timeout
         while time() < deadline:
@@ -128,8 +136,8 @@
                 if d['parent_id'] == olt_id
             ]
         self.wait_till(
-            'find four ONUs linked to the olt device',
-            lambda: len(find_our_onus()) >= 4,
+            'find ONUs linked to the olt device',
+            lambda: len(find_our_onus()) >= 1,
             2
         )
 
diff --git a/tests/itests/voltha/test_voltha_rest_apis.py b/tests/itests/voltha/test_voltha_rest_apis.py
index a9c9bc1..b1f66d6 100644
--- a/tests/itests/voltha/test_voltha_rest_apis.py
+++ b/tests/itests/voltha/test_voltha_rest_apis.py
@@ -2,64 +2,182 @@
 from time import time, sleep
 
 from google.protobuf.json_format import MessageToDict
-from unittest import main
-
+from unittest import main, TestCase
+from voltha.protos.device_pb2 import Device
 from tests.itests.voltha.rest_base import RestBase
 from voltha.core.flow_decomposer import mk_simple_flow_mod, in_port, output
 from voltha.protos import openflow_13_pb2 as ofp
+from common.utils.consulhelpers import get_endpoint_from_consul
 
+LOCAL_CONSUL = "localhost:8500"
 
 class GlobalRestCalls(RestBase):
 
-    # ~~~~~~~~~~~~~~~~~~~~~ GLOBAL TOP-LEVEL SERVICES~ ~~~~~~~~~~~~~~~~~~~~~~~~
+    def wait_till(self, msg, predicate, interval=0.1, timeout=5.0):
+        deadline = time() + timeout
+        while time() < deadline:
+            if predicate():
+                return
+            sleep(interval)
+        self.fail('Timed out while waiting for condition: {}'.format(msg))
 
-    def test_get_root(self):
+    # Retrieve details of the REST entry point
+    rest_endpoint = get_endpoint_from_consul(LOCAL_CONSUL, 'chameleon-rest')
+
+    # Construct the base_url
+    base_url = 'http://' + rest_endpoint
+    
+    def test_01_global_rest_apis(self):
+        # ~~~~~~~~~~~~~~~~~~~ GLOBAL TOP-LEVEL SERVICES~ ~~~~~~~~~~~~~~~~~~~~~~
+        self._get_root()
+        self._get_schema()
+        self._get_health()
+        # ~~~~~~~~~~~~~~~~~~~ TOP LEVEL VOLTHA OPERATIONS ~~~~~~~~~~~~~~~~~~~~~
+        self._get_voltha()
+        self._list_voltha_instances()
+        self._get_voltha_instance()
+        olt_id = self._add_olt_device()
+        self._verify_device_preprovisioned_state(olt_id)
+        self._activate_device(olt_id)
+        ldev_id = self._wait_for_logical_device(olt_id)
+        ldevices = self._list_logical_devices()
+        logical_device_id = ldevices['items'][0]['id']
+        self._get_logical_device(logical_device_id)
+        self._list_logical_device_ports(logical_device_id)
+        self._list_and_update_logical_device_flows(logical_device_id)
+        self._list_and_update_logical_device_flow_groups(logical_device_id)
+        devices = self._list_devices()
+        device_id = devices['items'][0]['id']
+        self._get_device(device_id)
+        self._list_device_ports(device_id)
+        self._list_device_flows(device_id)
+        self._list_device_flow_groups(device_id)
+        dtypes = self._list_device_types()
+        self._get_device_type(dtypes['items'][0]['id'])
+
+
+    def _get_root(self):
         res = self.get('/', expected_content_type='text/html')
         self.assertGreaterEqual(res.find('swagger'), 0)
 
-    def test_get_schema(self):
+    def _get_schema(self):
         res = self.get('/schema')
-        self.assertEqual(set(res.keys()), {'protos', 'swagger_from'})
+        self.assertEqual(set(res.keys()), {'protos', 'yang_from','swagger_from'})
 
-    def test_get_health(self):
+    def _get_health(self):
         res = self.get('/health')
         self.assertEqual(res['state'], 'HEALTHY')
 
     # ~~~~~~~~~~~~~~~~~~~~~ TOP LEVEL VOLTHA OPERATIONS ~~~~~~~~~~~~~~~~~~~~~~~
 
-    def test_get_voltha(self):
+    def _get_voltha(self):
         res = self.get('/api/v1')
         self.assertEqual(res['version'], '0.9.0')
 
-    def test_list_voltha_instances(self):
+    def _list_voltha_instances(self):
         res = self.get('/api/v1/instances')
         self.assertEqual(len(res['items']), 1)
 
-    def test_get_voltha_instance(self):
-        res = self.get('/api/v1/instances/1')
+    def _get_voltha_instance(self):
+        res = self.get('/api/v1/instances')
+        voltha_id=res['items'][0]
+        res = self.get('/api/v1/instances/{}'.format(voltha_id))
         self.assertEqual(res['version'], '0.9.0')
 
-    def test_list_logical_devices(self):
+    def _add_olt_device(self):
+        device = Device(
+            type='simulated_olt',
+            mac_address='00:00:00:00:00:01'
+        )
+        device = self.post('/api/v1/devices', MessageToDict(device),
+                           expected_code=200)
+        return device['id']
+
+    def _verify_device_preprovisioned_state(self, olt_id):
+        # we also check that so far what we read back is same as what we get
+        # back on create
+        device = self.get('/api/v1/devices/{}'.format(olt_id))
+        self.assertNotEqual(device['id'], '')
+        self.assertEqual(device['adapter'], 'simulated_olt')
+        self.assertEqual(device['admin_state'], 'PREPROVISIONED')
+        self.assertEqual(device['oper_status'], 'UNKNOWN')
+
+    def _activate_device(self, olt_id):
+        path = '/api/v1/devices/{}'.format(olt_id)
+        self.post(path + '/enable', expected_code=200)
+        device = self.get(path)
+        self.assertEqual(device['admin_state'], 'ENABLED')
+
+        self.wait_till(
+            'admin state moves to ACTIVATING or ACTIVE',
+            lambda: self.get(path)['oper_status'] in ('ACTIVATING', 'ACTIVE'),
+            timeout=0.5)
+
+        # eventually, it shall move to active state and by then we shall have
+        # device details filled, connect_state set, and device ports created
+        self.wait_till(
+            'admin state ACTIVE',
+            lambda: self.get(path)['oper_status'] == 'ACTIVE',
+            timeout=0.5)
+        device = self.get(path)
+        images = device['images']
+        image = images['image']
+        image_1 = image[0]
+        version = image_1['version']
+        self.assertNotEqual(version, '')
+        self.assertEqual(device['connect_status'], 'REACHABLE')
+
+        ports = self.get(path + '/ports')['items']
+        self.assertEqual(len(ports), 2)
+
+    def _wait_for_logical_device(self, olt_id):
+        # we shall find the logical device id from the parent_id of the olt
+        # (root) device
+        device = self.get(
+            '/api/v1/devices/{}'.format(olt_id))
+        self.assertNotEqual(device['parent_id'], '')
+        logical_device = self.get(
+            '/api/v1/logical_devices/{}'.format(device['parent_id']))
+
+        # the logical device shall be linked back to the hard device,
+        # its ports too
+        self.assertEqual(logical_device['root_device_id'], device['id'])
+
+        logical_ports = self.get(
+            '/api/v1/logical_devices/{}/ports'.format(
+                logical_device['id'])
+        )['items']
+        self.assertGreaterEqual(len(logical_ports), 1)
+        logical_port = logical_ports[0]
+        self.assertEqual(logical_port['id'], 'nni')
+        self.assertEqual(logical_port['ofp_port']['name'], 'nni')
+        self.assertEqual(logical_port['ofp_port']['port_no'], 129)
+        self.assertEqual(logical_port['device_id'], device['id'])
+        self.assertEqual(logical_port['device_port_no'], 2)
+        return logical_device['id']
+
+    def _list_logical_devices(self):
         res = self.get('/api/v1/logical_devices')
         self.assertGreaterEqual(len(res['items']), 1)
+        return res
 
-    def test_get_logical_device(self):
-        res = self.get('/api/v1/logical_devices/simulated1')
-        self.assertEqual(res['datapath_id'], '1')
+    def _get_logical_device(self, id):
+        res = self.get('/api/v1/logical_devices/{}'.format(id))
+        self.assertIsNotNone(res['datapath_id'])
 
-    def test_list_logical_device_ports(self):
-        res = self.get('/api/v1/logical_devices/simulated1/ports')
-        self.assertGreaterEqual(len(res['items']), 3)
+    def _list_logical_device_ports(self, id):
+        res = self.get('/api/v1/logical_devices/{}/ports'.format(id))
+        self.assertGreaterEqual(len(res['items']), 1)
 
-    def test_list_and_update_logical_device_flows(self):
+    def _list_and_update_logical_device_flows(self, id):
 
         # retrieve flow list
-        res = self.get('/api/v1/logical_devices/simulated1/flows')
+        res = self.get('/api/v1/logical_devices/{}/flows'.format(id))
         len_before = len(res['items'])
 
         # add some flows
         req = ofp.FlowTableUpdate(
-            id='simulated1',
+            id=id,
             flow_mod=mk_simple_flow_mod(
                 cookie=randint(1, 10000000000),
                 priority=len_before,
@@ -71,24 +189,24 @@
                 ]
             )
         )
-        res = self.post('/api/v1/logical_devices/simulated1/flows',
+        res = self.post('/api/v1/logical_devices/{}/flows'.format(id),
                         MessageToDict(req, preserving_proto_field_name=True),
                         expected_code=200)
         # TODO check some stuff on res
 
-        res = self.get('/api/v1/logical_devices/simulated1/flows')
+        res = self.get('/api/v1/logical_devices/{}/flows'.format(id))
         len_after = len(res['items'])
         self.assertGreater(len_after, len_before)
 
-    def test_list_and_update_logical_device_flow_groups(self):
+    def _list_and_update_logical_device_flow_groups(self, id):
 
         # retrieve flow list
-        res = self.get('/api/v1/logical_devices/simulated1/flow_groups')
+        res = self.get('/api/v1/logical_devices/{}/flow_groups'.format(id))
         len_before = len(res['items'])
 
         # add some flows
         req = ofp.FlowGroupTableUpdate(
-            id='simulated1',
+            id=id,
             group_mod=ofp.ofp_group_mod(
                 command=ofp.OFPGC_ADD,
                 type=ofp.OFPGT_ALL,
@@ -107,92 +225,121 @@
                 ]
             )
         )
-        res = self.post('/api/v1/logical_devices/simulated1/flow_groups',
+        res = self.post('/api/v1/logical_devices/{}/flow_groups'.format(id),
                         MessageToDict(req, preserving_proto_field_name=True),
                         expected_code=200)
         # TODO check some stuff on res
 
-        res = self.get('/api/v1/logical_devices/simulated1/flow_groups')
+        res = self.get('/api/v1/logical_devices/{}/flow_groups'.format(id))
         len_after = len(res['items'])
         self.assertGreater(len_after, len_before)
 
-    def test_list_devices(self):
+    def _list_devices(self):
         res = self.get('/api/v1/devices')
         self.assertGreaterEqual(len(res['items']), 2)
+        return res
 
-    def test_get_device(self):
-        res = self.get('/api/v1/devices/simulated_olt_1')
+    def _get_device(self, id):
+        res = self.get('/api/v1/devices/{}'.format(id))
         # TODO test result
 
-    def test_list_device_ports(self):
-        res = self.get('/api/v1/devices/simulated_olt_1/ports')
+    def _list_device_ports(self, id):
+        res = self.get('/api/v1/devices/{}/ports'.format(id))
         self.assertGreaterEqual(len(res['items']), 2)
 
-    def test_list_device_flows(self):
+    def _list_device_flows(self, id):
         # pump some flows into the logical device
-        self.test_list_and_update_logical_device_flows()
-        res = self.get('/api/v1/devices/simulated_olt_1/flows')
+        res = self.get('/api/v1/devices/{}/flows'.format(id))
         self.assertGreaterEqual(len(res['items']), 1)
 
-    def test_list_device_flow_groups(self):
-        res = self.get('/api/v1/devices/simulated_olt_1/flow_groups')
+    def _list_device_flow_groups(self,id):
+        res = self.get('/api/v1/devices/{}/flow_groups'.format(id))
         self.assertGreaterEqual(len(res['items']), 0)
 
-    def test_list_device_types(self):
+    def _list_device_types(self):
         res = self.get('/api/v1/device_types')
         self.assertGreaterEqual(len(res['items']), 2)
+        return res
 
-    def test_get_device_type(self):
-        res = self.get('/api/v1/device_types/simulated_olt')
+    def _get_device_type(self, dtype):
+        res = self.get('/api/v1/device_types/{}'.format(dtype))
+        self.assertIsNotNone(res)
         # TODO test the result
 
-    def test_list_device_groups(self):
-        res = self.get('/api/v1/device_groups')
-        self.assertGreaterEqual(len(res['items']), 1)
+    def _list_device_groups(self):
+        pass
+        # res = self.get('/api/v1/device_groups')
+        # self.assertGreaterEqual(len(res['items']), 1)
 
-    def test_get_device_group(self):
-        res = self.get('/api/v1/device_groups/1')
-        # TODO test the result
+    def _get_device_group(self):
+        pass
+        # res = self.get('/api/v1/device_groups/1')
+        # # TODO test the result
 
 
 class TestLocalRestCalls(RestBase):
 
-    # ~~~~~~~~~~~~~~~~~~ VOLTHA INSTANCE LEVEL OPERATIONS ~~~~~~~~~~~~~~~~~~~~~
+    # Retrieve details of the REST entry point
+    rest_endpoint = get_endpoint_from_consul(LOCAL_CONSUL, 'chameleon-rest')
 
-    def test_get_local(self):
+    # Construct the base_url
+    base_url = 'http://' + rest_endpoint
+
+    def test_02_local_rest_apis(self):
+        # ~~~~~~~~~~~~~~~~ VOLTHA INSTANCE LEVEL OPERATIONS ~~~~~~~~~~~~~~~~~~~
+        self._get_local()
+        self._get_local_health()
+        self._list_local_adapters()
+        ldevices = self._list_local_logical_devices()
+        logical_device_id = ldevices[0]['id']
+        self._get_local_logical_device(logical_device_id)
+        self._list_local_logical_device_ports(logical_device_id)
+        self._list_and_update_local_logical_device_flows(logical_device_id)
+        self._list_and_update_local_logical_device_flow_groups(logical_device_id)
+        devices = self._list_local_devices()
+        device_id = devices['items'][0]['id']
+        self._get_local_device(device_id)
+        self._list_local_device_ports(device_id)
+        self._list_local_device_flows(device_id)
+        self._list_local_device_flow_groups(device_id)
+        dtypes = self._list_local_device_types()
+        self._get_local_device_type(dtypes['items'][0]['id'])
+
+    def _get_local(self):
         self.assertEqual(self.get('/api/v1/local')['version'], '0.9.0')
 
-    def test_get_local_health(self):
+    def _get_local_health(self):
         d = self.get('/api/v1/local/health')
         self.assertEqual(d['state'], 'HEALTHY')
 
-    def test_list_local_adapters(self):
+    def _list_local_adapters(self):
         self.assertGreaterEqual(
             len(self.get('/api/v1/local/adapters')['items']), 1)
 
-    def test_list_local_logical_devices(self):
-        self.assertGreaterEqual(
-            len(self.get('/api/v1/local/logical_devices')['items']), 1)
+    def _list_local_logical_devices(self):
+        res = self.get('/api/v1/local/logical_devices')['items']
+        self.assertGreaterEqual(res, 1)
+        return res
 
-    def test_get_local_logical_device(self):
-        res = self.get('/api/v1/local/logical_devices/simulated1')
-        self.assertEqual(res['datapath_id'], '1')
+    def _get_local_logical_device(self, id):
+        res = self.get('/api/v1/local/logical_devices/{}'.format(id))
+        self.assertIsNotNone(res['datapath_id'])
 
-    def test_list_local_logical_device_ports(self):
-        res = self.get('/api/v1/local/logical_devices/simulated1/ports')
-        self.assertGreaterEqual(len(res['items']), 3)
+    def _list_local_logical_device_ports(self, id):
+        res = self.get('/api/v1/local/logical_devices/{}/ports'.format(id))
+        self.assertGreaterEqual(len(res['items']), 1)
 
-    def test_list_and_update_local_logical_device_flows(self):
+    def _list_and_update_local_logical_device_flows(self, id):
 
         # retrieve flow list
-        res = self.get('/api/v1/local/logical_devices/simulated1/flows')
+        res = self.get('/api/v1/local/logical_devices/{}/flows'.format(id))
         len_before = len(res['items'])
 
         t0 = time()
         # add some flows
         for _ in xrange(10):
             req = ofp.FlowTableUpdate(
-                id='simulated1',
+                id=id,
                 flow_mod=mk_simple_flow_mod(
                     cookie=randint(1, 10000000000),
                     priority=randint(1, 10000),  # to make it unique
@@ -204,19 +351,20 @@
                     ]
                 )
             )
-            self.post('/api/v1/local/logical_devices/simulated1/flows',
+            self.post('/api/v1/local/logical_devices/{}/flows'.format(id),
                       MessageToDict(req, preserving_proto_field_name=True),
                       expected_code=200)
         print time() - t0
 
-        res = self.get('/api/v1/local/logical_devices/simulated1/flows')
+        res = self.get('/api/v1/local/logical_devices/{}/flows'.format(id))
         len_after = len(res['items'])
         self.assertGreater(len_after, len_before)
 
-    def test_list_and_update_local_logical_device_flow_groups(self):
+    def _list_and_update_local_logical_device_flow_groups(self, id):
 
         # retrieve flow list
-        res = self.get('/api/v1/local/logical_devices/simulated1/flow_groups')
+        res = self.get('/api/v1/local/logical_devices/{'
+                       '}/flow_groups'.format(id))
         len_before = len(res['items'])
 
         # add some flows
@@ -241,66 +389,84 @@
             )
         )
 
-        res = self.post('/api/v1/local/logical_devices/simulated1/flow_groups',
+        res = self.post('/api/v1/local/logical_devices/{'
+                        '}/flow_groups'.format(id),
                         MessageToDict(req, preserving_proto_field_name=True),
                         expected_code=200)
         # TODO check some stuff on res
 
-        res = self.get('/api/v1/local/logical_devices/simulated1/flow_groups')
+        res = self.get('/api/v1/local/logical_devices/{'
+                       '}/flow_groups'.format(id))
         len_after = len(res['items'])
         self.assertGreater(len_after, len_before)
 
-    def test_list_local_devices(self):
+    def _list_local_devices(self):
         res = self.get('/api/v1/local/devices')
         self.assertGreaterEqual(len(res['items']), 2)
+        return res
 
-    def test_get_local_device(self):
-        res = self.get('/api/v1/local/devices/simulated_olt_1')
-        # TODO test result
+    def _get_local_device(self, id):
+        res = self.get('/api/v1/local/devices/{}'.format(id))
+        self.assertIsNotNone(res)
 
-    def test_list_local_device_ports(self):
-        res = self.get('/api/v1/local/devices/simulated_olt_1/ports')
+    def _list_local_device_ports(self, id):
+        res = self.get('/api/v1/local/devices/{}/ports'.format(id))
         self.assertGreaterEqual(len(res['items']), 2)
 
-    def test_list_local_device_flows(self):
-        res = self.get('/api/v1/local/devices/simulated_olt_1/flows')
+    def _list_local_device_flows(self, id):
+        res = self.get('/api/v1/local/devices/{}/flows'.format(id))
         self.assertGreaterEqual(len(res['items']), 0)
 
-    def test_list_local_device_flow_groups(self):
-        res = self.get('/api/v1/local/devices/simulated_olt_1/flow_groups')
+    def _list_local_device_flow_groups(self, id):
+        res = self.get('/api/v1/local/devices/{}/flow_groups'.format(id))
         self.assertGreaterEqual(len(res['items']), 0)
 
-    def test_list_local_device_types(self):
+    def _list_local_device_types(self):
         res = self.get('/api/v1/local/device_types')
         self.assertGreaterEqual(len(res['items']), 2)
+        return res
 
-    def test_get_local_device_type(self):
-        res = self.get('/api/v1/local/device_types/simulated_olt')
-        # TODO test the result
+    def _get_local_device_type(self, type):
+        res = self.get('/api/v1/local/device_types/{}'.format(type))
+        self.assertIsNotNone(res)
 
-    def test_list_local_device_groups(self):
-        res = self.get('/api/v1/local/device_groups')
-        self.assertGreaterEqual(len(res['items']), 1)
+    def _list_local_device_groups(self):
+        pass
+        # res = self.get('/api/v1/local/device_groups')
+        # self.assertGreaterEqual(len(res['items']), 1)
 
-    def test_get_local_device_group(self):
-        res = self.get('/api/v1/local/device_groups/1')
-        # TODO test the result
+    def _get_local_device_group(self):
+        pass
+        # res = self.get('/api/v1/local/device_groups/1')
+        # # TODO test the result
 
 
 class TestGlobalNegativeCases(RestBase):
 
+    # Retrieve details of the REST entry point
+    rest_endpoint = get_endpoint_from_consul(LOCAL_CONSUL, 'chameleon-rest')
+
+    # Construct the base_url
+    base_url = 'http://' + rest_endpoint
+
     # ~~~~~~~~~~~~~~~~~~~~~~~~~~ NEGATIVE TEST CASES ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    def test_invalid_url(self):
+    def test_03_negative_behavior(self):
+        self._invalid_url()
+        self._instance_not_found()
+        self._logical_device_not_found()
+        self._device_not_found()
+
+    def _invalid_url(self):
         self.get('/some_invalid_url', expected_code=404)
 
-    def test_instance_not_found(self):
+    def _instance_not_found(self):
         self.get('/api/v1/instances/nay', expected_code=404)
 
-    def test_logical_device_not_found(self):
+    def _logical_device_not_found(self):
         self.get('/api/v1/logical_devices/nay', expected_code=404)
 
-    def test_device_not_found(self):
+    def _device_not_found(self):
         self.get('/api/v1/devices/nay', expected_code=404)
 
     # TODO add more negative cases
diff --git a/voltha/adapters/simulated_olt/simulated_olt.py b/voltha/adapters/simulated_olt/simulated_olt.py
index 0759d9c..d5f206e 100644
--- a/voltha/adapters/simulated_olt/simulated_olt.py
+++ b/voltha/adapters/simulated_olt/simulated_olt.py
@@ -483,7 +483,7 @@
         device.oper_status = OperStatus.ACTIVE
         self.adapter_agent.update_device(device)
 
-        # reactor.callLater(0.1, self._simulate_detection_of_onus, device.id)
+        reactor.callLater(0.1, self._simulate_detection_of_onus, device.id)
         self.start_kpi_collection(device.id)
 
         self.start_alarm_simulation(device.id)
