Add interfaces for deleting fstree, blobovnocza and pilorama.db #16

Merged
ylukoyan merged 1 commit from ylukoyan/frostfs-testlib:fstree into master 2023-05-19 11:44:35 +00:00
3 changed files with 48 additions and 0 deletions
Showing only changes of commit 0ca53de74a - Show all commits

View file

@ -129,6 +129,15 @@ class DockerHost(Host):
timeout=service_attributes.start_timeout, timeout=service_attributes.start_timeout,
) )
def delete_fstree(self, service_name: str) -> None:
raise NotImplementedError("Not implemented for docker")
def delete_blobovnicza(self, service_name: str) -> None:
raise NotImplementedError("Not implemented for docker")
def delete_pilorama(self, service_name: str) -> None:
raise NotImplementedError("Not implemented for docker")
def delete_storage_node_data(self, service_name: str, cache_only: bool = False) -> None: def delete_storage_node_data(self, service_name: str, cache_only: bool = False) -> None:
service_attributes = self._get_service_attributes(service_name) service_attributes = self._get_service_attributes(service_name)

View file

@ -121,6 +121,36 @@ class Host(ABC):
cache_only: To delete cache only. cache_only: To delete cache only.
""" """
@abstractmethod
def delete_fstree(self, service_name: str) -> None:
"""
Deletes all fstrees in the node.
Args:
service_name: Name of storage node service.
"""
@abstractmethod
def delete_blobovnicza(self, service_name: str) -> None:
"""
Deletes all blobovniczas in the node.
Args:
service_name: Name of storage node service.
"""
@abstractmethod
def delete_pilorama(self, service_name: str) -> None:
"""
Deletes all pilorama.db files in the node.
Args:
service_name: Name of storage node service.
"""
@abstractmethod @abstractmethod
def detach_disk(self, device: str) -> DiskInfo: def detach_disk(self, device: str) -> DiskInfo:
"""Detaches disk device to simulate disk offline/failover scenario. """Detaches disk device to simulate disk offline/failover scenario.

View file

@ -168,6 +168,15 @@ class StorageNode(NodeBase):
def get_un_locode(self): def get_un_locode(self):
return self._get_attribute(ConfigAttributes.UN_LOCODE) return self._get_attribute(ConfigAttributes.UN_LOCODE)
def delete_blobovnicza(self):
self.host.delete_blobovnicza(self.name)
def delete_fstree(self):
self.host.delete_fstree(self.name)
def delete_pilorama(self):
self.host.delete_pilorama(self.name)
@property @property
def label(self) -> str: def label(self) -> str:
return f"{self.name}: {self.get_rpc_endpoint()}" return f"{self.name}: {self.get_rpc_endpoint()}"