forked from TrueCloudLab/frostfs-testlib
[#133] Change reporter usage
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
39a17f3634
commit
dc6b0e407f
37 changed files with 478 additions and 678 deletions
|
@ -5,9 +5,9 @@ import re
|
|||
import uuid
|
||||
from typing import Any, Optional
|
||||
|
||||
from frostfs_testlib import reporter
|
||||
from frostfs_testlib.cli import FrostfsCli
|
||||
from frostfs_testlib.cli.neogo import NeoGo
|
||||
from frostfs_testlib.reporter import get_reporter
|
||||
from frostfs_testlib.resources.cli import CLI_DEFAULT_TIMEOUT, FROSTFS_CLI_EXEC, NEOGO_EXECUTABLE
|
||||
from frostfs_testlib.resources.common import ASSETS_DIR, DEFAULT_WALLET_CONFIG
|
||||
from frostfs_testlib.shell import Shell
|
||||
|
@ -16,10 +16,9 @@ from frostfs_testlib.utils import json_utils
|
|||
from frostfs_testlib.utils.cli_utils import parse_cmd_table, parse_netmap_output
|
||||
|
||||
logger = logging.getLogger("NeoLogger")
|
||||
reporter = get_reporter()
|
||||
|
||||
|
||||
@reporter.step_deco("Get object from random node")
|
||||
@reporter.step("Get object from random node")
|
||||
def get_object_from_random_node(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -70,7 +69,7 @@ def get_object_from_random_node(
|
|||
)
|
||||
|
||||
|
||||
@reporter.step_deco("Get object from {endpoint}")
|
||||
@reporter.step("Get object from {endpoint}")
|
||||
def get_object(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -126,7 +125,7 @@ def get_object(
|
|||
return file_path
|
||||
|
||||
|
||||
@reporter.step_deco("Get Range Hash from {endpoint}")
|
||||
@reporter.step("Get Range Hash from {endpoint}")
|
||||
def get_range_hash(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -176,7 +175,7 @@ def get_range_hash(
|
|||
return result.stdout.split(":")[1].strip()
|
||||
|
||||
|
||||
@reporter.step_deco("Put object to random node")
|
||||
@reporter.step("Put object to random node")
|
||||
def put_object_to_random_node(
|
||||
wallet: str,
|
||||
path: str,
|
||||
|
@ -235,7 +234,7 @@ def put_object_to_random_node(
|
|||
)
|
||||
|
||||
|
||||
@reporter.step_deco("Put object at {endpoint} in container {cid}")
|
||||
@reporter.step("Put object at {endpoint} in container {cid}")
|
||||
def put_object(
|
||||
wallet: str,
|
||||
path: str,
|
||||
|
@ -296,7 +295,7 @@ def put_object(
|
|||
return oid.strip()
|
||||
|
||||
|
||||
@reporter.step_deco("Delete object {cid}/{oid} from {endpoint}")
|
||||
@reporter.step("Delete object {cid}/{oid} from {endpoint}")
|
||||
def delete_object(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -344,7 +343,7 @@ def delete_object(
|
|||
return tombstone.strip()
|
||||
|
||||
|
||||
@reporter.step_deco("Get Range")
|
||||
@reporter.step("Get Range")
|
||||
def get_range(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -397,7 +396,7 @@ def get_range(
|
|||
return range_file_path, content
|
||||
|
||||
|
||||
@reporter.step_deco("Lock Object")
|
||||
@reporter.step("Lock Object")
|
||||
def lock_object(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -458,7 +457,7 @@ def lock_object(
|
|||
return oid.strip()
|
||||
|
||||
|
||||
@reporter.step_deco("Search object")
|
||||
@reporter.step("Search object")
|
||||
def search_object(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -503,9 +502,7 @@ def search_object(
|
|||
cid=cid,
|
||||
bearer=bearer,
|
||||
xhdr=xhdr,
|
||||
filters=[f"{filter_key} EQ {filter_val}" for filter_key, filter_val in filters.items()]
|
||||
if filters
|
||||
else None,
|
||||
filters=[f"{filter_key} EQ {filter_val}" for filter_key, filter_val in filters.items()] if filters else None,
|
||||
session=session,
|
||||
phy=phy,
|
||||
root=root,
|
||||
|
@ -517,19 +514,17 @@ def search_object(
|
|||
if expected_objects_list:
|
||||
if sorted(found_objects) == sorted(expected_objects_list):
|
||||
logger.info(
|
||||
f"Found objects list '{found_objects}' "
|
||||
f"is equal for expected list '{expected_objects_list}'"
|
||||
f"Found objects list '{found_objects}' " f"is equal for expected list '{expected_objects_list}'"
|
||||
)
|
||||
else:
|
||||
logger.warning(
|
||||
f"Found object list {found_objects} "
|
||||
f"is not equal to expected list '{expected_objects_list}'"
|
||||
f"Found object list {found_objects} " f"is not equal to expected list '{expected_objects_list}'"
|
||||
)
|
||||
|
||||
return found_objects
|
||||
|
||||
|
||||
@reporter.step_deco("Get netmap netinfo")
|
||||
@reporter.step("Get netmap netinfo")
|
||||
def get_netmap_netinfo(
|
||||
wallet: str,
|
||||
shell: Shell,
|
||||
|
@ -581,7 +576,7 @@ def get_netmap_netinfo(
|
|||
return settings
|
||||
|
||||
|
||||
@reporter.step_deco("Head object")
|
||||
@reporter.step("Head object")
|
||||
def head_object(
|
||||
wallet: str,
|
||||
cid: str,
|
||||
|
@ -677,7 +672,7 @@ def head_object(
|
|||
return json_utils.decode_simple_header(decoded)
|
||||
|
||||
|
||||
@reporter.step_deco("Run neo-go dump-keys")
|
||||
@reporter.step("Run neo-go dump-keys")
|
||||
def neo_go_dump_keys(shell: Shell, wallet: str) -> dict:
|
||||
"""
|
||||
Run neo-go dump keys command
|
||||
|
@ -702,7 +697,7 @@ def neo_go_dump_keys(shell: Shell, wallet: str) -> dict:
|
|||
return {address_id: wallet_key}
|
||||
|
||||
|
||||
@reporter.step_deco("Run neo-go query height")
|
||||
@reporter.step("Run neo-go query height")
|
||||
def neo_go_query_height(shell: Shell, endpoint: str) -> dict:
|
||||
"""
|
||||
Run neo-go query height command
|
||||
|
@ -734,7 +729,7 @@ def neo_go_query_height(shell: Shell, endpoint: str) -> dict:
|
|||
}
|
||||
|
||||
|
||||
@reporter.step_deco("Search object nodes")
|
||||
@reporter.step("Search object nodes")
|
||||
def get_object_nodes(
|
||||
cluster: Cluster,
|
||||
wallet: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue