From cb8e8cc5ec1a149267f0f58c6ea4179827bc229b Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Mon, 10 Jul 2023 16:25:46 +0000
Subject: [PATCH] Pre-release CI/CD pipeline fixes

---
 src/service/tests/ServiceHandler_L3NM_OC.py | 21 ++++----
 src/service/tests/test_unitary.py           | 55 +++++++++------------
 2 files changed, 33 insertions(+), 43 deletions(-)

diff --git a/src/service/tests/ServiceHandler_L3NM_OC.py b/src/service/tests/ServiceHandler_L3NM_OC.py
index a8f1e315a..47d061883 100644
--- a/src/service/tests/ServiceHandler_L3NM_OC.py
+++ b/src/service/tests/ServiceHandler_L3NM_OC.py
@@ -137,14 +137,15 @@ SERVICE_R1_R2_DESCRIPTOR   = json_service_l3nm_planned(SERVICE_R1_R2_UUID)
 
 # ----- Test Descriptor ------------------------------------------------------------------------------------------------
 TEST_SERVICE_HANDLER = (SERVICE_HANDLER_NAME, {
-    'contexts'              : [CONTEXT],
-    'topologies'            : [TOPOLOGY],
-    'devices'               : [DEVICE_R1, DEVICE_R2, DEVICE_O1],
-    'links'                 : [LINK_R1_O1, LINK_R2_O1],
-
-    'service_id'            : SERVICE_R1_R2_ID,
-    'service_descriptor'    : SERVICE_R1_R2_DESCRIPTOR,
-    'service_endpoint_ids'  : SERVICE_R1_R2_ENDPOINT_IDS,
-    'service_config_rules'  : SERVICE_R1_R2_CONFIG_RULES,
-    'service_constraints'   : SERVICE_R1_R2_CONSTRAINTS,
+    'contexts'                          : [CONTEXT],
+    'topologies'                        : [TOPOLOGY],
+    'devices'                           : [DEVICE_R1, DEVICE_R2, DEVICE_O1],
+    'links'                             : [LINK_R1_O1, LINK_R2_O1],
+    'service_id'                        : SERVICE_R1_R2_ID,
+    'service_descriptor'                : SERVICE_R1_R2_DESCRIPTOR,
+    'service_endpoint_ids'              : SERVICE_R1_R2_ENDPOINT_IDS,
+    'service_config_rules'              : SERVICE_R1_R2_CONFIG_RULES,
+    'service_constraints'               : SERVICE_R1_R2_CONSTRAINTS,
+    'service_constraints_location'      : [],
+    'service_constraints_location_new'  : [],
 })
diff --git a/src/service/tests/test_unitary.py b/src/service/tests/test_unitary.py
index aa44714af..05d7ac09a 100644
--- a/src/service/tests/test_unitary.py
+++ b/src/service/tests/test_unitary.py
@@ -93,9 +93,8 @@ class TestServiceHandlers:
 
 
     def test_service_create_correct(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -104,9 +103,8 @@ class TestServiceHandlers:
 
 
     def test_service_get_created(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -116,9 +114,8 @@ class TestServiceHandlers:
 
 
     def test_service_update_configure(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -136,9 +133,8 @@ class TestServiceHandlers:
                     str(device_id), i, grpc_message_to_json_string(config_rule)))
 
     def test_service_update_deconfigure(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -156,9 +152,8 @@ class TestServiceHandlers:
 
 
     def test_service_get_updated(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -168,9 +163,8 @@ class TestServiceHandlers:
 
 
     def test_service_update_configure_loc(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -189,9 +183,8 @@ class TestServiceHandlers:
 
 
     def test_service_get_updated_1(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -201,9 +194,8 @@ class TestServiceHandlers:
 
 
     def test_service_update_configure_loc_new(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -222,9 +214,8 @@ class TestServiceHandlers:
 
 
     def test_service_get_updated_2(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -233,9 +224,8 @@ class TestServiceHandlers:
         LOGGER.info('service_data = {:s}'.format(grpc_message_to_json_string(service_data)))
 
     def test_service_delete_loc(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
@@ -243,9 +233,8 @@ class TestServiceHandlers:
         service_client.DeleteService(ServiceId(**service_id))
 
     def test_cleanup_environment(
-        self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints,
-        service_constraints_location, service_constraints_location_new,
-        contexts, topologies, devices, links,
+        self, contexts, topologies, devices, links, service_id, service_descriptor, service_endpoint_ids,
+        service_config_rules, service_constraints, service_constraints_location, service_constraints_location_new,
         context_client : ContextClient,     # pylint: disable=redefined-outer-name
         device_client : DeviceClient,       # pylint: disable=redefined-outer-name
         service_client : ServiceClient):    # pylint: disable=redefined-outer-name
-- 
GitLab