From 1e09d37e4e4c259a000ec93d08ebe637ee85b401 Mon Sep 17 00:00:00 2001 From: Willem Kaufmann Date: Thu, 18 Apr 2024 16:41:18 -0400 Subject: [PATCH] rptest: add addressing style configuration to ducktape The addressing style used by `redpanda` for ducktape tests can now be set with the variable `cloud_storage_url_style` in `SISettings`, or injected into a test similar to `cloud_storage_type` with a decorator. e.g: `@matrix(cloud_storage_url_style=['path','virtual_host'])` --- tests/rptest/services/redpanda.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/rptest/services/redpanda.py b/tests/rptest/services/redpanda.py index 03f0751f882c2..a4c3bc0c2b056 100644 --- a/tests/rptest/services/redpanda.py +++ b/tests/rptest/services/redpanda.py @@ -435,6 +435,7 @@ def __init__(self, cloud_storage_region: str = 'panda-region', cloud_storage_api_endpoint: str = 'minio-s3', cloud_storage_api_endpoint_port: int = 9000, + cloud_storage_url_style: str = 'virtual_host', cloud_storage_cache_size: Optional[int] = None, cloud_storage_cache_max_objects: Optional[int] = None, cloud_storage_enable_remote_read: bool = True, @@ -477,12 +478,20 @@ def __init__(self, self.cloud_storage_secret_key = cloud_storage_secret_key self.cloud_storage_region = cloud_storage_region self._cloud_storage_bucket = f'panda-bucket-{uuid.uuid1()}' + self.cloud_storage_url_style = cloud_storage_url_style self.cloud_storage_api_endpoint = cloud_storage_api_endpoint if test_context.globals.get(self.GLOBAL_CLOUD_PROVIDER, 'aws') == 'gcp': self.cloud_storage_api_endpoint = 'storage.googleapis.com' self.cloud_storage_api_endpoint_port = cloud_storage_api_endpoint_port + + if hasattr(test_context, 'injected_args') \ + and test_context.injected_args is not None \ + and 'cloud_storage_url_style' in test_context.injected_args: + self.cloud_storage_url_style = test_context.injected_args[ + 'cloud_storage_url_style'] + elif self.cloud_storage_type == CloudStorageType.ABS: self.cloud_storage_azure_shared_key = self.ABS_AZURITE_KEY self.cloud_storage_azure_storage_account = self.ABS_AZURITE_ACCOUNT @@ -628,6 +637,7 @@ def update_rp_conf(self, conf) -> dict[str, Any]: conf["cloud_storage_secret_key"] = self.cloud_storage_secret_key conf["cloud_storage_region"] = self.cloud_storage_region conf["cloud_storage_bucket"] = self._cloud_storage_bucket + conf["cloud_storage_url_style"] = self.cloud_storage_url_style elif self.cloud_storage_type == CloudStorageType.ABS: conf[ 'cloud_storage_azure_storage_account'] = self.cloud_storage_azure_storage_account