From f70e0852aa7cb5e0657d72d386f681679467c0f1 Mon Sep 17 00:00:00 2001 From: EliChin <70199136+EliChin@users.noreply.github.com> Date: Mon, 29 Mar 2021 13:18:24 +0300 Subject: [PATCH] Temporary Directory created --- .gitignore | 1 + robot/resources/lib/neofs.py | 58 ++++++++++--------- robot/resources/lib/neofs_int_vars.py | 3 +- robot/resources/lib/payment_neogo.py | 23 ++++---- .../acl/acl_basic_private_container.robot | 5 +- .../acl/acl_basic_public_container.robot | 5 +- .../acl/acl_basic_readonly_container.robot | 7 +-- .../integration/acl/acl_bearer_allow.robot | 6 +- .../integration/acl/acl_bearer_compound.robot | 7 +-- .../acl/acl_bearer_filter_oid_equal.robot | 6 +- .../acl/acl_bearer_filter_oid_not_equal.robot | 6 +- .../acl_bearer_filter_userheader_equal.robot | 6 +- ...l_bearer_filter_userheader_not_equal.robot | 6 +- .../acl/acl_bearer_inaccessible.robot | 6 +- ...l_bearer_request_filter_xheader_deny.robot | 6 +- ..._bearer_request_filter_xheader_equal.robot | 6 +- ...rer_request_filter_xheader_not_equal.robot | 6 +- .../acl/acl_extended_actions.robot | 10 +--- .../acl/acl_extended_compound.robot | 11 +--- .../acl/acl_extended_filters.robot | 10 +--- .../integration/network/netmap_simple.robot | 5 +- .../integration/network/replication.robot | 7 +-- .../integration/object/object_complex.robot | 19 +++--- .../integration/object/object_simple.robot | 19 +++--- .../object/object_storagegroup_complex.robot | 9 +-- .../object/object_storagegroup_simple.robot | 7 +-- .../integration/payment/withdraw.robot | 1 + .../integration/services/http_gate.robot | 13 ++--- .../integration/services/s3_gate.robot | 6 +- robot/variables/common.py | 3 +- 30 files changed, 108 insertions(+), 175 deletions(-) diff --git a/.gitignore b/.gitignore index d50d20ce..54a5d20e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ # ignore pycache under any path **/__pycache__ +TemporaryDir/* \ No newline at end of file diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index e76009c8..c91b8478 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -14,6 +14,7 @@ import base58 import docker import json import tarfile +import shutil import time from datetime import datetime @@ -21,10 +22,10 @@ from datetime import datetime if os.getenv('ROBOT_PROFILE') == 'selectel_smoke': from selectelcdn_smoke_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT, - NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP) + NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR) else: from neofs_int_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT, - NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP) + NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR) ROBOT_AUTO_KEYWORDS = False @@ -201,6 +202,7 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_ cid_base64 = base64.b64encode(cid_base58_b).decode("utf-8") eacl = get_eacl(private_key, cid) json_eacl = {} + file_path = TEMP_DIR + file_name if eacl: res_json = re.split(r'[\s\n]+Signature:', eacl) @@ -228,15 +230,15 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_ for record in json_eacl["records"]: eacl_result["body"]["eaclTable"]["records"].append(record) - with open(file_name, 'w', encoding='utf-8') as f: + with open(file_path, 'w', encoding='utf-8') as f: json.dump(eacl_result, f, ensure_ascii=False, indent=4) logger.info(eacl_result) # Sign bearer token Cmd = ( - f'{NEOFS_CLI_EXEC} util sign bearer-token --from {file_name} ' - f'--to {file_name} --key {private_key} --json' + f'{NEOFS_CLI_EXEC} util sign bearer-token --from {file_path} ' + f'--to {file_path} --key {private_key} --json' ) logger.info("Cmd: %s" % Cmd) @@ -248,7 +250,7 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_ except subprocess.CalledProcessError as e: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) - return file_name + return file_path @keyword('Form eACL json common file') def form_eacl_json_common_file(file_name, eacl_oper_list ): @@ -285,12 +287,12 @@ def get_range(private_key: str, cid: str, oid: str, range_file: str, bearer: str range_cut: str, options:str=""): bearer_token = "" if bearer: - bearer_token = f"--bearer {bearer}" + bearer_token = f"--bearer {TEMP_DIR}{bearer}" Cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} ' f'object range --cid {cid} --oid {oid} {bearer_token} --range {range_cut} ' - f'--file {range_file} {options}' + f'--file {TEMP_DIR}{range_file} {options}' ) logger.info("Cmd: %s" % Cmd) @@ -362,7 +364,7 @@ def generate_file_of_bytes(size): size = int(float(size)) - filename = str(uuid.uuid4()) + filename = TEMP_DIR + str(uuid.uuid4()) with open('%s'%filename, 'wb') as fout: fout.write(os.urandom(size)) @@ -377,7 +379,7 @@ def search_object(private_key: str, cid: str, keys: str, bearer: str, filters: s filters_result = "" if bearer: - bearer_token = f"--bearer {bearer}" + bearer_token = f"--bearer {TEMP_DIR}{bearer}" if filters: for filter_item in filters.split(','): filter_item = re.sub(r'=', ' EQ ', filter_item) @@ -652,7 +654,7 @@ def head_object(private_key: str, cid: str, oid: str, bearer_token: str="", user_headers:str="", options:str="", endpoint: str="", ignore_failure: bool = False): if bearer_token: - bearer_token = f"--bearer {bearer_token}" + bearer_token = f"--bearer {TEMP_DIR}{bearer_token}" if endpoint == "": endpoint = NEOFS_ENDPOINT @@ -792,7 +794,7 @@ def parse_object_system_header(header: str): def delete_object(private_key: str, cid: str, oid: str, bearer: str, options: str=""): bearer_token = "" if bearer: - bearer_token = f"--bearer {bearer}" + bearer_token = f"--bearer {TEMP_DIR}{bearer}" ObjectCmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} ' @@ -814,7 +816,7 @@ def get_file_name(filepath): return filename @keyword('Get file hash') -def get_file_hash(filename): +def get_file_hash(filename : str): file_hash = _get_file_hash(filename) return file_hash @@ -827,16 +829,15 @@ def verify_file_hash(filename, expected_hash): raise Exception("File hash '{}' is not equal to {}".format(file_hash, expected_hash)) @keyword('Cleanup Files') -def cleanup_file(*filename_list): - for filename in filename_list: - if os.path.isfile(filename): - try: - os.remove(filename) - except OSError as e: - raise Exception("Error: '%s' - %s." % (e.filename, e.strerror)) - else: - logger.warn("Error: '%s' file not found" % filename) - logger.info("File '%s' has been deleted." % filename) +def cleanup_file(): + if os.path.isdir(TEMP_DIR): + try: + shutil.rmtree(TEMP_DIR) + except OSError as e: + raise Exception(f"Error: '{e.TEMP_DIR}' - {e.strerror}.") + else: + logger.warn(f"Error: '{TEMP_DIR}' file not found") + logger.info(f"File '{TEMP_DIR}' has been deleted.") @keyword('Put object') def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers: str, @@ -849,7 +850,7 @@ def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers: if user_headers: user_headers = f"--attributes {user_headers}" if bearer: - bearer = f"--bearer {bearer}" + bearer = f"--bearer {TEMP_DIR}{bearer}" putObjectCmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --key {private_key} object ' @@ -932,7 +933,7 @@ def find_in_nodes_Log(line: str, nodes_logs_time: dict): def get_range_hash(private_key: str, cid: str, oid: str, bearer_token: str, range_cut: str, options: str=""): if bearer_token: - bearer_token = f"--bearer {bearer_token}" + bearer_token = f"--bearer {TEMP_DIR}{bearer_token}" ObjectCmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} ' @@ -951,17 +952,19 @@ def get_range_hash(private_key: str, cid: str, oid: str, bearer_token: str, def get_object(private_key: str, cid: str, oid: str, bearer_token: str, write_object: str, endpoint: str="", options: str="" ): + file_path = TEMP_DIR + write_object + logger.info("Going to put the object") if not endpoint: endpoint = random.sample(_get_storage_nodes(), 1)[0] if bearer_token: - bearer_token = f"--bearer {bearer_token}" + bearer_token = f"--bearer {TEMP_DIR}{bearer_token}" ObjectCmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --key {private_key} ' - f'object get --cid {cid} --oid {oid} --file {write_object} {bearer_token} ' + f'object get --cid {cid} --oid {oid} --file {file_path} {bearer_token} ' f'{options}' ) logger.info("Cmd: %s" % ObjectCmd) @@ -971,6 +974,7 @@ def get_object(private_key: str, cid: str, oid: str, bearer_token: str, logger.info("Output: %s" % complProc.stdout) except subprocess.CalledProcessError as e: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + return file_path diff --git a/robot/resources/lib/neofs_int_vars.py b/robot/resources/lib/neofs_int_vars.py index 1ae0a9b6..c4236337 100644 --- a/robot/resources/lib/neofs_int_vars.py +++ b/robot/resources/lib/neofs_int_vars.py @@ -10,4 +10,5 @@ S3_GATE = 'https://s3.neofs.devenv:8080' NEOFS_NETMAP = ['s01.neofs.devenv:8080', 's02.neofs.devenv:8080','s03.neofs.devenv:8080','s04.neofs.devenv:8080'] GAS_HASH = '0x70e2301955bf1e74cbb31d18c2f96972abadb328' -NEOFS_CONTRACT = "005a4906ec233a3b677dad9fd7033ad8653f579d" \ No newline at end of file +NEOFS_CONTRACT = "005a4906ec233a3b677dad9fd7033ad8653f579d" +TEMP_DIR = "TemporaryDir/" \ No newline at end of file diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index 94c294cf..9a4814bc 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -20,10 +20,10 @@ ROBOT_AUTO_KEYWORDS = False if os.getenv('ROBOT_PROFILE') == 'selectel_smoke': from selectelcdn_smoke_vars import (NEO_MAINNET_ENDPOINT, - NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT) + NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR) else: from neofs_int_vars import (NEO_MAINNET_ENDPOINT, - NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT) + NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR) # path to neofs-cli executable NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli') @@ -31,7 +31,9 @@ NEOGO_CLI_EXEC = os.getenv('NEOGO_CLI_EXEC', 'neo-go') @keyword('Init wallet') def init_wallet(): - filename = os.getcwd() + '/' + str(uuid.uuid4()) + ".json" + if not os.path.exists(TEMP_DIR): + os.makedirs(TEMP_DIR) + filename = os.getcwd() + '/' + TEMP_DIR + str(uuid.uuid4()) + ".json" cmd = f"{NEOGO_CLI_EXEC} wallet init -w {filename}" logger.info(f"Executing command: {cmd}") stdout = _run_sh(cmd) @@ -248,21 +250,18 @@ def _get_balance_request(privkey: str): f'{NEOFS_CLI_EXEC} --key {privkey} --rpc-endpoint {NEOFS_ENDPOINT}' f' accounting balance' ) - logger.info("Cmd: %s" % Cmd) + logger.info(f"Cmd: {Cmd}") complProc = subprocess.run(Cmd, check=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) output = complProc.stdout - logger.info("Output: %s" % output) + logger.info(f"Output: {output}") + if output is None: + BuiltIn().fatal_error(f'Can not parse balance: "{output}"') - m = re.match(r'(-?[\d.\.?\d*]+)', output ) - if m is None: - BuiltIn().fatal_error('Can not parse balance: "%s"' % output) - balance = m.group(1) + logger.info(f"Balance for '{privkey}' is '{output}'" ) - logger.info("Balance for '%s' is '%s'" % (privkey, balance) ) - - return balance + return output def _run_sh(args): complProc = subprocess.run(args, check=True, universal_newlines=True, diff --git a/robot/testsuites/integration/acl/acl_basic_private_container.robot b/robot/testsuites/integration/acl/acl_basic_private_container.robot index 8740f52a..801fb04e 100644 --- a/robot/testsuites/integration/acl/acl_basic_private_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_private_container.robot @@ -1,6 +1,5 @@ *** Settings *** Variables ../../../variables/common.py -Library Collections Library ../${RESOURCES}/neofs.py Library ../${RESOURCES}/payment_neogo.py @@ -132,6 +131,4 @@ Check Private Container Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range - Cleanup Files @{CLEANUP_FILES} - Get Docker Logs acl_basic \ No newline at end of file + Cleanup Files \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_basic_public_container.robot b/robot/testsuites/integration/acl/acl_basic_public_container.robot index 19519b4d..f229c726 100644 --- a/robot/testsuites/integration/acl/acl_basic_public_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_public_container.robot @@ -1,6 +1,5 @@ *** Settings *** Variables ../../../variables/common.py - Library ../${RESOURCES}/neofs.py Library ../${RESOURCES}/payment_neogo.py @@ -103,6 +102,4 @@ Check Public Container Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range - Cleanup Files @{CLEANUP_FILES} - Get Docker Logs acl_basic \ No newline at end of file + Cleanup Files \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot index 9dbeaeeb..dd98962d 100644 --- a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot @@ -1,6 +1,5 @@ *** Settings *** -Variables ../../../variables/common.py - +Variables ../../../variables/common.py Library ../${RESOURCES}/neofs.py Library ../${RESOURCES}/payment_neogo.py @@ -113,6 +112,4 @@ Check Read-Only Container Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range - Cleanup Files @{CLEANUP_FILES} - Get Docker Logs acl_basic \ No newline at end of file + Cleanup Files \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_allow.robot b/robot/testsuites/integration/acl/acl_bearer_allow.robot index 41d32152..041e7ea4 100644 --- a/robot/testsuites/integration/acl/acl_bearer_allow.robot +++ b/robot/testsuites/integration/acl/acl_bearer_allow.robot @@ -21,7 +21,6 @@ BearerToken Operations Check eACL Deny and Allow All Bearer Simple Log Check Bearer token with complex object - Cleanup Files ${FILE_S} Generate file 70e+6 Check eACL Deny and Allow All Bearer Complex @@ -101,7 +100,4 @@ Check eACL Deny and Allow All Bearer Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} - Get Docker Logs acl_bearer \ No newline at end of file + Cleanup Files \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_compound.robot b/robot/testsuites/integration/acl/acl_bearer_compound.robot index e1591718..ef4f4b5b 100644 --- a/robot/testsuites/integration/acl/acl_bearer_compound.robot +++ b/robot/testsuites/integration/acl/acl_bearer_compound.robot @@ -20,7 +20,7 @@ BearerToken Operations for Сompound Operations Check Сompound Operations Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check Сompound Operations @@ -122,7 +122,4 @@ Check Bearer Сompound Get Range Hash Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... gen_eacl_deny_all_USER bearer_allow - Cleanup Files @{CLEANUP_FILES} - Get Docker Logs acl_bearer \ No newline at end of file + Cleanup Files \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot index 0a06b3c9..f0049a56 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_oid_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations with Filter OID Equal Check eACL Deny and Allow All Bearer Filter OID Equal Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter OID Equal @@ -90,7 +90,5 @@ Check eACL Deny and Allow All Bearer Filter OID Equal Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot index dbdd750e..85e1f977 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_oid_not_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations with Filter OID NotEqual Check eACL Deny and Allow All Bearer Filter OID NotEqual Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter OID NotEqual @@ -118,7 +118,5 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot index 7a87fa87..8c0be050 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations with Filter UserHeader Equal Generate file 1024 Check eACL Deny and Allow All Bearer Filter UserHeader Equal - Cleanup Files ${FILE_S} + Log Check Bearer token with complex object Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter UserHeader Equal @@ -124,7 +124,5 @@ Check eACL Deny and Allow All Bearer Filter UserHeader Equal Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot index 530738fd..8ca63849 100644 --- a/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_filter_userheader_not_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations Filter UserHeader NotEqual Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual @@ -107,7 +107,5 @@ Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot b/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot index 3d3949c2..a81b01e1 100644 --- a/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot +++ b/robot/testsuites/integration/acl/acl_bearer_inaccessible.robot @@ -21,7 +21,7 @@ BearerToken Operations for Inaccessible Container Check Container Inaccessible and Allow All Bearer Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check Container Inaccessible and Allow All Bearer @@ -61,7 +61,5 @@ Check Container Inaccessible and Allow All Bearer Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot index 7c3d8625..f6337958 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_deny.robot @@ -24,7 +24,7 @@ BearerToken Operations Check eACL Allow All Bearer Filter Requst Equal Deny Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Allow All Bearer Filter Requst Equal Deny @@ -78,7 +78,5 @@ Check eACL Allow All Bearer Filter Requst Equal Deny Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot index d6e2e9c3..468e53d4 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations with Filter Requst Equal Check eACL Deny and Allow All Bearer Filter Requst Equal Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter Requst Equal @@ -81,7 +81,5 @@ Check eACL Deny and Allow All Bearer Filter Requst Equal Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot index 88da0db4..13ec572f 100644 --- a/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot +++ b/robot/testsuites/integration/acl/acl_bearer_request_filter_xheader_not_equal.robot @@ -21,7 +21,7 @@ BearerToken Operations with Filter Requst NotEqual Check eACL Deny and Allow All Bearer Filter Requst NotEqual Log Check Bearer token with complex object - Cleanup Files ${FILE_S} + Generate file 70e+6 Check eACL Deny and Allow All Bearer Filter Requst NotEqual @@ -80,7 +80,5 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range - ... bearer_allow_all_user gen_eacl_deny_all_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_bearer \ No newline at end of file diff --git a/robot/testsuites/integration/acl/acl_extended_actions.robot b/robot/testsuites/integration/acl/acl_extended_actions.robot index bfe66f14..a4e1e282 100644 --- a/robot/testsuites/integration/acl/acl_extended_actions.robot +++ b/robot/testsuites/integration/acl/acl_extended_actions.robot @@ -20,7 +20,6 @@ Extended ACL Operations Generate files 1024 Check Actions - Cleanup Files ${FILE_S} ${FILE_S_2} Log Check extended ACL with complex object Generate files 70e+6 @@ -240,12 +239,5 @@ Check eACL Deny and Allow All Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl s_get_range - ... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER - ... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS - ... gen_eacl_deny_all_OTHERS - ... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS - ... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER - ... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_extended diff --git a/robot/testsuites/integration/acl/acl_extended_compound.robot b/robot/testsuites/integration/acl/acl_extended_compound.robot index 476d3bb8..7e175b69 100644 --- a/robot/testsuites/integration/acl/acl_extended_compound.robot +++ b/robot/testsuites/integration/acl/acl_extended_compound.robot @@ -20,7 +20,7 @@ Extended ACL Operations Generate files 1024 Check Сompound Operations - Cleanup Files ${FILE_S} ${FILE_S_2} + Log Check extended ACL with complex object Generate files 70e+6 @@ -106,12 +106,5 @@ Check eACL Сompound Get Range Hash Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl s_get_range - ... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER - ... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS - ... gen_eacl_deny_all_OTHERS - ... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS - ... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER - ... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_extended diff --git a/robot/testsuites/integration/acl/acl_extended_filters.robot b/robot/testsuites/integration/acl/acl_extended_filters.robot index d4007828..666edb8e 100644 --- a/robot/testsuites/integration/acl/acl_extended_filters.robot +++ b/robot/testsuites/integration/acl/acl_extended_filters.robot @@ -19,7 +19,6 @@ Extended ACL Operations Generate files 1024 Check Filters - Cleanup Files ${FILE_S} ${FILE_S_2} Log Check extended ACL with complex object Generate files 70e+6 @@ -202,12 +201,5 @@ Check eACL MatchType String Not Equal Object Cleanup - @{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl eacl_custom s_get_range - ... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER - ... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS - ... gen_eacl_deny_all_OTHERS - ... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS - ... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER - ... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs acl_extended diff --git a/robot/testsuites/integration/network/netmap_simple.robot b/robot/testsuites/integration/network/netmap_simple.robot index 86bc6cd0..23687acc 100644 --- a/robot/testsuites/integration/network/netmap_simple.robot +++ b/robot/testsuites/integration/network/netmap_simple.robot @@ -60,7 +60,7 @@ NeoFS Simple Netmap Run Keyword And Expect Error * ... Validate Policy REP 2 IN X CBF 2 SELECT 6 FROM * AS X 2 @{EMPTY} - [Teardown] Cleanup ${FILE} + [Teardown] Cleanup *** Keywords *** @@ -109,6 +109,5 @@ Validate Policy Cleanup - [Arguments] ${FILE} - Cleanup Files ${FILE} s_file_read + Cleanup Files Get Docker Logs netmap_simple \ No newline at end of file diff --git a/robot/testsuites/integration/network/replication.robot b/robot/testsuites/integration/network/replication.robot index 373f9252..b31404c9 100644 --- a/robot/testsuites/integration/network/replication.robot +++ b/robot/testsuites/integration/network/replication.robot @@ -53,16 +53,13 @@ NeoFS Object Replication Find in Nodes Log object successfully replicated ${NODES_LOG_TIME} Start nodes @{NODES_OBJ_STOPPED} - - [Teardown] Cleanup ${FILE} @{NODES_OBJ_STOPPED} + Cleanup *** Keywords *** Cleanup - [Arguments] ${FILE} @{NODES_OBJ_STOPPED} - Start nodes @{NODES_OBJ_STOPPED} - Cleanup Files ${FILE} + Cleanup Files Get Docker Logs replication diff --git a/robot/testsuites/integration/object/object_complex.robot b/robot/testsuites/integration/object/object_complex.robot index e2ba102c..a24d92e5 100644 --- a/robot/testsuites/integration/object/object_complex.robot +++ b/robot/testsuites/integration/object/object_complex.robot @@ -57,11 +57,11 @@ NeoFS Complex Object Operations Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_ALL} - Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + ${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + ${GET_OBJ_H} = Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - Verify file hash s_file_read ${FILE_HASH} - Verify file hash h_file_read ${FILE_HASH} + Verify file hash ${GET_OBJ_S} ${FILE_HASH} + Verify file hash ${GET_OBJ_H} ${FILE_HASH} Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 @@ -88,20 +88,17 @@ NeoFS Complex Object Operations Sleep 2min Run Keyword And Expect Error * - ... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + ... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${GET_OBJ_S} Run Keyword And Expect Error * - ... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + ... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${GET_OBJ_H} - [Teardown] Cleanup ${FILE} - + [Teardown] Cleanup *** Keywords *** Cleanup - [Arguments] ${FILE} - @{CLEANUP_FILES} = Create List ${FILE} s_file_read h_file_read s_get_range h_get_range - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs object_complex diff --git a/robot/testsuites/integration/object/object_simple.robot b/robot/testsuites/integration/object/object_simple.robot index 186de217..0a197afe 100644 --- a/robot/testsuites/integration/object/object_simple.robot +++ b/robot/testsuites/integration/object/object_simple.robot @@ -54,11 +54,11 @@ NeoFS Simple Object Operations @{S_OBJ_H} = Create List ${H_OID} @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} - Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + ${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + ${GET_OBJ_H} = Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - Verify file hash s_file_read ${FILE_HASH} - Verify file hash h_file_read ${FILE_HASH} + Verify file hash ${GET_OBJ_S} ${FILE_HASH} + Verify file hash ${GET_OBJ_H} ${FILE_HASH} Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 @@ -82,22 +82,19 @@ NeoFS Simple Object Operations Sleep 2min Run Keyword And Expect Error * - ... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + ... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${GET_OBJ_S} Run Keyword And Expect Error * - ... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + ... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${GET_OBJ_H} - [Teardown] Cleanup ${FILE} + [Teardown] Cleanup *** Keywords *** Cleanup - [Arguments] ${FILE} - - @{CLEANUP_FILES} = Create List ${FILE} s_file_read h_file_read s_get_range h_get_range - Cleanup Files @{CLEANUP_FILES} + Cleanup Files Get Docker Logs object_simple diff --git a/robot/testsuites/integration/object/object_storagegroup_complex.robot b/robot/testsuites/integration/object/object_storagegroup_complex.robot index 7484aaef..a723ca55 100644 --- a/robot/testsuites/integration/object/object_storagegroup_complex.robot +++ b/robot/testsuites/integration/object/object_storagegroup_complex.robot @@ -76,15 +76,12 @@ NeoFS Complex Storagegroup Run Keyword And Expect Error * ... Delete Storagegroup ${PRIV_KEY} ${CID} ${UNEXIST_OID} - [Teardown] Cleanup ${FILE_S} + [Teardown] Cleanup *** Keywords *** -Cleanup - [Arguments] ${FILE} - - @{CLEANUP_FILES} = Create List ${FILE} - Cleanup Files @{CLEANUP_FILES} +Cleanup + Cleanup Files Get Docker Logs object_storage_group_complex diff --git a/robot/testsuites/integration/object/object_storagegroup_simple.robot b/robot/testsuites/integration/object/object_storagegroup_simple.robot index 6d771a6d..8ba2bf0d 100644 --- a/robot/testsuites/integration/object/object_storagegroup_simple.robot +++ b/robot/testsuites/integration/object/object_storagegroup_simple.robot @@ -73,15 +73,12 @@ NeoFS Simple Storagegroup Run Keyword And Expect Error * ... Delete Storagegroup ${PRIV_KEY} ${CID} ${UNEXIST_OID} - [Teardown] Cleanup ${FILE_S} + [Teardown] Cleanup *** Keywords *** Cleanup - [Arguments] ${FILE} - - @{CLEANUP_FILES} = Create List ${FILE} - Cleanup Files @{CLEANUP_FILES} + Create List Get Docker Logs object_storage_group_simple diff --git a/robot/testsuites/integration/payment/withdraw.robot b/robot/testsuites/integration/payment/withdraw.robot index c8b9f4ca..363e52e2 100644 --- a/robot/testsuites/integration/payment/withdraw.robot +++ b/robot/testsuites/integration/payment/withdraw.robot @@ -58,4 +58,5 @@ NeoFS Deposit and Withdraw *** Keywords *** Cleanup + Cleanup Files Get Docker Logs withdraw \ No newline at end of file diff --git a/robot/testsuites/integration/services/http_gate.robot b/robot/testsuites/integration/services/http_gate.robot index cd51eec0..d7f942d6 100644 --- a/robot/testsuites/integration/services/http_gate.robot +++ b/robot/testsuites/integration/services/http_gate.robot @@ -48,28 +48,27 @@ NeoFS HTTP Gateway @{GET_NODE_LIST} = Get nodes without object ${PRIV_KEY} ${CID} ${S_OID} ${NODE} = Evaluate random.choice($GET_NODE_LIST) random - Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE} + ${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE} ${FILEPATH} = Get via HTTP Gate ${CID} ${S_OID} - Verify file hash s_file_read ${FILE_HASH} + Verify file hash ${GET_OBJ_S} ${FILE_HASH} Verify file hash ${FILEPATH} ${FILE_HASH} @{GET_NODE_LIST} = Get nodes without object ${PRIV_KEY} ${CID} ${L_OID} ${NODE} = Evaluate random.choice($GET_NODE_LIST) random - Get object ${PRIV_KEY} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE} + ${GET_OBJ_L} = Get object ${PRIV_KEY} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE} ${FILEPATH} = Get via HTTP Gate ${CID} ${L_OID} - Verify file hash l_file_read ${FILE_L_HASH} + Verify file hash ${GET_OBJ_L} ${FILE_L_HASH} Verify file hash ${FILEPATH} ${FILE_L_HASH} - [Teardown] Cleanup ${FILEPATH} ${FILE} + [Teardown] Cleanup *** Keywords *** Cleanup - [Arguments] ${FILEPATH} ${FILE} - Cleanup Files ${FILEPATH} ${FILE} s_file_read l_file_read + Cleanup Files Get Docker Logs http_gate \ No newline at end of file diff --git a/robot/testsuites/integration/services/s3_gate.robot b/robot/testsuites/integration/services/s3_gate.robot index b935e369..1ccd987f 100644 --- a/robot/testsuites/integration/services/s3_gate.robot +++ b/robot/testsuites/integration/services/s3_gate.robot @@ -85,12 +85,10 @@ NeoFS S3 Gateway ${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${BUCKET} List Should Not Contain Value ${LIST_S3_OBJECTS} FILE_S3_NAME - [Teardown] Cleanup ${FILE_S3} ${FILE_FS} + [Teardown] Cleanup *** Keywords *** Cleanup - [Arguments] ${FILE_S3} ${FILE_FS} - Cleanup Files s3_obj_get_fs fs_obj_get_fs s3_obj_get_s3 fs_obj_get_s3 - ... ${FILE_S3} ${FILE_FS} + Cleanup Files Get Docker Logs s3_gate \ No newline at end of file diff --git a/robot/variables/common.py b/robot/variables/common.py index 704e831b..009df046 100644 --- a/robot/variables/common.py +++ b/robot/variables/common.py @@ -11,4 +11,5 @@ ABSOLUTE_FILE_PATH="/robot/testsuites/integration" # Price of the contract Deposit execution: 0.1493182 GAS NEOFS_CONTRACT_DEPOSIT_GAS_FEE = 0.1493182 -NEOFS_CONTRACT_WITHDRAW_GAS_FEE = 0.0331791 \ No newline at end of file +NEOFS_CONTRACT_WITHDRAW_GAS_FEE = 0.0331791 +TEMP_DIR = "TemporaryDir/" \ No newline at end of file