Commit b1c94af2 authored by Adrian Pino's avatar Adrian Pino
Browse files

Update tests to satisfy new invocation method

parent bc7dd13a
Loading
Loading
Loading
Loading
+0 −0

Empty file added.

+43 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
import pytest

from src.common.sdk_catalog_client import SdkCatalogClient

EDGE_CLOUD_TEST_CASES = [
    {"edgecloud": {"client_name": "i2edge", "base_url": "http://test-i2edge.url"}},
    {
        "edgecloud": {
            "client_name": "aeros",
            "base_url": "http://test-aeros.url",
            "aerOS_API_URL": "http://fake.api.url",
            "aerOS_ACCESS_TOKEN": "fake-access",
            "aerOS_HLO_TOKEN": "fake-hlo",
        }
    },
    # Uncomment once piedge import issues are fixed
    # {
    #     "edgecloud": {
    #         "client_name": "piedge",
    #         "base_url": "http://test-piedge.url"
    #     }
    # }
]


@pytest.mark.parametrize(
    "client_specs",
    EDGE_CLOUD_TEST_CASES,
    ids=[
        "i2edge",
        "aeros",
        # "piedge"
    ],
)
def test_edgecloud_platform_instantiation(client_specs):
    """Test instantiation of all edgecloud platform clients"""
    clients = SdkCatalogClient.create_clients_from(client_specs)

    assert "edgecloud" in clients
    edge_client = clients["edgecloud"]
    assert edge_client is not None
    assert "EdgeApplicationManager" in str(type(edge_client))
+41 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
import pytest

from src.common.sdk_catalog_client import SdkCatalogClient

NETWORK_TEST_CASES = [
    {
        "network": {
            "client_name": "open5gs",
            "base_url": "http://test-open5gs.url",
            "scs_as_id": "scs1",
        }
    },
    {
        "network": {
            "client_name": "oai",
            "base_url": "http://test-oai.url",
            "scs_as_id": "scs2",
        }
    },
    {
        "network": {
            "client_name": "open5gcore",
            "base_url": "http://test-open5gcore.url",
            "scs_as_id": "scs3",
        }
    },
]


@pytest.mark.parametrize(
    "client_specs", NETWORK_TEST_CASES, ids=["open5gs", "oai", "open5gcore"]
)
def test_network_platform_instantiation(client_specs):
    """Test instantiation of all network platform clients"""
    clients = SdkCatalogClient.create_clients_from(client_specs)

    assert "network" in clients
    network_client = clients["network"]
    assert network_client is not None
    assert "NetworkManager" in str(type(network_client))
+23 −3
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
test_cases = [
    ("i2edge", "http://192.168.123.237:30769/"),
    # ("aeros", "https://ncsrd-mvp-domain.aeros-project.eu"),
    # ("piedge", "http://piedge.example.com/"),
    {
        "edgecloud": {
            "client_name": "i2edge",
            # "base_url": "http://192.168.123.89:30769/",
            "base_url": "http://192.168.123.89:30769/",
            # "base_url": "http://192.168.123.237:30760/",
        }
    },
    # {
    #     "edgecloud": {
    #         "client_name": "aeros",
    #         "base_url": "http://test-aeros.url",
    #         "aerOS_API_URL": "http://fake.api.url",
    #         "aerOS_ACCESS_TOKEN": "fake-access",
    #         "aerOS_HLO_TOKEN": "fake-hlo"
    #     }
    # },
    # {
    #     "edgecloud": {
    #         "client_name": "piedge",
    #         "base_url": "http://test-piedge.url"
    #     }
    # }
]
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ the EdgeCloud Platform integration across different clients.
# i2Edge variables
######################
# EdgeCloud Zone
ZONE_ID = "Omega"
ZONE_ID = "Omega12345"

# Artefact
ARTEFACT_ID = "i2edgechart-id-2"
Loading