forked from TrueCloudLab/frostfs-testcases
Fixes in tests to enable them to run in a cloud environment
Few small fixes were made: - Fix path to binaries on storage node in cloud env. - Add logic to prepend ssh command with sudo. - Make re-encoding of homomorphic hash conditional. - Increase ssh timeout. Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
892b8f227a
commit
5f53e80f93
4 changed files with 26 additions and 14 deletions
|
@ -28,8 +28,13 @@ def tick_epoch():
|
|||
# If neofs-adm is available, then we tick epoch with it (to be consistent with UAT tests)
|
||||
cmd = f"{NEOFS_ADM_EXEC} morph force-new-epoch -c {NEOFS_ADM_CONFIG_PATH}"
|
||||
logger.info(f"Executing shell command: {cmd}")
|
||||
out = wrappers.run_sh(cmd)
|
||||
logger.info(f"Command completed with output: {out}")
|
||||
try:
|
||||
out = wrappers.run_sh(cmd)
|
||||
logger.info(f"Command completed with output: {out}")
|
||||
except Exception as exc:
|
||||
logger.error(exc)
|
||||
raise RuntimeError("Failed to tick epoch") from exc
|
||||
|
||||
return
|
||||
|
||||
# Otherwise we tick epoch using transaction
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python3
|
||||
#!/usr/bin/python3.9
|
||||
|
||||
"""
|
||||
When doing requests to NeoFS, we get JSON output as an automatically decoded
|
||||
|
@ -144,13 +144,15 @@ def decode_common_fields(data: dict):
|
|||
header contains several common fields.
|
||||
This function rearranges these fields.
|
||||
"""
|
||||
# reencoding binary IDs
|
||||
data["objectID"] = json_reencode(data["objectID"]["value"])
|
||||
data["header"]["containerID"] = json_reencode(data["header"]["containerID"]["value"])
|
||||
data["header"]["ownerID"] = json_reencode(data["header"]["ownerID"]["value"])
|
||||
data["header"]["homomorphicHash"] = json_reencode(data["header"]["homomorphicHash"]["sum"])
|
||||
data["header"]["payloadHash"] = json_reencode(data["header"]["payloadHash"]["sum"])
|
||||
data["header"]["version"] = (
|
||||
f"{data['header']['version']['major']}{data['header']['version']['minor']}"
|
||||
)
|
||||
|
||||
header = data["header"]
|
||||
header["containerID"] = json_reencode(header["containerID"]["value"])
|
||||
header["ownerID"] = json_reencode(header["ownerID"]["value"])
|
||||
header["payloadHash"] = json_reencode(header["payloadHash"]["sum"])
|
||||
header["version"] = f"{header['version']['major']}{header['version']['minor']}"
|
||||
# Homomorphic hash is optional and its calculation might be disabled in trusted network
|
||||
if header.get("homomorphicHash"):
|
||||
header["homomorphicHash"] = json_reencode(header["homomorphicHash"]["sum"])
|
||||
|
||||
return data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue