forked from TrueCloudLab/frostfs-testlib
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
|
from typing import Optional
|
||
|
|
||
|
from frostfs_testlib.reporter import get_reporter
|
||
|
from frostfs_testlib.shell import Shell
|
||
|
from frostfs_testlib.steps import epoch
|
||
|
from frostfs_testlib.storage.cluster import Cluster
|
||
|
from frostfs_testlib.storage.dataclasses.frostfs_services import StorageNode
|
||
|
|
||
|
reporter = get_reporter()
|
||
|
|
||
|
|
||
|
# To skip adding every mandatory singleton dependency to EACH test function
|
||
|
class ClusterTestBase:
|
||
|
shell: Shell
|
||
|
cluster: Cluster
|
||
|
|
||
|
@reporter.step_deco("Tick {epochs_to_tick} epochs")
|
||
|
def tick_epochs(self, epochs_to_tick: int, alive_node: Optional[StorageNode] = None):
|
||
|
for _ in range(epochs_to_tick):
|
||
|
self.tick_epoch(alive_node)
|
||
|
|
||
|
def tick_epoch(self, alive_node: Optional[StorageNode] = None):
|
||
|
epoch.tick_epoch(self.shell, self.cluster, alive_node=alive_node)
|
||
|
|
||
|
def wait_for_epochs_align(self):
|
||
|
epoch.wait_for_epochs_align(self.shell, self.cluster)
|
||
|
|
||
|
def get_epoch(self):
|
||
|
return epoch.get_epoch(self.shell, self.cluster)
|
||
|
|
||
|
def ensure_fresh_epoch(self):
|
||
|
return epoch.ensure_fresh_epoch(self.shell, self.cluster)
|