From 8ba2cb80308cd588ca2fb360bfbcb7a231be7573 Mon Sep 17 00:00:00 2001 From: mkadilov Date: Wed, 31 Jan 2024 15:43:24 +0300 Subject: [PATCH] [#171] Components versions check Components versions check Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com --- pyproject.toml | 10 +++++----- src/frostfs_testlib/storage/cluster.py | 8 ++++---- src/frostfs_testlib/storage/constants.py | 8 -------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7d3e5b0..74a163e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,11 +51,11 @@ basic = "frostfs_testlib.healthcheck.basic_healthcheck:BasicHealthcheck" config = "frostfs_testlib.storage.controllers.state_managers.config_state_manager:ConfigStateManager" [project.entry-points."frostfs.testlib.services"] -s = "frostfs_testlib.storage.dataclasses.frostfs_services:StorageNode" -s3-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:S3Gate" -http-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:HTTPGate" -morph-chain = "frostfs_testlib.storage.dataclasses.frostfs_services:MorphChain" -ir = "frostfs_testlib.storage.dataclasses.frostfs_services:InnerRing" +frostfs-storage = "frostfs_testlib.storage.dataclasses.frostfs_services:StorageNode" +frostfs-s3 = "frostfs_testlib.storage.dataclasses.frostfs_services:S3Gate" +frostfs-http = "frostfs_testlib.storage.dataclasses.frostfs_services:HTTPGate" +neo-go = "frostfs_testlib.storage.dataclasses.frostfs_services:MorphChain" +frostfs-ir = "frostfs_testlib.storage.dataclasses.frostfs_services:InnerRing" [tool.isort] profile = "black" diff --git a/src/frostfs_testlib/storage/cluster.py b/src/frostfs_testlib/storage/cluster.py index 313215a..c867515 100644 --- a/src/frostfs_testlib/storage/cluster.py +++ b/src/frostfs_testlib/storage/cluster.py @@ -105,7 +105,7 @@ class ClusterNode: service_entry = self.class_registry.get_entry(service_type) service_name = service_entry["hosting_service_name"] - pattern = f"{service_name}{self.id:02}" + pattern = f"{service_name}_{self.id:02}" config = self.host.get_service_config(pattern) return service_type( @@ -120,7 +120,7 @@ class ClusterNode: svcs_names_on_node = [svc.name for svc in self.host.config.services] for entry in self.class_registry._class_mapping.values(): hosting_svc_name = entry["hosting_service_name"] - pattern = f"{hosting_svc_name}{self.id:02}" + pattern = f"{hosting_svc_name}_{self.id:02}" if pattern in svcs_names_on_node: config = self.host.get_service_config(pattern) svcs.append( @@ -267,13 +267,13 @@ class Cluster: service_name = service["hosting_service_name"] cls: type[NodeBase] = service["cls"] - pattern = f"{service_name}\d*$" + pattern = f"{service_name}_\d*$" configs = self.hosting.find_service_configs(pattern) found_nodes = [] for config in configs: # config.name is something like s3-gate01. Cut last digits to know service type - service_type = re.findall(".*\D", config.name)[0] + service_type = re.findall("(.*)_\d+", config.name)[0] # exclude unsupported services if service_type != service_name: continue diff --git a/src/frostfs_testlib/storage/constants.py b/src/frostfs_testlib/storage/constants.py index 5b9d694..3d75988 100644 --- a/src/frostfs_testlib/storage/constants.py +++ b/src/frostfs_testlib/storage/constants.py @@ -18,11 +18,3 @@ class ConfigAttributes: UN_LOCODE = "un_locode" HTTP_HOSTNAME = "http_hostname" S3_HOSTNAME = "s3_hostname" - - -class _FrostfsServicesNames: - STORAGE = "s" - S3_GATE = "s3-gate" - HTTP_GATE = "http-gate" - MORPH_CHAIN = "morph-chain" - INNER_RING = "ir"