forked from TrueCloudLab/frostfs-testlib
[#104] Add mask/unmask for services
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
f4111a1374
commit
8a360683ae
5 changed files with 45 additions and 69 deletions
|
@ -135,9 +135,9 @@ class ClusterStateController:
|
|||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
@reporter.step_deco("Stop storage service on {node}")
|
||||
def stop_storage_service(self, node: ClusterNode):
|
||||
def stop_storage_service(self, node: ClusterNode, mask: bool = True):
|
||||
self.stopped_storage_nodes.append(node)
|
||||
node.storage_node.stop_service()
|
||||
node.storage_node.stop_service(mask)
|
||||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
@reporter.step_deco("Stop all {service_type} services")
|
||||
|
@ -171,9 +171,11 @@ class ClusterStateController:
|
|||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
@reporter.step_deco("Stop {service_type} service on {node}")
|
||||
def stop_service_of_type(self, node: ClusterNode, service_type: type[ServiceClass]):
|
||||
def stop_service_of_type(
|
||||
self, node: ClusterNode, service_type: type[ServiceClass], mask: bool = True
|
||||
):
|
||||
service = node.service(service_type)
|
||||
service.stop_service()
|
||||
service.stop_service(mask)
|
||||
self.stopped_services.add(service)
|
||||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
|
@ -207,8 +209,8 @@ class ClusterStateController:
|
|||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
@reporter.step_deco("Stop s3 gate on {node}")
|
||||
def stop_s3_gate(self, node: ClusterNode):
|
||||
node.s3_gate.stop_service()
|
||||
def stop_s3_gate(self, node: ClusterNode, mask: bool = True):
|
||||
node.s3_gate.stop_service(mask)
|
||||
self.stopped_s3_gates.append(node)
|
||||
|
||||
@run_optionally(optionals.OPTIONAL_FAILOVER_ENABLED)
|
||||
|
|
|
@ -57,6 +57,9 @@ class NodeBase(HumanReadableABC):
|
|||
return self._process_name
|
||||
|
||||
def start_service(self):
|
||||
with reporter.step(f"Unmask {self.name} service on {self.host.config.address}"):
|
||||
self.host.unmask_service(self.name)
|
||||
|
||||
with reporter.step(f"Start {self.name} service on {self.host.config.address}"):
|
||||
self.host.start_service(self.name)
|
||||
|
||||
|
@ -67,7 +70,11 @@ class NodeBase(HumanReadableABC):
|
|||
def get_metrics_endpoint(self) -> str:
|
||||
return self._get_attribute(ConfigAttributes.ENDPOINT_PROMETHEUS)
|
||||
|
||||
def stop_service(self):
|
||||
def stop_service(self, mask: bool = True):
|
||||
if mask:
|
||||
with reporter.step(f"Mask {self.name} service on {self.host.config.address}"):
|
||||
self.host.mask_service(self.name)
|
||||
|
||||
with reporter.step(f"Stop {self.name} service on {self.host.config.address}"):
|
||||
self.host.stop_service(self.name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue