Commit 828e4e36 authored by Cesar Cajas's avatar Cesar Cajas
Browse files

feature/add-e2e-tests-gsma-edgecloud: add gsma compliance test, verify all gsma tests

parent 4e11f16e
Loading
Loading
Loading
Loading
+62 −0
Original line number Diff line number Diff line
@@ -146,6 +146,8 @@ class Artefact(BaseModel):
# ApplicationOnboardingManagement
# ---------------------------

# Responses


class AppDeploymentZone(BaseModel):
    countryCode: str
@@ -202,10 +204,26 @@ class ApplicationModel(BaseModel):
    onboardStatusInfo: Literal["PENDING", "ONBOARDED", "DEBOARDING", "REMOVED", "FAILED"]


# Entry


class AppOnboardManifestGSMA(BaseModel):
    appId: str
    appProviderId: str
    appDeploymentZones: List[str]
    appMetaData: AppMetaData
    appQoSProfile: AppQoSProfile
    appComponentSpecs: List[AppComponentSpec]
    appStatusCallbackLink: str
    edgeAppFQDN: str


# ---------------------------
# ApplicationDeploymentManagement
# ---------------------------

# Responses


class AppInstance(BaseModel):
    zoneId: str
@@ -224,3 +242,47 @@ class ZoneIdentifier(BaseModel):

class ZoneIdentifierList(RootModel[List[ZoneIdentifier]]):
    pass


# Entry


class ZoneInfo(BaseModel):
    zoneId: str
    flavourId: str
    resourceConsumption: str
    resPool: str


class AppDeployPayloadGSMA(BaseModel):
    appId: str
    appVersion: str
    appProviderId: str
    zoneInfo: ZoneInfo
    appInstCallbackLink: str


# ---------------------------
# ApplicationUpdateManagement
# ---------------------------


class AppUpdQoSProfile(BaseModel):
    latencyConstraints: str
    bandwidthRequired: int
    mobilitySupport: bool
    multiUserClients: str
    noOfUsersPerAppInst: int
    appProvisioning: bool


class PatchAppComponentSpec(BaseModel):
    serviceNameNB: str
    serviceNameEW: str
    componentName: str
    artefactId: str


class PatchOnboardedAppGSMA(BaseModel):
    appUpdQoSProfile: AppUpdQoSProfile
    appComponentSpecs: List[PatchAppComponentSpec]
+7 −1
Original line number Diff line number Diff line
CONFIG = {
    "i2edge": {
        "ZONE_ID": "f0662bfe-1d90-5f59-a759-c755b3b69b93",
        "ARTEFACT_ID": "9c9143f0-f44f-49df-939e-1e8b891ba8f5",
        "ARTEFACT_NAME": "i2edgechart",
        "REPO_NAME": "github-cesar",
        "REPO_TYPE": "PUBLICREPO",
        "REPO_URL": "https://cesarcajas.github.io/helm-charts-examples/",
        "APP_ONBOARD_MANIFEST_GSMA": {
            "appId": "demo-app-id",
            "appProviderId": "Y89TSlxMPDKlXZz7rN6vU2y",
@@ -38,7 +44,7 @@ CONFIG = {
            "appProviderId": "Y89TSlxMPDKlXZz7rN6vU2y",
            "zoneInfo": {
                "zoneId": "f0662bfe-1d90-5f59-a759-c755b3b69b93",
                "flavourId": "67f3a0b0e3184a85952e174d",
                "flavourId": "6881e358535a2eaedcb27214",
                "resourceConsumption": "RESERVED_RES_AVOID",
                "resPool": "ySIT0LuZ6ApHs0wlyGZve",
            },
+23 −3
Original line number Diff line number Diff line
@@ -52,9 +52,29 @@ def id_func(val):
    return val["edgecloud"]["client_name"]


# TODO
# @pytest.mark.parametrize("edgecloud_client", test_cases, ids=id_func, indirect=True)
# def test_config_gsma_compliance(edgecloud_client):
@pytest.mark.parametrize("edgecloud_client", test_cases, ids=id_func, indirect=True)
def test_config_gsma_compliance(edgecloud_client):
    """Validate that all test configurations are GSMA-compliant"""
    config = CONFIG[edgecloud_client.client_name]

    try:
        # Validate APP_ONBOARD_MANIFEST_GSMA is GSMA-compliant
        if "APP_ONBOARD_MANIFEST_GSMA" in config:
            app_manifest = config["APP_ONBOARD_MANIFEST_GSMA"]
            gsma_schemas.AppOnboardManifestGSMA(**app_manifest)

        # Validate APP_DEPLOY_PAYLOAD_GSMA is GSMA-compliant
        if "APP_DEPLOY_PAYLOAD_GSMA" in config:
            deploy_payload = config["APP_DEPLOY_PAYLOAD_GSMA"]
            gsma_schemas.AppDeployPayloadGSMA(**deploy_payload)

        # Validate PATCH_ONBOARDED_APP_GSMA is GSMA-compliant
        if "PATCH_ONBOARDED_APP_GSMA" in config:
            patch_payload = config["PATCH_ONBOARDED_APP_GSMA"]
            gsma_schemas.PatchOnboardedAppGSMA(**patch_payload)

    except Exception as e:
        pytest.fail(f"Configuration is not GSMA-compliant for {edgecloud_client.client_name}: {e}")


@pytest.mark.parametrize("edgecloud_client", test_cases, ids=id_func, indirect=True)