From 4208ca006232bb368739e0c724c6ccf1424aeb6c Mon Sep 17 00:00:00 2001
From: Neda Moeini <neda.moeini@geant.org>
Date: Thu, 5 Dec 2024 15:58:34 +0100
Subject: [PATCH] Update the relevant import WF

---
 gso/cli/imports.py                            | 13 ++---
 gso/utils/types/geant_ids.py                  | 49 +++++++++++++++++++
 .../edge_port/create_imported_edge_port.py    |  5 +-
 .../iptrunk/create_imported_iptrunk.py        | 13 ++---
 test/cli/test_imports.py                      | 18 +++----
 test/conftest.py                              | 18 +++++--
 test/fixtures/edge_port_fixtures.py           |  2 +-
 test/fixtures/iptrunk_fixtures.py             |  4 +-
 test/fixtures/l3_core_service_fixtures.py     |  2 +-
 test/fixtures/layer_2_circuit_fixtures.py     |  2 +-
 .../test_create_imported_edge_port.py         |  2 +-
 .../edge_port/test_modify_edge_port.py        |  4 +-
 .../iptrunk/test_create_imported_iptrunk.py   |  6 +--
 .../iptrunk/test_modify_trunk_interface.py    |  6 +--
 .../test_create_imported_layer_2_circuit.py   |  2 +-
 .../test_create_imported_l3_core_service.py   |  2 +-
 .../test_modify_l3_core_service.py            |  4 +-
 17 files changed, 107 insertions(+), 45 deletions(-)
 create mode 100644 gso/utils/types/geant_ids.py

diff --git a/gso/cli/imports.py b/gso/cli/imports.py
index ba33565e..4c973ace 100644
--- a/gso/cli/imports.py
+++ b/gso/cli/imports.py
@@ -40,6 +40,7 @@ from gso.services.subscriptions import (
 )
 from gso.utils.shared_enums import SBPType, Vendor
 from gso.utils.types.base_site import BaseSiteValidatorModel
+from gso.utils.types.geant_ids import IMPORTED_GA_ID, IMPORTED_GS_ID
 from gso.utils.types.interfaces import BandwidthString, LAGMember, LAGMemberList, PhysicalPortCapacity
 from gso.utils.types.ip_address import (
     AddressSpace,
@@ -116,7 +117,7 @@ class IptrunkImportModel(BaseModel):
     """Required fields for importing an existing ``gso.products.product_types.iptrunk``."""
 
     partner: str
-    gs_id: str | None
+    gs_id: IMPORTED_GS_ID | None
     iptrunk_type: IptrunkType
     iptrunk_description: str | None = None
     iptrunk_speed: PhysicalPortCapacity
@@ -124,11 +125,11 @@ class IptrunkImportModel(BaseModel):
     iptrunk_isis_metric: int
     side_a_node_id: str
     side_a_ae_iface: str
-    side_a_ga_id: str | None
+    side_a_ga_id: IMPORTED_GA_ID | None
     side_a_ae_members: LAGMemberList[LAGMember]
     side_b_node_id: str
     side_b_ae_iface: str
-    side_b_ga_id: str | None
+    side_b_ga_id: IMPORTED_GA_ID | None
     side_b_ae_members: LAGMemberList[LAGMember]
 
     iptrunk_ipv4_network: ipaddress.IPv4Network
@@ -197,7 +198,7 @@ class EdgePortImportModel(BaseModel):
     encapsulation: EncapsulationType
     name: str
     minimum_links: int
-    ga_id: str | None
+    ga_id: IMPORTED_GA_ID | None
     mac_address: str | None
     partner: str
     enable_lacp: bool
@@ -269,7 +270,7 @@ class L3CoreServiceImportModel(BaseModel):
 
         edge_port: str
         ap_type: str
-        gs_id: str
+        gs_id: IMPORTED_GS_ID
         sbp_type: SBPType = SBPType.L3
         is_tagged: bool = False
         vlan_id: VLAN_ID
@@ -349,7 +350,7 @@ class Layer2CircuitServiceImportModel(BaseModel):
 
     service_type: Layer2CircuitServiceType
     partner: str
-    gs_id: str
+    gs_id: IMPORTED_GS_ID
     vc_id: VC_ID
     layer_2_circuit_side_a: ServiceBindingPortInput
     layer_2_circuit_side_b: ServiceBindingPortInput
diff --git a/gso/utils/types/geant_ids.py b/gso/utils/types/geant_ids.py
new file mode 100644
index 00000000..adc3b19c
--- /dev/null
+++ b/gso/utils/types/geant_ids.py
@@ -0,0 +1,49 @@
+"""Type definitions for the GA and GS IDs."""
+
+from functools import partial
+from typing import Annotated
+
+from pydantic import AfterValidator
+
+from gso.services.subscriptions import is_resource_type_value_unique
+
+
+def validate_id(value: str, prefix: str, field_name: str) -> str:
+    """Validate that the ID is unique, has the correct prefix, and is within valid constraints.
+
+    Args:
+        value (str): The ID value to validate.
+        prefix (str): The required prefix for the ID (e.g., "GA-" or "GS-").
+        field_name (str): The database field name to check for uniqueness (e.g., "ga_id" or "gs_id").
+
+    Raises:
+        ValueError: If the ID is not valid.
+
+    Returns:
+        str: The validated ID.
+    """
+    min_range = 50000
+    max_range = 99999
+    if not value.startswith(prefix):
+        err = f"{field_name} must start with the prefix '{prefix}'."
+        raise ValueError(err)
+
+    try:
+        numeric_part = int(value[len(prefix) :])
+    except ValueError:
+        err = f"{field_name} must have a numeric part after the prefix '{prefix}'."
+        raise ValueError(err) from ValueError
+
+    if min_range <= numeric_part < max_range:
+        err = f"{field_name} must not have a numeric part between 50000 and 99999."
+        raise ValueError(err)
+
+    if not is_resource_type_value_unique(field_name, value):
+        err = f"{field_name} must be unique."
+        raise ValueError(err)
+
+    return value
+
+
+IMPORTED_GA_ID = Annotated[str, AfterValidator(partial(validate_id, prefix="GA-", field_name="ga_id"))]
+IMPORTED_GS_ID = Annotated[str, AfterValidator(partial(validate_id, prefix="GS-", field_name="gs_id"))]
diff --git a/gso/workflows/edge_port/create_imported_edge_port.py b/gso/workflows/edge_port/create_imported_edge_port.py
index 07d4abf3..cd5f7a7b 100644
--- a/gso/workflows/edge_port/create_imported_edge_port.py
+++ b/gso/workflows/edge_port/create_imported_edge_port.py
@@ -20,6 +20,7 @@ from gso.products.product_types.router import Router
 from gso.services.partners import get_partner_by_name
 from gso.services.subscriptions import get_product_id_by_name
 from gso.utils.helpers import active_pe_router_selector
+from gso.utils.types.geant_ids import IMPORTED_GA_ID
 from gso.utils.types.interfaces import LAGMember, PhysicalPortCapacity
 
 
@@ -48,7 +49,7 @@ def initial_input_form_generator() -> FormGenerator:
         minimum_links: int
         mac_address: str | None = None
         ignore_if_down: bool = False
-        ga_id: str | None = None
+        ga_id: IMPORTED_GA_ID | None = None
         description: str | None = None
         name: str
         ae_members: Annotated[list[LAGMember], AfterValidator(validate_unique_list)]
@@ -67,7 +68,7 @@ def initialize_subscription(
     encapsulation: EncapsulationType,
     name: str,
     minimum_links: int,
-    ga_id: str | None,
+    ga_id: IMPORTED_GA_ID | None,
     mac_address: str | None,
     partner: str,
     enable_lacp: bool,  # noqa: FBT001
diff --git a/gso/workflows/iptrunk/create_imported_iptrunk.py b/gso/workflows/iptrunk/create_imported_iptrunk.py
index db88b2b8..1feec505 100644
--- a/gso/workflows/iptrunk/create_imported_iptrunk.py
+++ b/gso/workflows/iptrunk/create_imported_iptrunk.py
@@ -20,6 +20,7 @@ from gso.products.product_types.router import Router
 from gso.services import subscriptions
 from gso.services.partners import get_partner_by_name
 from gso.utils.helpers import active_router_selector
+from gso.utils.types.geant_ids import IMPORTED_GA_ID, IMPORTED_GS_ID
 from gso.utils.types.interfaces import LAGMember, LAGMemberList, PhysicalPortCapacity
 
 
@@ -30,7 +31,7 @@ def initial_input_form_generator() -> FormGenerator:
         model_config = ConfigDict(title="Import Iptrunk")
 
         partner: str
-        gs_id: str | None = None
+        gs_id: IMPORTED_GS_ID | None = None
         iptrunk_description: str | None = None
         iptrunk_type: IptrunkType
         iptrunk_speed: PhysicalPortCapacity
@@ -39,12 +40,12 @@ def initial_input_form_generator() -> FormGenerator:
 
         side_a_node_id: active_router_selector()  # type: ignore[valid-type]
         side_a_ae_iface: str
-        side_a_ga_id: str | None = None
+        side_a_ga_id: IMPORTED_GA_ID | None = None
         side_a_ae_members: Annotated[list[LAGMember], AfterValidator(validate_unique_list)]
 
         side_b_node_id: active_router_selector()  # type: ignore[valid-type]
         side_b_ae_iface: str
-        side_b_ga_id: str | None = None
+        side_b_ga_id: IMPORTED_GA_ID | None = None
         side_b_ae_members: Annotated[list[LAGMember], AfterValidator(validate_unique_list)]
 
         iptrunk_ipv4_network: ipaddress.IPv4Network
@@ -71,7 +72,7 @@ def create_subscription(partner: str) -> State:
 @step("Initialize subscription")
 def initialize_subscription(
     subscription: ImportedIptrunkInactive,
-    gs_id: str | None,
+    gs_id: IMPORTED_GS_ID | None,
     iptrunk_type: IptrunkType,
     iptrunk_description: str,
     iptrunk_speed: PhysicalPortCapacity,
@@ -79,11 +80,11 @@ def initialize_subscription(
     iptrunk_isis_metric: int,
     side_a_node_id: str,
     side_a_ae_iface: str,
-    side_a_ga_id: str | None,
+    side_a_ga_id: IMPORTED_GA_ID | None,
     side_a_ae_members: LAGMemberList,
     side_b_node_id: str,
     side_b_ae_iface: str,
-    side_b_ga_id: str | None,
+    side_b_ga_id: IMPORTED_GA_ID | None,
     side_b_ae_members: LAGMemberList,
 ) -> State:
     """Take all input from the user, and store it in the database."""
diff --git a/test/cli/test_imports.py b/test/cli/test_imports.py
index 475492a4..571e64b6 100644
--- a/test/cli/test_imports.py
+++ b/test/cli/test_imports.py
@@ -62,7 +62,7 @@ def iptrunk_data(temp_file, router_subscription_factory, faker) -> (Path, dict):
         ipv6_network = ipv6_network or str(faker.ipv6_network(max_subnet=126))
 
         iptrunk_data = {
-            "id": faker.geant_sid(),
+            "id": faker.imported_gs_id(),
             "config": {
                 "common": {
                     "link_speed": PhysicalPortCapacity.HUNDRED_GIGABIT_PER_SECOND,
@@ -73,7 +73,7 @@ def iptrunk_data(temp_file, router_subscription_factory, faker) -> (Path, dict):
                 "nodeA": {
                     "name": side_a_node or Router.from_subscription(router_side_a).router.router_fqdn,
                     "ae_name": side_a_ae_name or faker.network_interface(),
-                    "port_ga_id": faker.geant_gid(),
+                    "port_ga_id": faker.imported_ga_id(),
                     "members": side_a_members
                     or [
                         {
@@ -88,7 +88,7 @@ def iptrunk_data(temp_file, router_subscription_factory, faker) -> (Path, dict):
                 "nodeB": {
                     "name": side_b_node or Router.from_subscription(router_side_b).router.router_fqdn,
                     "ae_name": side_b_ae_name or faker.network_interface(),
-                    "port_ga_id": faker.geant_gid(),
+                    "port_ga_id": faker.imported_ga_id(),
                     "members": side_b_members
                     or [
                         {
@@ -270,7 +270,7 @@ def edge_port_data(temp_file, faker, router_subscription_factory, partner_factor
             "encapsulation": EncapsulationType.DOT1Q,
             "name": "lag34",
             "minimum_links": 2,
-            "ga_id": faker.geant_gid(),
+            "ga_id": faker.imported_ga_id(),
             "mac_address": faker.mac_address(),
             "partner": partner_factory()["name"],
             "enable_lacp": True,
@@ -305,7 +305,7 @@ def l3_core_service_data(temp_file, faker, partner_factory, edge_port_subscripti
                 {
                     "edge_port": edge_port_subscription_factory(),
                     "ap_type": "PRIMARY",
-                    "gs_id": faker.geant_sid(),
+                    "gs_id": faker.imported_gs_id(),
                     "vlan_id": faker.vlan_id(),
                     "ipv4_address": faker.ipv4(),
                     "ipv4_mask": faker.ipv4_netmask(),
@@ -353,7 +353,7 @@ def l3_core_service_data(temp_file, faker, partner_factory, edge_port_subscripti
                 {
                     "edge_port": edge_port_subscription_factory(),
                     "ap_type": "BACKUP",
-                    "gs_id": faker.geant_sid(),
+                    "gs_id": faker.imported_gs_id(),
                     "vlan_id": faker.vlan_id(),
                     "ipv4_address": faker.ipv4(),
                     "ipv4_mask": faker.ipv4_netmask(),
@@ -414,7 +414,7 @@ def layer_2_circuit_data(temp_file, faker, partner_factory, edge_port_subscripti
         layer_2_circuit_input_data = {
             "partner": partner_factory()["name"],
             "service_type": Layer2CircuitServiceType.GEANT_PLUS,
-            "gs_id": faker.geant_sid(),
+            "gs_id": faker.imported_gs_id(),
             "vc_id": generate_unique_vc_id(),
             "layer_2_circuit_side_a": {
                 "edge_port": edge_port_subscription_factory(),
@@ -697,7 +697,7 @@ def test_import_l3_core_service_with_invalid_edge_port(
             {
                 "edge_port": fake_uuid,
                 "ap_type": "PRIMARY",
-                "gs_id": faker.geant_sid(),
+                "gs_id": faker.imported_gs_id(),
                 "vlan_id": faker.vlan_id(),
                 "ipv4_address": faker.ipv4(),
                 "ipv4_mask": faker.ipv4_netmask(),
@@ -737,7 +737,7 @@ def test_import_l3_core_service_with_invalid_edge_port(
             {
                 "edge_port": edge_port_subscription_factory(),
                 "ap_type": "BACKUP",
-                "gs_id": faker.geant_sid(),
+                "gs_id": faker.imported_gs_id(),
                 "vlan_id": faker.vlan_id(),
                 "ipv4_address": faker.ipv4(),
                 "ipv4_mask": faker.ipv4_netmask(),
diff --git a/test/conftest.py b/test/conftest.py
index da558c8a..4548fe0f 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -73,11 +73,21 @@ class FakerProvider(BaseProvider):
 
         return f"TT#{random_date}{random_int}"
 
-    def geant_gid(self) -> str:
-        return self.generator.numerify("GID-#####")
+    def ga_id(self) -> str:
+        random_int = self.generator.random_int(min=50000, max=99999)
+        return f"GA-{random_int}"
 
-    def geant_sid(self) -> str:
-        return self.generator.numerify("SID-#####")
+    def gs_id(self) -> str:
+        random_int = self.generator.random_int(min=50000, max=99999)
+        return f"GS-{random_int}"
+
+    def imported_ga_id(self) -> str:
+        random_int = self.generator.random_int(min=00000, max=50000)
+        return f"GA-{random_int}"
+
+    def imported_gs_id(self) -> str:
+        random_int = self.generator.random_int(min=00000, max=50000)
+        return f"GS-{random_int}"
 
     def site_name(self) -> str:
         site_name = "".join(self.generator.random_letter().upper() for _ in range(3))
diff --git a/test/fixtures/edge_port_fixtures.py b/test/fixtures/edge_port_fixtures.py
index 7ea6b8b9..0ea87449 100644
--- a/test/fixtures/edge_port_fixtures.py
+++ b/test/fixtures/edge_port_fixtures.py
@@ -52,7 +52,7 @@ def edge_port_subscription_factory(faker, partner_factory, router_subscription_f
             )
 
         edge_port_subscription.edge_port.edge_port_description = description or faker.text(max_nb_chars=30)
-        edge_port_subscription.edge_port.ga_id = ga_id or faker.geant_gid()
+        edge_port_subscription.edge_port.ga_id = ga_id or faker.ga_id()
         edge_port_subscription.edge_port.node = node or node
         edge_port_subscription.edge_port.edge_port_name = name or f"lag-{faker.pyint(21, 50)}"
         edge_port_subscription.edge_port.edge_port_description = edge_port_description or faker.sentence()
diff --git a/test/fixtures/iptrunk_fixtures.py b/test/fixtures/iptrunk_fixtures.py
index 17715ebe..742e974a 100644
--- a/test/fixtures/iptrunk_fixtures.py
+++ b/test/fixtures/iptrunk_fixtures.py
@@ -31,7 +31,7 @@ def iptrunk_side_subscription_factory(router_subscription_factory, faker):
                 iptrunk_side_node or router_subscription_factory(vendor=Vendor.NOKIA)
             ).router,
             iptrunk_side_ae_iface=iptrunk_side_ae_iface or faker.pystr(),
-            ga_id=ga_id or faker.geant_gid(),
+            ga_id=ga_id or faker.ga_id(),
             iptrunk_side_ae_members=iptrunk_side_ae_members
             or [
                 IptrunkInterfaceBlock.new(
@@ -84,7 +84,7 @@ def iptrunk_subscription_factory(iptrunk_side_subscription_factory, faker, geant
             )
 
         description = description or faker.sentence()
-        gs_id = gs_id or faker.geant_sid()
+        gs_id = gs_id or faker.gs_id()
         iptrunk_description = iptrunk_description or faker.sentence()
         iptrunk_isis_metric = iptrunk_isis_metric or faker.pyint()
         iptrunk_ipv4_network = iptrunk_ipv4_network or faker.ipv4_network(max_subnet=31)
diff --git a/test/fixtures/l3_core_service_fixtures.py b/test/fixtures/l3_core_service_fixtures.py
index 493ddc1c..21ea6379 100644
--- a/test/fixtures/l3_core_service_fixtures.py
+++ b/test/fixtures/l3_core_service_fixtures.py
@@ -108,7 +108,7 @@ def service_binding_port_factory(
             ipv6_address=ipv6_address or faker.ipv6(),
             ipv6_mask=ipv6_mask or faker.ipv6_netmask(),
             custom_firewall_filters=custom_firewall_filters,
-            gs_id=gs_id or faker.geant_sid(),
+            gs_id=gs_id or faker.gs_id(),
             bgp_session_list=bgp_session_list
             or [
                 bgp_session_subscription_factory(families=[IPFamily.V4UNICAST]),
diff --git a/test/fixtures/layer_2_circuit_fixtures.py b/test/fixtures/layer_2_circuit_fixtures.py
index e7c8c468..2b93a370 100644
--- a/test/fixtures/layer_2_circuit_fixtures.py
+++ b/test/fixtures/layer_2_circuit_fixtures.py
@@ -82,7 +82,7 @@ def layer_2_circuit_subscription_factory(faker, geant_partner, edge_port_subscri
                 edge_port=EdgePort.from_subscription(edge_port).edge_port,
                 sbp_type=SBPType.L2,
                 vlan_id=vlan_id,
-                gs_id=gs_id or faker.geant_sid(),
+                gs_id=gs_id or faker.gs_id(),
                 is_tagged=layer_2_circuit_type == Layer2CircuitType.TAGGED,
                 custom_firewall_filters=False,
             )
diff --git a/test/workflows/edge_port/test_create_imported_edge_port.py b/test/workflows/edge_port/test_create_imported_edge_port.py
index 838d330d..ea5b024e 100644
--- a/test/workflows/edge_port/test_create_imported_edge_port.py
+++ b/test/workflows/edge_port/test_create_imported_edge_port.py
@@ -17,7 +17,7 @@ def imported_edge_port_creation_input_form_data(router_subscription_factory, par
         "encapsulation": EncapsulationType.DOT1Q,
         "name": "lag34",
         "minimum_links": 2,
-        "ga_id": faker.geant_gid(),
+        "ga_id": faker.imported_ga_id(),
         "mac_address": faker.mac_address(),
         "partner": partner_factory()["name"],
         "enable_lacp": True,
diff --git a/test/workflows/edge_port/test_modify_edge_port.py b/test/workflows/edge_port/test_modify_edge_port.py
index 6e16f73a..25adcd85 100644
--- a/test/workflows/edge_port/test_modify_edge_port.py
+++ b/test/workflows/edge_port/test_modify_edge_port.py
@@ -21,7 +21,7 @@ def input_form_wizard_data(request, faker, edge_port_subscription_factory, partn
         {"subscription_id": subscription_id},
         {
             "tt_number": faker.tt_number(),
-            "ga_id": faker.geant_gid(),
+            "ga_id": faker.ga_id(),
             "member_speed": PhysicalPortCapacity.FOUR_HUNDRED_GIGABIT_PER_SECOND,
             "number_of_members": 1,
         },
@@ -100,7 +100,7 @@ def input_form_wizard_without_changing_capacity(request, faker, edge_port_subscr
 
     return [
         {"subscription_id": subscription_id},
-        {"tt_number": faker.tt_number(), "ga_id": faker.geant_gid()},
+        {"tt_number": faker.tt_number(), "ga_id": faker.ga_id()},
         {
             "description": faker.sentence(),
             "ae_members": [
diff --git a/test/workflows/iptrunk/test_create_imported_iptrunk.py b/test/workflows/iptrunk/test_create_imported_iptrunk.py
index 8b9c5d4d..deaa2ddd 100644
--- a/test/workflows/iptrunk/test_create_imported_iptrunk.py
+++ b/test/workflows/iptrunk/test_create_imported_iptrunk.py
@@ -16,7 +16,7 @@ from test.workflows import (
 def workflow_input_data(faker, router_subscription_factory):
     return {
         "partner": "GEANT",
-        "gs_id": faker.geant_sid(),
+        "gs_id": faker.imported_gs_id(),
         "iptrunk_description": faker.sentence(),
         "iptrunk_type": IptrunkType.DARK_FIBER,
         "iptrunk_speed": PhysicalPortCapacity.FOUR_HUNDRED_GIGABIT_PER_SECOND,
@@ -24,13 +24,13 @@ def workflow_input_data(faker, router_subscription_factory):
         "iptrunk_isis_metric": 10000,
         "side_a_node_id": router_subscription_factory(),
         "side_a_ae_iface": faker.network_interface(),
-        "side_a_ga_id": faker.geant_gid(),
+        "side_a_ga_id": faker.imported_ga_id(),
         "side_a_ae_members": [
             {"interface_name": faker.network_interface(), "interface_description": faker.sentence()} for _ in range(3)
         ],
         "side_b_node_id": router_subscription_factory(),
         "side_b_ae_iface": faker.network_interface(),
-        "side_b_ga_id": faker.geant_gid(),
+        "side_b_ga_id": faker.imported_ga_id(),
         "side_b_ae_members": [
             {"interface_name": faker.network_interface(), "interface_description": faker.sentence()} for _ in range(3)
         ],
diff --git a/test/workflows/iptrunk/test_modify_trunk_interface.py b/test/workflows/iptrunk/test_modify_trunk_interface.py
index 801ce865..12f49b90 100644
--- a/test/workflows/iptrunk/test_modify_trunk_interface.py
+++ b/test/workflows/iptrunk/test_modify_trunk_interface.py
@@ -52,15 +52,15 @@ def input_form_iptrunk_data(
 
     product_id = iptrunk_subscription_factory(iptrunk_sides=[side_a_node, side_b_node])
 
-    new_sid = faker.geant_sid()
+    new_sid = faker.gs_id()
     new_description = faker.sentence()
     new_type = IptrunkType.LEASED
     new_speed = PhysicalPortCapacity.FOUR_HUNDRED_GIGABIT_PER_SECOND
     new_link_count = 2
 
-    new_side_a_gid = faker.geant_gid()
+    new_side_a_gid = faker.ga_id()
 
-    new_side_b_gid = faker.geant_gid()
+    new_side_b_gid = faker.ga_id()
 
     return [
         {"subscription_id": product_id},
diff --git a/test/workflows/l2_circuit/test_create_imported_layer_2_circuit.py b/test/workflows/l2_circuit/test_create_imported_layer_2_circuit.py
index 2d4ed7a2..3d0e7870 100644
--- a/test/workflows/l2_circuit/test_create_imported_layer_2_circuit.py
+++ b/test/workflows/l2_circuit/test_create_imported_layer_2_circuit.py
@@ -28,7 +28,7 @@ def test_create_imported_layer_2_circuit_success(
             "vc_id": generate_unique_vc_id(),
             "policer_bandwidth": faker.bandwidth() if policer_enabled else None,
             "policer_burst_rate": faker.bandwidth() if policer_enabled else None,
-            "gs_id": faker.geant_sid(),
+            "gs_id": faker.imported_gs_id(),
             "layer_2_circuit_side_a": {"edge_port": edge_port_a, "vlan_id": faker.vlan_id()},
             "layer_2_circuit_side_b": {"edge_port": edge_port_b, "vlan_id": faker.vlan_id()},
         }
diff --git a/test/workflows/l3_core_service/test_create_imported_l3_core_service.py b/test/workflows/l3_core_service/test_create_imported_l3_core_service.py
index 0580bb5c..48ac4b54 100644
--- a/test/workflows/l3_core_service/test_create_imported_l3_core_service.py
+++ b/test/workflows/l3_core_service/test_create_imported_l3_core_service.py
@@ -27,7 +27,7 @@ def test_create_imported_l3_core_service_success(
             {
                 "edge_port": edge_port_subscription_factory(),
                 "ap_type": "PRIMARY",
-                "gs_id": faker.geant_sid(),
+                "gs_id": faker.imported_gs_id(),
                 "sbp_type": SBPType.L3,
                 "is_tagged": faker.boolean(),
                 "vlan_id": faker.vlan_id(),
diff --git a/test/workflows/l3_core_service/test_modify_l3_core_service.py b/test/workflows/l3_core_service/test_modify_l3_core_service.py
index 333fc670..dc7f3a51 100644
--- a/test/workflows/l3_core_service/test_modify_l3_core_service.py
+++ b/test/workflows/l3_core_service/test_modify_l3_core_service.py
@@ -84,7 +84,7 @@ def test_modify_l3_core_service_add_new_edge_port_success(
         {},  # The existing SBPs are unchanged
         {},
         {  # Adding configuration for the new SBP
-            "gs_id": faker.geant_sid(),
+            "gs_id": faker.gs_id(),
             "vlan_id": faker.vlan_id(),
             "ipv4_address": faker.ipv4(),
             "ipv6_address": faker.ipv6(),
@@ -115,7 +115,7 @@ def test_modify_l3_core_service_add_new_edge_port_success(
 def sbp_input_form_data(faker):
     def _generate_form_data():
         return {
-            "gs_id": faker.geant_sid(),
+            "gs_id": faker.gs_id(),
             "is_tagged": True,
             "vlan_id": faker.vlan_id(),
             "ipv4_address": faker.ipv4(),
-- 
GitLab