Compare commits

...

1 commit

Author SHA1 Message Date
a3530e09ca support stop service by type
Signed-off-by: m.malygina <m.malygina@yadro.com>
2023-08-30 10:27:10 +03:00

View file

@ -17,6 +17,7 @@ from frostfs_testlib.utils.failover_utils import (
wait_for_host_online, wait_for_host_online,
wait_for_node_online, wait_for_node_online,
) )
from frostfs_testlib.storage.dataclasses.node_base import NodeBase
reporter = get_reporter() reporter = get_reporter()
@ -170,6 +171,18 @@ class ClusterStateController:
parallel(self.start_s3_gate, copy.copy(self.stopped_s3_gates)) parallel(self.start_s3_gate, copy.copy(self.stopped_s3_gates))
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) @run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
@reporter.step_deco("Suspend {process_name} service in {node}") @reporter.step_deco("Suspend {process_name} service in {node}")
def suspend_service(self, process_name: str, node: ClusterNode): def suspend_service(self, process_name: str, node: ClusterNode):