From d79fd87ede254bfd483a25934dfd1c54c6c61201 Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Mon, 5 Feb 2024 12:41:29 +0300 Subject: [PATCH] [#174] Add flag to remove registry file Signed-off-by: Andrey Berezin --- src/frostfs_testlib/load/load_config.py | 2 ++ src/frostfs_testlib/load/runners.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/frostfs_testlib/load/load_config.py b/src/frostfs_testlib/load/load_config.py index f072a4e..1932e69 100644 --- a/src/frostfs_testlib/load/load_config.py +++ b/src/frostfs_testlib/load/load_config.py @@ -235,6 +235,8 @@ class LoadParams: registry_file: Optional[str] = metadata_field(all_scenarios, None, "REGISTRY_FILE", False) # In case if we want to use custom registry file left from another load run custom_registry: Optional[str] = None + # In case if we want to use custom registry file left from another load run + force_fresh_registry: Optional[bool] = None # Specifies the minimum duration of every single execution (i.e. iteration). # Any iterations that are shorter than this value will cause that VU to # sleep for the remainder of the time until the specified minimum duration is reached. diff --git a/src/frostfs_testlib/load/runners.py b/src/frostfs_testlib/load/runners.py index 532c590..d456270 100644 --- a/src/frostfs_testlib/load/runners.py +++ b/src/frostfs_testlib/load/runners.py @@ -78,6 +78,10 @@ class DefaultRunner(RunnerBase): nodes_under_load: list[ClusterNode], k6_dir: str, ): + if load_params.force_fresh_registry and load_params.custom_registry: + with reporter.step("Forcing fresh registry files"): + parallel(self._force_fresh_registry, self.loaders, load_params) + if load_params.load_type != LoadType.S3: return @@ -88,6 +92,11 @@ class DefaultRunner(RunnerBase): parallel(self._prepare_loader, self.loaders, load_params, grpc_peer, s3_public_keys, k6_dir) + def _force_fresh_registry(self, loader: Loader, load_params: LoadParams): + with reporter.step(f"Forcing fresh registry on {loader.ip}"): + shell = loader.get_shell() + shell.exec(f"rm -f {load_params.registry_file}") + def _prepare_loader( self, loader: Loader,