diff --git a/test/test_ims_data.py b/test/test_ims_data.py
index bf37692f3cbdbe0049aa1ca469cfeade9a15a6c9..171c5750c857a6448277fa1732d06dada860b9d5 100644
--- a/test/test_ims_data.py
+++ b/test/test_ims_data.py
@@ -5,7 +5,85 @@ from inventory_provider.db.ims import InventoryStatus
 from inventory_provider.db.ims_data import lookup_lg_routers, \
     otrs_get_customer_company_rows, \
     otrs_get_customer_users_rows, get_node_locations, IMS_OPSDB_STATUS_MAP, \
-    get_fibre_info
+    get_fibre_info, get_port_id_services
+
+
+def test_get_port_id_services(mocker):
+    called = False
+
+    def _se(a, b, c, step_count):
+        nonlocal called
+        if called:
+            return {}
+        else:
+            called = True
+        with open('test/data/ims_port_id_services_data.json') as data:
+            return json.load(data)
+
+    mocker.patch.object(
+        inventory_provider.db.ims.IMS,
+        'get_filtered_entities',
+        side_effect=_se
+    )
+
+    ds = inventory_provider.db.ims.IMS(
+        'dummy_base', 'dummy_username', 'dummy_password')
+    res = list(get_port_id_services(ds))
+
+    # this is the number of different product types that are considered service
+    # and speed types that that cover circuit types that have relevant circuits
+    # and ethernet product type as other relevant circuits also need tracking
+    assert ds.get_filtered_entities.call_count == 20
+    predicted = [
+        {
+            'id': 663060,
+            'name': 'RENATER_AP2',
+            'status': 'operational',
+            'circuit_type': 'service',
+            'service_type': 'GEANT IP',
+            'project': 'RENATER',
+            'port_a_id': 224507,
+        },
+        {
+            'id': 663104,
+            'name': 'ULAKBIM_AP2_IAS',
+            'status': 'operational',
+            'circuit_type': 'service',
+            'service_type': 'GEANT PEERING',
+            'project': 'ULAKBIM',
+            'port_a_id': 224464,
+        },
+        {
+            'id': 679324,
+            'name': 'AMSTERDAM-LONDON-100GBE-001(ETH)',
+            'status': 'operational',
+            'circuit_type': 'circuit',
+            'service_type': 'ETHERNET',
+            'project': 'ETH',
+            'port_a_id': 6423107,
+            'port_b_id': 6419340,
+        },
+        {
+            'id': 679324,
+            'name': 'AMSTERDAM-LONDON-100GBE-001(ETH)',
+            'status': 'operational',
+            'circuit_type': 'circuit',
+            'service_type': 'ETHERNET',
+            'project': 'ETH',
+            'port_a_id': 6419340,
+            'port_b_id': 6423107,
+        },
+        {
+            'id': 679324,
+            'name': 'AMSTERDAM-LONDON-100GBE-001(ETH)',
+            'status': 'operational',
+            'circuit_type': 'circuit',
+            'service_type': 'ETHERNET',
+            'project': 'ETH',
+            'port_a_id': 6423111
+        }
+    ]
+    assert res == predicted
 
 
 def test_get_fibre_info(mocker):