diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index 2580c3e785450f7be1972679872c3d16db39c714..f17004d2440cf16431ae8599b4bbef8caa43511d 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -31,6 +31,8 @@ class _Driver: def __init__(self, name : str, address: str, port: int, **settings) -> None: """ Initialize Driver. Parameters: + name : str + Device driver name address : str The address of the device port : int diff --git a/src/tests/p4-fwd-l1/tests/Objects.py b/src/tests/p4-fwd-l1/tests/Objects.py index ba260e936805e57fb8f07761b1e5fc79cffbaf8f..83d1e23b438693f3dbe6b657d0332a4f0a9d1680 100644 --- a/src/tests/p4-fwd-l1/tests/Objects.py +++ b/src/tests/p4-fwd-l1/tests/Objects.py @@ -13,18 +13,12 @@ # limitations under the License. import os -from typing import Dict, List, Tuple from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Device import ( - json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, - json_device_connect_rules, json_device_id, json_device_p4_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) -from common.tools.object_factory.Service import ( - get_service_uuid, json_service_l3nm_planned,json_service_p4_planned) -from common.tools.object_factory.ConfigRule import ( - json_config_rule_set, json_config_rule_delete) -from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_ids, json_endpoints, json_endpoint_id + json_device_connect_rules, json_device_id, json_device_p4_disabled) +from common.tools.object_factory.Service import get_service_uuid, json_service_p4_planned +from common.tools.object_factory.EndPoint import json_endpoint_ids, json_endpoints from common.tools.object_factory.EndPoint import json_endpoint_descriptor from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id from common.tools.object_factory.Topology import json_topology, json_topology_id diff --git a/src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py b/src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py index fe622c908b44ed28a5c91ca8b35b8524511de388..341799c0224794bd32e0a81a02c593bd1173eca1 100644 --- a/src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py +++ b/src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py @@ -14,14 +14,9 @@ import copy, logging, pytest from common.Settings import get_setting -from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events from common.tools.object_factory.Context import json_context_id -from common.tools.object_factory.Device import json_device_id -from common.tools.object_factory.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from common.proto.context_pb2 import ConfigActionEnum, Context, ContextId, Device, Empty, Link, Topology, DeviceOperationalStatusEnum +from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, DeviceOperationalStatusEnum from device.client.DeviceClient import DeviceClient from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES diff --git a/src/tests/p4-fwd-l1/tests/test_functional_cleanup.py b/src/tests/p4-fwd-l1/tests/test_functional_cleanup.py index 67934ff8a78f79252ef4b6994c3b628a8275c503..0b44f794d7201f49034c536c8988798ac9b44bc7 100644 --- a/src/tests/p4-fwd-l1/tests/test_functional_cleanup.py +++ b/src/tests/p4-fwd-l1/tests/test_functional_cleanup.py @@ -12,18 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, logging, pytest +import logging, pytest from common.Settings import get_setting -from common.tests.EventTools import EVENT_REMOVE, check_events from common.tools.object_factory.Context import json_context_id -from common.tools.object_factory.Device import json_device_id -from common.tools.object_factory.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, Link, LinkId, TopologyId, DeviceOperationalStatusEnum +from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId from device.client.DeviceClient import DeviceClient -from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +from .Objects import CONTEXTS, DEVICES, LINKS, TOPOLOGIES LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) diff --git a/src/tests/p4-fwd-l1/tests/test_functional_create_service.py b/src/tests/p4-fwd-l1/tests/test_functional_create_service.py index 9f82da129e159f02d40ee57b890409b0a5685b75..ee714c4774e417a9afb84554d4dc99fe57d96863 100644 --- a/src/tests/p4-fwd-l1/tests/test_functional_create_service.py +++ b/src/tests/p4-fwd-l1/tests/test_functional_create_service.py @@ -14,24 +14,16 @@ import copy, logging, pytest from common.Settings import get_setting -from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events -from common.tools.object_factory.Context import json_context_id -from common.tools.object_factory.Device import json_device_id -from common.tools.object_factory.Service import json_service_id -from common.tools.object_factory.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, Service, ServiceId +from common.proto.context_pb2 import Service from device.client.DeviceClient import DeviceClient from service.client.ServiceClient import ServiceClient -from tests.p4.tests.Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, SERVICES -from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId,\ - DeviceOperationalStatusEnum +from tests.p4.tests.Objects import SERVICES LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) + @pytest.fixture(scope='session') def context_client(): _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) diff --git a/src/tests/p4-fwd-l1/tests/test_functional_delete_service.py b/src/tests/p4-fwd-l1/tests/test_functional_delete_service.py index 98b6a01c1be2a00003b3be267839a4513967d4f7..439a88efd3f72dbd1389d9d47494fa891ff2b2d2 100644 --- a/src/tests/p4-fwd-l1/tests/test_functional_delete_service.py +++ b/src/tests/p4-fwd-l1/tests/test_functional_delete_service.py @@ -14,18 +14,12 @@ import copy, logging, pytest from common.Settings import get_setting -from common.tests.EventTools import EVENT_REMOVE, check_events -from common.tools.object_factory.Context import json_context_id -from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.Service import json_service_id -from common.tools.object_factory.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, LinkId, TopologyId, Service, ServiceId, DeviceOperationalStatusEnum +from common.proto.context_pb2 import ServiceId from device.client.DeviceClient import DeviceClient from service.client.ServiceClient import ServiceClient -from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, SERVICES +from .Objects import CONTEXT_ID, SERVICES LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG)