support stop service by type

Signed-off-by: m.malygina <m.malygina@yadro.com>
stop-cm-before-wipe
m.malygina 2023-08-30 10:27:10 +03:00
parent aa277fdd6a
commit a3530e09ca
1 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ from frostfs_testlib.utils.failover_utils import (
wait_for_host_online,
wait_for_node_online,
)
from frostfs_testlib.storage.dataclasses.node_base import NodeBase
reporter = get_reporter()
@ -170,6 +171,18 @@ class ClusterStateController:
parallel(self.start_s3_gate, copy.copy(self.stopped_s3_gates))
self.stopped_s3_gates = []
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
@reporter.step_deco("Stop {service_type} services on {cluster_node} node")
def stop_services_of_type(self, cluster_node: ClusterNode, service_type: NodeBase):
service = cluster_node.service(service_type)
service.stop_service()
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
@reporter.step_deco("Start {service_type} services on {cluster_node} node")
def start_services_of_type(self, cluster_node: ClusterNode, service_type: NodeBase):
service = cluster_node.service(service_type)
service.start_service()
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
@reporter.step_deco("Suspend {process_name} service in {node}")
def suspend_service(self, process_name: str, node: ClusterNode):