forked from TrueCloudLab/frostfs-testcases
[#153] Register services automatically
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
ee71c17700
commit
fbefa422e8
1 changed files with 11 additions and 2 deletions
|
@ -2,15 +2,16 @@ import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
from importlib.metadata import entry_points
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
import yaml
|
import yaml
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
from frostfs_testlib import plugins
|
||||||
from frostfs_testlib.healthcheck.interfaces import Healthcheck
|
from frostfs_testlib.healthcheck.interfaces import Healthcheck
|
||||||
from frostfs_testlib.hosting import Hosting
|
from frostfs_testlib.hosting import Hosting
|
||||||
from frostfs_testlib.plugins import load_plugin
|
|
||||||
from frostfs_testlib.reporter import AllureHandler, get_reporter
|
from frostfs_testlib.reporter import AllureHandler, get_reporter
|
||||||
from frostfs_testlib.resources.common import (
|
from frostfs_testlib.resources.common import (
|
||||||
ASSETS_DIR,
|
ASSETS_DIR,
|
||||||
|
@ -24,6 +25,7 @@ from frostfs_testlib.shell import LocalShell, Shell
|
||||||
from frostfs_testlib.steps.cli.container import list_containers
|
from frostfs_testlib.steps.cli.container import list_containers
|
||||||
from frostfs_testlib.steps.cli.object import get_netmap_netinfo
|
from frostfs_testlib.steps.cli.object import get_netmap_netinfo
|
||||||
from frostfs_testlib.steps.s3 import s3_helper
|
from frostfs_testlib.steps.s3 import s3_helper
|
||||||
|
from frostfs_testlib.storage import get_service_registry
|
||||||
from frostfs_testlib.storage.cluster import Cluster, ClusterNode
|
from frostfs_testlib.storage.cluster import Cluster, ClusterNode
|
||||||
from frostfs_testlib.storage.controllers.cluster_state_controller import ClusterStateController
|
from frostfs_testlib.storage.controllers.cluster_state_controller import ClusterStateController
|
||||||
from frostfs_testlib.storage.dataclasses.frostfs_services import StorageNode
|
from frostfs_testlib.storage.dataclasses.frostfs_services import StorageNode
|
||||||
|
@ -76,6 +78,13 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
|
||||||
def configure_testlib():
|
def configure_testlib():
|
||||||
get_reporter().register_handler(AllureHandler())
|
get_reporter().register_handler(AllureHandler())
|
||||||
logging.getLogger("paramiko").setLevel(logging.INFO)
|
logging.getLogger("paramiko").setLevel(logging.INFO)
|
||||||
|
|
||||||
|
# Register Services for cluster
|
||||||
|
registry = get_service_registry()
|
||||||
|
services = entry_points(group="frostfs.testlib.services")
|
||||||
|
for svc in services:
|
||||||
|
registry.register_service(svc.name, svc.load())
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,7 +197,7 @@ def s3_policy(request: pytest.FixtureRequest):
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
@allure.title("[Session] Create healthcheck object")
|
@allure.title("[Session] Create healthcheck object")
|
||||||
def healthcheck(cluster: Cluster) -> Healthcheck:
|
def healthcheck(cluster: Cluster) -> Healthcheck:
|
||||||
healthcheck_cls = load_plugin(
|
healthcheck_cls = plugins.load_plugin(
|
||||||
"frostfs.testlib.healthcheck", cluster.cluster_nodes[0].host.config.healthcheck_plugin_name
|
"frostfs.testlib.healthcheck", cluster.cluster_nodes[0].host.config.healthcheck_plugin_name
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue