Skip to content

Commit

Permalink
rptest: add addressing style configuration to ducktape
Browse files Browse the repository at this point in the history
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'])`
  • Loading branch information
WillemKauf committed Apr 18, 2024
1 parent 2c8c094 commit 1e09d37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1e09d37

Please sign in to comment.