Skip to content

Commit

Permalink
env: add version dependent config for s3 gw
Browse files Browse the repository at this point in the history
closes #827

Signed-off-by: Evgeniy Zayats <[email protected]>
  • Loading branch information
Evgeniy Zayats committed Aug 3, 2024
1 parent b316aaa commit 0607ff6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions neofs-testlib/neofs_testlib/env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,16 @@ def _generate_config(self):
peers=peers,
tree_service_endpoint=self.neofs_env.storage_nodes[0].endpoint,
listen_domain=self.neofs_env.domain,
s3_gw_version=self._get_version(),
)

def _get_version(self) -> str:
raw_version_output = self.neofs_env._run_single_command(self.neofs_env.neofs_s3_gw_path, "--version")
for line in raw_version_output.splitlines():
if "Version:" in line:
return line.split("Version:")[1].strip()
return ""

def _launch_process(self):
self.stdout = self.neofs_env._generate_temp_file(prefix="s3gw_stdout")
self.stderr = self.neofs_env._generate_temp_file(prefix="s3gw_stderr")
Expand Down
7 changes: 7 additions & 0 deletions neofs-testlib/neofs_testlib/env/templates/s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ wallet:
passphrase: {{ wallet.password }} # Passphrase to decrypt wallet

# RPC endpoint

{% if s3_gw_version <= "0.30.1" %}
rpc_endpoint: http://{{ morph_endpoint }}
{% else %}
fschain:
endpoints:
- http://{{ morph_endpoint }}
{% endif %}

peers:
{%- for peer in peers %}
Expand Down

0 comments on commit 0607ff6

Please sign in to comment.