From a56734ed93c8bd307f4be0eaa2264c2a6b4e19ac Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Mon, 13 Jun 2022 23:33:09 +0300 Subject: [PATCH] part of [#194] Signed-off-by: anastasia prasolova --- .../empty_passwd.yml | 0 neofs_cli_configs/ir_wallet_passwd.yml | 1 + neofs_cli_configs/mainnet_wallet_passwd.yml | 1 + robot/resources/lib/python_keywords/acl.py | 8 +- .../lib/python_keywords/cli_keywords.py | 24 ---- .../python_keywords/complex_object_actions.py | 11 +- .../lib/python_keywords/container.py | 17 +-- .../lib/python_keywords/neofs_verbs.py | 39 +++--- .../lib/python_keywords/payment_neogo.py | 125 ++++++++++++------ .../lib/python_keywords/session_token.py | 11 +- .../lib/python_keywords/storage_group.py | 30 +++-- .../lib/robot/complex_object_operations.robot | 5 +- .../lib/robot/payment_operations.robot | 32 ++--- robot/resources/lib/robot/storage.robot | 2 +- robot/resources/lib/robot/storage_group.robot | 24 ++-- .../acl/acl_basic_private_container.robot | 63 +++++---- .../acl/acl_basic_public_container.robot | 47 ++++--- .../acl/acl_basic_readonly_container.robot | 56 ++++---- .../integration/acl/acl_bearer_compound.robot | 35 ++--- .../acl/acl_extended_actions_pubkey.robot | 13 +- .../acl/acl_extended_actions_system.robot | 91 +++++++------ .../acl/acl_extended_compound.robot | 37 +++--- .../basic_private_container_sg.robot | 27 ++-- .../basic_readonly_container_sg.robot | 33 ++--- .../integration/cli/accounting/balance.robot | 6 +- .../cli/netmap/networkinfo_rpc_method.robot | 54 ++++---- .../integration/network/netmap_control.robot | 16 +-- .../payment/emission_threshold.robot | 17 +-- .../integration/payment/withdraw.robot | 36 ++--- robot/variables/common.py | 19 +-- 30 files changed, 468 insertions(+), 412 deletions(-) rename wallet_pass.yml => neofs_cli_configs/empty_passwd.yml (100%) create mode 100644 neofs_cli_configs/ir_wallet_passwd.yml create mode 100644 neofs_cli_configs/mainnet_wallet_passwd.yml delete mode 100644 robot/resources/lib/python_keywords/cli_keywords.py diff --git a/wallet_pass.yml b/neofs_cli_configs/empty_passwd.yml similarity index 100% rename from wallet_pass.yml rename to neofs_cli_configs/empty_passwd.yml diff --git a/neofs_cli_configs/ir_wallet_passwd.yml b/neofs_cli_configs/ir_wallet_passwd.yml new file mode 100644 index 00000000..4f408f80 --- /dev/null +++ b/neofs_cli_configs/ir_wallet_passwd.yml @@ -0,0 +1 @@ +password: "one" diff --git a/neofs_cli_configs/mainnet_wallet_passwd.yml b/neofs_cli_configs/mainnet_wallet_passwd.yml new file mode 100644 index 00000000..4f408f80 --- /dev/null +++ b/neofs_cli_configs/mainnet_wallet_passwd.yml @@ -0,0 +1 @@ +password: "one" diff --git a/robot/resources/lib/python_keywords/acl.py b/robot/resources/lib/python_keywords/acl.py index a26b362d..db32e133 100644 --- a/robot/resources/lib/python_keywords/acl.py +++ b/robot/resources/lib/python_keywords/acl.py @@ -9,7 +9,7 @@ from enum import Enum, auto import base58 from cli_helpers import _cmd_run -from common import ASSETS_DIR, NEOFS_ENDPOINT, WALLET_PASS +from common import ASSETS_DIR, NEOFS_ENDPOINT, WALLET_CONFIG from robot.api import logger from robot.api.deco import keyword @@ -39,7 +39,7 @@ class Role(AutoName): def get_eacl(wallet: str, cid: str): cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'container get-eacl --cid {cid} --config {WALLET_PASS}' + f'container get-eacl --cid {cid} --config {WALLET_CONFIG}' ) try: output = _cmd_run(cmd) @@ -56,7 +56,7 @@ def get_eacl(wallet: str, cid: str): def set_eacl(wallet: str, cid: str, eacl_table_path: str): cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'container set-eacl --cid {cid} --table {eacl_table_path} --config {WALLET_PASS} --await' + f'container set-eacl --cid {cid} --table {eacl_table_path} --config {WALLET_CONFIG} --await' ) _cmd_run(cmd) @@ -163,6 +163,6 @@ def form_bearertoken_file(wif: str, cid: str, eacl_records: list) -> str: def sign_bearer_token(wallet: str, eacl_rules_file: str): cmd = ( f'{NEOFS_CLI_EXEC} util sign bearer-token --from {eacl_rules_file} ' - f'--to {eacl_rules_file} --wallet {wallet} --config {WALLET_PASS} --json' + f'--to {eacl_rules_file} --wallet {wallet} --config {WALLET_CONFIG} --json' ) _cmd_run(cmd) diff --git a/robot/resources/lib/python_keywords/cli_keywords.py b/robot/resources/lib/python_keywords/cli_keywords.py deleted file mode 100644 index 201261e3..00000000 --- a/robot/resources/lib/python_keywords/cli_keywords.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python3.8 - -import pexpect - -from robot.api.deco import keyword - -ROBOT_AUTO_KEYWORDS = False - - -@keyword('Run Process And Enter Empty Password') -def run_proccess_and_interact(cmd: str) -> str: - p = pexpect.spawn(cmd) - p.expect("[pP]assword") - # enter empty password - p.sendline('\r') - p.wait() - # throw a string with password prompt - first = p.readline() - # take all output - child_output = p.readline() - p.close() - if p.exitstatus != 0: - raise Exception(f"{first}\n{child_output}") - return child_output diff --git a/robot/resources/lib/python_keywords/complex_object_actions.py b/robot/resources/lib/python_keywords/complex_object_actions.py index 97dbfbe5..f04e752a 100644 --- a/robot/resources/lib/python_keywords/complex_object_actions.py +++ b/robot/resources/lib/python_keywords/complex_object_actions.py @@ -10,6 +10,9 @@ first non-null response. """ +from common import NEOFS_NETMAP, WALLET_CONFIG +import neofs_verbs + from robot.api import logger from robot.api.deco import keyword from robot.libraries.BuiltIn import BuiltIn @@ -21,7 +24,9 @@ ROBOT_AUTO_KEYWORDS = False @keyword('Get Link Object') -def get_link_object(wallet: str, cid: str, oid: str, bearer_token: str = ""): +<<<<<<< HEAD +def get_link_object(wallet: str, cid: str, oid: str, bearer_token: str = "", + wallet_config: str = WALLET_CONFIG): """ Args: wallet (str): path to the wallet on whose behalf the Storage Nodes @@ -29,6 +34,7 @@ def get_link_object(wallet: str, cid: str, oid: str, bearer_token: str = ""): cid (str): Container ID which stores the Large Object oid (str): Large Object ID bearer_token (optional, str): path to Bearer token file + wallet_config (optional, str): path to the neofs-cli config file Returns: (str): Link Object ID When no Link Object ID is found after all Storage Nodes polling, @@ -40,7 +46,8 @@ def get_link_object(wallet: str, cid: str, oid: str, bearer_token: str = ""): endpoint=node, is_raw=True, is_direct=True, - bearer_token=bearer_token) + bearer_token=bearer_token, + wallet_config=wallet_config) if resp['link']: return resp['link'] except Exception: diff --git a/robot/resources/lib/python_keywords/container.py b/robot/resources/lib/python_keywords/container.py index 3dedea85..76139045 100644 --- a/robot/resources/lib/python_keywords/container.py +++ b/robot/resources/lib/python_keywords/container.py @@ -8,13 +8,14 @@ import json import time +from common import NEOFS_ENDPOINT, COMMON_PLACEMENT_RULE, NEOFS_CLI_EXEC, WALLET_CONFIG +from cli_helpers import _cmd_run +from data_formatters import dict_to_attrs +import json_transformers + from robot.api import logger from robot.api.deco import keyword -import json_transformers -from cli_helpers import _cmd_run -from common import NEOFS_ENDPOINT, COMMON_PLACEMENT_RULE, NEOFS_CLI_EXEC, WALLET_PASS -from data_formatters import dict_to_attrs ROBOT_AUTO_KEYWORDS = False @@ -46,7 +47,7 @@ def create_container(wallet: str, rule: str = COMMON_PLACEMENT_RULE, basic_acl: cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} container create ' f'--wallet {session_wallet if session_wallet else wallet} ' - f'--config {WALLET_PASS} --policy "{rule}" ' + f'--config {WALLET_CONFIG} --policy "{rule}" ' f'{"--basic-acl " + basic_acl if basic_acl else ""} ' f'{"--attributes " + dict_to_attrs(attributes) if attributes else ""} ' f'{"--session " + session_token if session_token else ""} ' @@ -84,7 +85,7 @@ def list_containers(wallet: str): """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'--config {WALLET_PASS} container list' + f'--config {WALLET_CONFIG} container list' ) output = _cmd_run(cmd) return output.split() @@ -103,7 +104,7 @@ def get_container(wallet: str, cid: str): """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'--config {WALLET_PASS} --cid {cid} container get --json' + f'--config {WALLET_CONFIG} --cid {cid} container get --json' ) output = _cmd_run(cmd) container_info = json.loads(output) @@ -130,7 +131,7 @@ def delete_container(wallet: str, cid: str): cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'--config {WALLET_PASS} container delete --cid {cid}' + f'--config {WALLET_CONFIG} container delete --cid {cid}' ) _cmd_run(cmd) diff --git a/robot/resources/lib/python_keywords/neofs_verbs.py b/robot/resources/lib/python_keywords/neofs_verbs.py index 75348899..587b8e67 100644 --- a/robot/resources/lib/python_keywords/neofs_verbs.py +++ b/robot/resources/lib/python_keywords/neofs_verbs.py @@ -13,9 +13,9 @@ import uuid from robot.api import logger from robot.api.deco import keyword +from common import NEOFS_ENDPOINT, ASSETS_DIR, NEOFS_NETMAP, WALLET_CONFIG import json_transformers from cli_helpers import _cmd_run -from common import NEOFS_ENDPOINT, ASSETS_DIR, NEOFS_NETMAP, WALLET_PASS from data_formatters import dict_to_attrs ROBOT_AUTO_KEYWORDS = False @@ -26,7 +26,8 @@ NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli') @keyword('Get object') def get_object(wallet: str, cid: str, oid: str, bearer_token: str = "", - write_object: str = "", endpoint: str = "", options: str = ""): + write_object: str = "", endpoint: str = "", options: str = "", + wallet_config: str = WALLET_CONFIG): """ GET from NeoFS. @@ -37,6 +38,7 @@ def get_object(wallet: str, cid: str, oid: str, bearer_token: str = "", bearer_token (optional, str): path to Bearer Token file, appends to `--bearer` key write_object (optional, str): path to downloaded file, appends to `--file` key endpoint (optional, str): NeoFS endpoint to send request to, appends to `--rpc-endpoint` key + wallet_config(optional, str): path to the wallet config options (optional, str): any options which `neofs-cli object get` accepts Returns: (str): path to downloaded file @@ -51,7 +53,7 @@ def get_object(wallet: str, cid: str, oid: str, bearer_token: str = "", cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --wallet {wallet} ' - f'object get --cid {cid} --oid {oid} --file {file_path} --config {WALLET_PASS} ' + f'object get --cid {cid} --oid {oid} --file {file_path} --config {wallet_config} ' f'{"--bearer " + bearer_token if bearer_token else ""} ' f'{options}' ) @@ -62,7 +64,7 @@ def get_object(wallet: str, cid: str, oid: str, bearer_token: str = "", # TODO: make `bearer_token` optional @keyword('Get Range Hash') def get_range_hash(wallet: str, cid: str, oid: str, bearer_token: str, range_cut: str, - options: str = ""): + wallet_config: str = WALLET_CONFIG, options: str = ""): """ GETRANGEHASH of given Object. @@ -73,13 +75,14 @@ def get_range_hash(wallet: str, cid: str, oid: str, bearer_token: str, range_cut range_cut (str): Range to take hash from in the form offset1:length1,..., value to pass to the `--range` parameter bearer_token (optional, str): path to Bearer Token file, appends to `--bearer` key + wallet_config(optional, str): path to the wallet config options (optional, str): any options which `neofs-cli object hash` accepts Returns: None """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'object hash --cid {cid} --oid {oid} --range {range_cut} --config {WALLET_PASS} ' + f'object hash --cid {cid} --oid {oid} --range {range_cut} --config {wallet_config} ' f'{"--bearer " + bearer_token if bearer_token else ""} ' f'{options}' ) @@ -90,7 +93,7 @@ def get_range_hash(wallet: str, cid: str, oid: str, bearer_token: str, range_cut @keyword('Put object') def put_object(wallet: str, path: str, cid: str, bearer: str = "", user_headers: dict = {}, - endpoint: str = "", options: str = ""): + endpoint: str = "", wallet_config: str = WALLET_CONFIG, options: str = ""): """ PUT of given file. @@ -101,6 +104,7 @@ def put_object(wallet: str, path: str, cid: str, bearer: str = "", user_headers: bearer (optional, str): path to Bearer Token file, appends to `--bearer` key user_headers (optional, dict): Object attributes, append to `--attributes` key endpoint(optional, str): NeoFS endpoint to send request to + wallet_config(optional, str): path to the wallet config options (optional, str): any options which `neofs-cli object put` accepts Returns: (str): ID of uploaded Object @@ -109,7 +113,7 @@ def put_object(wallet: str, path: str, cid: str, bearer: str = "", user_headers: endpoint = random.sample(NEOFS_NETMAP, 1)[0] cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --wallet {wallet} ' - f'object put --file {path} --cid {cid} {options} --config {WALLET_PASS} ' + f'object put --file {path} --cid {cid} {options} --config {wallet_config} ' f'{"--bearer " + bearer if bearer else ""} ' f'{"--attributes " + dict_to_attrs(user_headers) if user_headers else ""}' ) @@ -121,7 +125,8 @@ def put_object(wallet: str, path: str, cid: str, bearer: str = "", user_headers: @keyword('Delete object') -def delete_object(wallet: str, cid: str, oid: str, bearer: str = "", options: str = ""): +def delete_object(wallet: str, cid: str, oid: str, bearer: str = "", wallet_config: str = WALLET_CONFIG, + options: str = ""): """ DELETE an Object. @@ -130,13 +135,14 @@ def delete_object(wallet: str, cid: str, oid: str, bearer: str = "", options: st cid (str): ID of Container where we get the Object from oid (str): ID of Object we are going to delete bearer (optional, str): path to Bearer Token file, appends to `--bearer` key + wallet_config(optional, str): path to the wallet config options (optional, str): any options which `neofs-cli object delete` accepts Returns: (str): Tombstone ID """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'object delete --cid {cid} --oid {oid} {options} --config {WALLET_PASS} ' + f'object delete --cid {cid} --oid {oid} {options} --config {wallet_config} ' f'{"--bearer " + bearer if bearer else ""}' ) output = _cmd_run(cmd) @@ -149,7 +155,7 @@ def delete_object(wallet: str, cid: str, oid: str, bearer: str = "", options: st # TODO: make `bearer` an optional parameter @keyword('Get Range') def get_range(wallet: str, cid: str, oid: str, file_path: str, bearer: str, range_cut: str, - options: str = ""): + wallet_config: str = WALLET_CONFIG, options: str = ""): """ GETRANGE an Object. @@ -160,6 +166,7 @@ def get_range(wallet: str, cid: str, oid: str, file_path: str, bearer: str, rang file_path (str): file path range_cut (str): range to take data from in the form offset:length bearer (optional, str): path to Bearer Token file, appends to `--bearer` key + wallet_config(optional, str): path to the wallet config options (optional, str): any options which `neofs-cli object range` accepts Returns: (void) @@ -167,7 +174,7 @@ def get_range(wallet: str, cid: str, oid: str, file_path: str, bearer: str, rang range_file = f"{ASSETS_DIR}/{uuid.uuid4()}" cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'object range --cid {cid} --oid {oid} --range {range_cut} --config {WALLET_PASS} ' + f'object range --cid {cid} --oid {oid} --range {range_cut} --config {wallet_config} ' f'{options} --file {range_file} ' f'{"--bearer " + bearer if bearer else ""} ' ) @@ -180,7 +187,7 @@ def get_range(wallet: str, cid: str, oid: str, file_path: str, bearer: str, rang @keyword('Search object') def search_object(wallet: str, cid: str, keys: str = "", bearer: str = "", filters: dict = {}, - expected_objects_list=[]): + expected_objects_list=[], wallet_config: str = WALLET_CONFIG): """ SEARCH an Object. @@ -192,6 +199,7 @@ def search_object(wallet: str, cid: str, keys: str = "", bearer: str = "", filte bearer (optional, str): path to Bearer Token file, appends to `--bearer` key filters (optional, dict): key=value pairs to filter Objects expected_objects_list (optional, list): a list of ObjectIDs to compare found Objects with + wallet_config(optional, str): path to the wallet config Returns: (list): list of found ObjectIDs """ @@ -203,7 +211,7 @@ def search_object(wallet: str, cid: str, keys: str = "", bearer: str = "", filte cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {wallet} ' - f'object search {keys} --cid {cid} {filters_result} --config {WALLET_PASS} ' + f'object search {keys} --cid {cid} {filters_result} --config {wallet_config} ' f'{"--bearer " + bearer if bearer else ""}' ) output = _cmd_run(cmd) @@ -224,7 +232,7 @@ def search_object(wallet: str, cid: str, keys: str = "", bearer: str = "", filte @keyword('Head object') def head_object(wallet: str, cid: str, oid: str, bearer_token: str = "", options: str = "", endpoint: str = "", json_output: bool = True, - is_raw: bool = False, is_direct: bool = False): + is_raw: bool = False, is_direct: bool = False, wallet_config: str = WALLET_CONFIG): """ HEAD an Object. @@ -241,6 +249,7 @@ def head_object(wallet: str, cid: str, oid: str, bearer_token: str = "", turns into `--raw` key is_direct(optional, bool): send request directly to the node or not; this flag turns into `--ttl 1` key + wallet_config(optional, str): path to the wallet config Returns: depending on the `json_output` parameter value, the function returns (dict): HEAD response in JSON format @@ -249,7 +258,7 @@ def head_object(wallet: str, cid: str, oid: str, bearer_token: str = "", """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint if endpoint else NEOFS_ENDPOINT} ' - f'--wallet {wallet} --config {WALLET_PASS} ' + f'--wallet {wallet} --config {wallet_config} ' f'object head --cid {cid} --oid {oid} {options} ' f'{"--bearer " + bearer_token if bearer_token else ""} ' f'{"--json" if json_output else ""} ' diff --git a/robot/resources/lib/python_keywords/payment_neogo.py b/robot/resources/lib/python_keywords/payment_neogo.py index 41ab5a0f..0f91bd07 100644 --- a/robot/resources/lib/python_keywords/payment_neogo.py +++ b/robot/resources/lib/python_keywords/payment_neogo.py @@ -1,29 +1,39 @@ #!/usr/bin/python3 import re +import time -import pexpect -from neo3 import wallet -from robot.api import logger -from robot.api.deco import keyword - -import contract +from common import (MAINNET_WALLET_PATH, MORPH_ENDPOINT, + NEO_MAINNET_ENDPOINT, NEOFS_CONTRACT, MAINNET_SINGLE_ADDR) import rpc_client -from common import * +import contract +import converters +import wallet from wrappers import run_sh_with_passwd_contract +from converters import load_wallet + +from robot.api.deco import keyword +from robot.api import logger +from robot.libraries.BuiltIn import BuiltIn + ROBOT_AUTO_KEYWORDS = False MORPH_TOKEN_POWER = 12 +EMPTY_PASSWORD = '' +MAINNET_WALLET_PASS = 'one' +TX_PERSIST_TIMEOUT = 15 #seconds -morph_rpc_cli = rpc_client.RPCClient(NEOFS_NEO_API_ENDPOINT) +NEOGO_CLI_EXEC = BuiltIn().get_variable_value("${NEOGO_CLI_EXEC}") + +morph_rpc_cli = rpc_client.RPCClient(MORPH_ENDPOINT) mainnet_rpc_cli = rpc_client.RPCClient(NEO_MAINNET_ENDPOINT) @keyword('Withdraw Mainnet Gas') -def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int): +def withdraw_mainnet_gas(wlt: str, address: str, scripthash: str, amount: int): cmd = ( - f"{NEOGO_CLI_EXEC} contract invokefunction -w {wallet} -a {address} " + f"{NEOGO_CLI_EXEC} contract invokefunction -w {wlt} -a {address} " f"-r {NEO_MAINNET_ENDPOINT} {NEOFS_CONTRACT} withdraw {scripthash} " f"int:{amount} -- {scripthash}:Global" ) @@ -35,34 +45,39 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int if m is None: raise Exception("Can not get Tx.") tx = m.group(1) - return tx + if not transaction_accepted(tx): + raise RuntimeError(f"TX {tx} hasn't been processed") -@keyword('Transaction accepted in block') -def transaction_accepted_in_block(tx_id: str): +def transaction_accepted(tx_id: str): """ - This function return True in case of accepted TX. - Parameters: - :param tx_id: transaction ID + This function returns True in case of accepted TX. + Args: + tx_id(str): transaction ID + Returns: + (bool) """ try: - resp = mainnet_rpc_cli.get_transaction_height(tx_id) - if resp is not None: - logger.info(f"got block height: {resp}") - return True + for _ in range(0, TX_PERSIST_TIMEOUT): + time.sleep(1) + resp = mainnet_rpc_cli.get_transaction_height(tx_id) + if resp is not None: + logger.info(f"TX is accepted in block: {resp}") + return True except Exception as e: logger.info(f"request failed with error: {e}") raise e + return False @keyword('Get NeoFS Balance') -def get_balance(wif: str): +def get_balance(wallet_path: str): """ - This function returns NeoFS balance for given WIF. + This function returns NeoFS balance for given wallet. """ - - acc = wallet.Account.from_wif(wif, '') + wlt = load_wallet(wallet_path) + acc = wlt.accounts[-1] payload = [ { 'type': 'Hash160', @@ -71,24 +86,56 @@ def get_balance(wif: str): ] try: resp = morph_rpc_cli.invoke_function( - contract.get_balance_contract_hash(NEOFS_NEO_API_ENDPOINT), - 'balanceOf', - payload - ) - logger.info(resp) + contract.get_balance_contract_hash(MORPH_ENDPOINT), + 'balanceOf', + payload + ) + logger.info(f"Got response \n{resp}") value = int(resp['stack'][0]['value']) return value / (10 ** MORPH_TOKEN_POWER) except Exception as e: - logger.error(f"failed to get {wif} balance: {e}") + logger.error(f"failed to get wallet balance: {e}") raise e -def _run_sh_with_passwd(passwd, cmd): - p = pexpect.spawn(cmd) - p.expect(".*") - p.sendline(passwd + '\r') - p.wait() - # throw a string with password prompt - # take a string with tx hash - tx_hash = p.read().splitlines()[-1] - return tx_hash.decode() +@keyword('Transfer Mainnet Gas') +def transfer_mainnet_gas(wallet_to: str, amount: int, wallet_password: str = EMPTY_PASSWORD): + ''' + This function transfer GAS in main chain from mainnet wallet to + the provided wallet. If the wallet contains more than one address, + the assets will be transferred to the last one. + Args: + wallet_to (str): the path to the wallet to transfer assets to + amount (int): amount of gas to transfer + wallet_password (optional, str): password of the wallet; it is + required to decode the wallet and extract its addresses + Returns: + (void) + ''' + wlt = load_wallet(wallet_to, wallet_password) + address_to = wlt.accounts[-1].address + logger.info(f"got address to: {address_to}") + + txid = wallet.nep17_transfer(MAINNET_WALLET_PATH, address_to, amount, NEO_MAINNET_ENDPOINT, + wallet_pass=MAINNET_WALLET_PASS, addr_from=MAINNET_SINGLE_ADDR) + if not transaction_accepted(txid): + raise RuntimeError(f"TX {txid} hasn't been processed") + + +@keyword('NeoFS Deposit') +def neofs_deposit(wallet_to: str, amount: int, wallet_password: str = EMPTY_PASSWORD): + """ + Transferring GAS from given wallet to NeoFS contract address. + """ + # get NeoFS contract address + deposit_addr = converters.contract_hash_to_address(NEOFS_CONTRACT) + logger.info(f"NeoFS contract address: {deposit_addr}") + + wlt = load_wallet(wallet_to, wallet_password) + address_to = wlt.accounts[-1].address + logger.info(f"got address to: {address_to}") + + txid = wallet.nep17_transfer(wallet_to, deposit_addr, amount, NEO_MAINNET_ENDPOINT, + wallet_pass=wallet_password, addr_from=address_to) + if not transaction_accepted(txid): + raise RuntimeError(f"TX {txid} hasn't been processed") diff --git a/robot/resources/lib/python_keywords/session_token.py b/robot/resources/lib/python_keywords/session_token.py index 9ac2c483..e2e50a7c 100644 --- a/robot/resources/lib/python_keywords/session_token.py +++ b/robot/resources/lib/python_keywords/session_token.py @@ -10,13 +10,14 @@ import os import uuid from neo3 import wallet +from common import WALLET_CONFIG, ASSETS_DIR +from cli_helpers import _cmd_run +import json_transformers + +from robot.api.deco import keyword from robot.api import logger from robot.api.deco import keyword -import json_transformers -from cli_helpers import _cmd_run -from common import WALLET_PASS, ASSETS_DIR - ROBOT_AUTO_KEYWORDS = False # path to neofs-cli executable @@ -95,7 +96,7 @@ def sign_session_token(session_token: str, wlt: str): signed_token = f"{os.getcwd()}/{ASSETS_DIR}/{uuid.uuid4()}" cmd = ( f'{NEOFS_CLI_EXEC} util sign session-token --from {session_token} ' - f'-w {wlt} --to {signed_token} --config {WALLET_PASS}' + f'-w {wlt} --to {signed_token} --config {WALLET_CONFIG}' ) _cmd_run(cmd) return signed_token diff --git a/robot/resources/lib/python_keywords/storage_group.py b/robot/resources/lib/python_keywords/storage_group.py index 4a079c30..0706ac70 100644 --- a/robot/resources/lib/python_keywords/storage_group.py +++ b/robot/resources/lib/python_keywords/storage_group.py @@ -5,16 +5,17 @@ It contains wrappers for `neofs-cli storagegroup` verbs. """ -from robot.api.deco import keyword - from cli_helpers import _cmd_run -from common import NEOFS_CLI_EXEC, NEOFS_ENDPOINT, WALLET_PASS +from common import NEOFS_CLI_EXEC, NEOFS_ENDPOINT, WALLET_CONFIG + +from robot.api.deco import keyword ROBOT_AUTO_KEYWORDS = False @keyword('Put Storagegroup') -def put_storagegroup(wallet: str, cid: str, objects: list, bearer_token: str = ""): +def put_storagegroup(wallet: str, cid: str, objects: list, bearer_token: str = "", + wallet_config: str = WALLET_CONFIG): """ Wrapper for `neofs-cli storagegroup put`. Before the SG is created, neofs-cli performs HEAD on `objects`, so this verb must be allowed @@ -24,12 +25,13 @@ def put_storagegroup(wallet: str, cid: str, objects: list, bearer_token: str = " cid (str): ID of Container to put SG to objects (list): list of Object IDs to include into the SG bearer_token (optional, str): path to Bearer token file + wallet_config (optional, str): path to neofs-cli config file Returns: (str): Object ID of created Storage Group """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} ' - f'--wallet {wallet} --config {WALLET_PASS} ' + f'--wallet {wallet} --config {wallet_config} ' f'storagegroup put --cid {cid} ' f'--members {",".join(objects)} ' f'{"--bearer " + bearer_token if bearer_token else ""}' @@ -40,7 +42,8 @@ def put_storagegroup(wallet: str, cid: str, objects: list, bearer_token: str = " @keyword('List Storagegroup') -def list_storagegroup(wallet: str, cid: str, bearer_token: str = ""): +def list_storagegroup(wallet: str, cid: str, bearer_token: str = "", + wallet_config: str = WALLET_CONFIG): """ Wrapper for `neofs-cli storagegroup list`. This operation requires SEARCH allowed for `wallet` in `cid`. @@ -49,12 +52,13 @@ def list_storagegroup(wallet: str, cid: str, bearer_token: str = ""): listed in the container cid (str): ID of Container to list bearer_token (optional, str): path to Bearer token file + wallet_config (optional, str): path to neofs-cli config file Returns: (list): Object IDs of found Storage Groups """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} ' - f'--wallet {wallet} --config {WALLET_PASS} storagegroup list ' + f'--wallet {wallet} --config {wallet_config} storagegroup list ' f'--cid {cid} {"--bearer " + bearer_token if bearer_token else ""}' ) output = _cmd_run(cmd) @@ -64,7 +68,8 @@ def list_storagegroup(wallet: str, cid: str, bearer_token: str = ""): @keyword('Get Storagegroup') -def get_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = ''): +def get_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = '', + wallet_config: str = WALLET_CONFIG): """ Wrapper for `neofs-cli storagegroup get`. Args: @@ -72,13 +77,14 @@ def get_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = ''): cid (str): ID of Container where SG is stored oid (str): ID of the Storage Group bearer_token (optional, str): path to Bearer token file + wallet_config (optional, str): path to neofs-cli config file Returns: (dict): detailed information on the Storage Group """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} ' - f'--wallet {wallet} --config {WALLET_PASS} ' + f'--wallet {wallet} --config {wallet_config} ' f'storagegroup get --cid {cid} --id {oid} ' f'{"--bearer " + bearer_token if bearer_token else ""}' ) @@ -103,7 +109,8 @@ def get_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = ''): @keyword('Delete Storagegroup') -def delete_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = ""): +def delete_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = "", + wallet_config: str = WALLET_CONFIG): """ Wrapper for `neofs-cli storagegroup delete`. Args: @@ -111,13 +118,14 @@ def delete_storagegroup(wallet: str, cid: str, oid: str, bearer_token: str = "") cid (str): ID of Container where SG is stored oid (str): ID of the Storage Group bearer_token (optional, str): path to Bearer token file + wallet_config (optional, str): path to neofs-cli config file Returns: (str): Tombstone ID of the deleted Storage Group """ cmd = ( f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} ' - f'--wallet {wallet} --config {WALLET_PASS} ' + f'--wallet {wallet} --config {wallet_config} ' f'storagegroup delete --cid {cid} --id {oid} ' f'{"--bearer " + bearer_token if bearer_token else ""}' ) diff --git a/robot/resources/lib/robot/complex_object_operations.robot b/robot/resources/lib/robot/complex_object_operations.robot index ee7ced25..a52dab69 100644 --- a/robot/resources/lib/robot/complex_object_operations.robot +++ b/robot/resources/lib/robot/complex_object_operations.robot @@ -11,12 +11,13 @@ Get Object Parts By Link Object [Documentation] The keyword accepts the ID of a Large Object, retrieves its split ... header and returns all Part Object IDs from Link Object. - [Arguments] ${WALLET} ${CID} ${LARGE_OID} ${BEARER}=${EMPTY} - + [Arguments] ${WALLET} ${CID} ${LARGE_OID} ${BEARER}=${EMPTY} ${WALLET_CFG}=${WALLET_CONFIG} ${LINK_OID} = Get Link Object ${WALLET} ${CID} ${LARGE_OID} ... bearer_token=${BEARER} + ... wallet_config=${WALLET_CFG} &{LINK_HEADER} = Head Object ${WALLET} ${CID} ${LINK_OID} ... is_raw=True bearer_token=${BEARER} + ... wallet_config=${WALLET_CFG} [Return] ${LINK_HEADER.header.split.children} diff --git a/robot/resources/lib/robot/payment_operations.robot b/robot/resources/lib/robot/payment_operations.robot index 50f15c4e..d056d7b5 100644 --- a/robot/resources/lib/robot/payment_operations.robot +++ b/robot/resources/lib/robot/payment_operations.robot @@ -10,33 +10,25 @@ Library payment_neogo.py Prepare Wallet And Deposit [Arguments] ${DEPOSIT}=${30} - - Log Deposit equals ${DEPOSIT} - ${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR} - ${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${DEPOSIT+1} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX} - ${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX_DEPOSIT} + ${WALLET} + ... ${ADDR} + ... ${WIF} = Init Wallet with Address ${ASSETS_DIR} + Transfer Mainnet Gas ${WALLET} ${DEPOSIT+1} + NeoFS Deposit ${WALLET} ${DEPOSIT} # Now we have TX in main chain, but deposit might not propagate into the side chain yet. # For certainty, sleeping during one morph block. - Sleep ${MORPH_BLOCK_TIME} + Sleep ${MORPH_BLOCK_TIME} [Return] ${WALLET} ${ADDR} ${WIF} Prepare Wallet with WIF And Deposit - [Arguments] ${WIF} ${DEPOSIT}=${30} + [Arguments] ${WIF} ${DEPOSIT}=${30} - ${WALLET} ${ADDR} = Init Wallet from WIF ${ASSETS_DIR} ${WIF} - ${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${DEPOSIT+1} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX} - - ${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX_DEPOSIT} - Sleep ${MORPH_BLOCK_TIME} + ${WALLET} + ... ${ADDR} = Init Wallet from WIF ${ASSETS_DIR} ${WIF} + Transfer Mainnet Gas ${WALLET} ${DEPOSIT+1} + NeoFS Deposit ${WALLET} ${DEPOSIT} + Sleep ${MORPH_BLOCK_TIME} [Return] ${WALLET} ${ADDR} diff --git a/robot/resources/lib/robot/storage.robot b/robot/resources/lib/robot/storage.robot index 04574b20..65eb8d2c 100644 --- a/robot/resources/lib/robot/storage.robot +++ b/robot/resources/lib/robot/storage.robot @@ -10,7 +10,7 @@ Library Process Drop object [Arguments] ${NODE} ${WALLET_STORAGE} ${CID} ${OID} - ${DROP_SIMPLE} = Run Process ${NEOFS_CLI_EXEC} control drop-objects --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} -o ${CID}/${OID} + ${DROP_SIMPLE} = Run Process ${NEOFS_CLI_EXEC} control drop-objects --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} -o ${CID}/${OID} ... shell=True Log Many stdout: ${DROP_SIMPLE.stdout} stderr: ${DROP_SIMPLE.stderr} Should Be Equal As Integers ${DROP_SIMPLE.rc} 0 Got non-zero return code from CLI diff --git a/robot/resources/lib/robot/storage_group.robot b/robot/resources/lib/robot/storage_group.robot index 614527ed..1a1ff63c 100644 --- a/robot/resources/lib/robot/storage_group.robot +++ b/robot/resources/lib/robot/storage_group.robot @@ -5,10 +5,10 @@ Library storage_group.py Library Collections Resource complex_object_operations.robot -Resource payment_operations.robot *** Variables *** ${PERMISSION_ERROR} = status: code = 2048 message = access to object operation denied +${DEPOSIT} = ${30} *** Keywords *** @@ -85,40 +85,40 @@ Run Storage Group Operations On System's Behalf In RO Container ... and include an Object created on behalf of some user. We expect ... that System key is granted to make all operations except DELETE. - # TODO: get rid of WIF and remove `payment_operations.robot` import - ${IR_WALLET} ${_} = Prepare Wallet With WIF And Deposit ${NEOFS_IR_WIF} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} - ${SG} = Put Storagegroup ${IR_WALLET} ${CID} ${OBJECTS} - Verify List Storage Group ${IR_WALLET} ${CID} ${SG} - Verify Get Storage Group ${IR_WALLET} ${CID} ${SG} ${OBJECTS} ${OBJ_COMPLEXITY} + ${SG} = Put Storagegroup ${IR_WALLET_PATH} ${CID} ${OBJECTS} wallet_config=${IR_WALLET_CONFIG} + Verify List Storage Group ${IR_WALLET_PATH} ${CID} ${SG} WALLET_CFG=${IR_WALLET_CONFIG} + Verify Get Storage Group ${IR_WALLET_PATH} ${CID} ${SG} ${OBJECTS} ${OBJ_COMPLEXITY} WALLET_CFG=${IR_WALLET_CONFIG} ${ERR} = Run Keyword And Expect Error * - ... Delete Storagegroup ${IR_WALLET} ${CID} ${SG} + ... Delete Storagegroup ${IR_WALLET_PATH} ${CID} ${SG} wallet_config=${IR_WALLET_CONFIG} Should Contain ${ERR} ${PERMISSION_ERROR} Verify List Storage Group - [Arguments] ${WALLET} ${CID} ${SG} ${BEARER}=${EMPTY} + [Arguments] ${WALLET} ${CID} ${SG} ${BEARER}=${EMPTY} ${WALLET_CFG}=${WALLET_CONFIG} - @{STORAGE_GROUPS} = List Storagegroup ${WALLET} ${CID} bearer_token=${BEARER} + @{STORAGE_GROUPS} = List Storagegroup ${WALLET} ${CID} bearer_token=${BEARER} wallet_config=${WALLET_CFG} List Should Contain Value ${STORAGE_GROUPS} ${SG} ... msg="Storage Group hasn't been persisted" Verify Get Storage Group - [Arguments] ${WALLET} ${CID} ${SG} ${OBJECTS} ${OBJ_COMPLEXITY} ${BEARER}=${EMPTY} + [Arguments] ${WALLET} ${CID} ${SG} ${OBJECTS} ${OBJ_COMPLEXITY} ${BEARER}=${EMPTY} ${WALLET_CFG}=${WALLET_CONFIG} @{PART_OIDS} = Create List IF """${OBJ_COMPLEXITY}""" == """Complex""" FOR ${OBJ} IN @{OBJECTS} ${OIDS} = Get Object Parts By Link Object - ... ${WALLET} ${CID} ${OBJ} ${BEARER} + ... ${WALLET} ${CID} ${OBJ} BEARER=${BEARER} WALLET_CFG=${WALLET_CFG} @{PART_OIDS} = Combine Lists ${PART_OIDS} ${OIDS} END END ${OBJECTS_NUMBER} = Get Length ${OBJECTS} - &{SG_DATA} = Get Storagegroup ${WALLET} ${CID} ${SG} bearer_token=${BEARER} + &{SG_DATA} = Get Storagegroup ${WALLET} ${CID} ${SG} bearer_token=${BEARER} wallet_config=${WALLET_CFG} IF """${OBJ_COMPLEXITY}""" == """Simple""" ${EXPECTED_SIZE} = Evaluate ${SIMPLE_OBJ_SIZE} * ${OBJECTS_NUMBER} diff --git a/robot/testsuites/integration/acl/acl_basic_private_container.robot b/robot/testsuites/integration/acl/acl_basic_private_container.robot index 39a6e224..1b3bbee6 100644 --- a/robot/testsuites/integration/acl/acl_basic_private_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_private_container.robot @@ -8,6 +8,8 @@ Library utility_keywords.py Resource payment_operations.robot Resource setup_teardown.robot +*** Variables *** +${DEPOSIT} = ${30} *** Test cases *** Basic ACL Operations for Private Container @@ -17,16 +19,9 @@ Basic ACL Operations for Private Container [Setup] Setup - ${WALLET} ${_} ${_} = Prepare Wallet And Deposit - ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit - ${PRIV_CID} = Create Container ${WALLET} - ${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE} - Check Private Container ${WALLET} ${FILE_S} ${PRIV_CID} ${WALLET_OTH} - - ${PRIV_CID} = Create Container ${WALLET} - ${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE} - Check Private Container ${WALLET} ${FILE_S} ${PRIV_CID} ${WALLET_OTH} + Check Private Container Simple + Check Private Container Complex [Teardown] Teardown acl_basic_private_container @@ -34,63 +29,79 @@ Basic ACL Operations for Private Container *** Keywords *** Check Private Container - [Arguments] ${USER_WALLET} ${FILE_S} ${PRIV_CID} ${WALLET_OTH} + [Arguments] ${COMPLEXITY} - ${WALLET_SN} ${ADDR_SN} = Prepare Wallet with WIF And Deposit ${NEOFS_SN_WIF} - ${WALLET_IR} ${ADDR_IR} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} + ${FILE_S} ${_} = Run Keyword If """${COMPLEXITY}""" == """Simple""" + ... Generate file ${SIMPLE_OBJ_SIZE} + ... ELSE + ... Generate file ${COMPLEX_OBJ_SIZE} + ${USER_WALLET} + ... ${_} + ... ${_} = Prepare Wallet And Deposit + ${WALLET_OTH} + ... ${_} + ... ${_} = Prepare Wallet And Deposit + + ${PRIV_CID} = Create Container ${USER_WALLET} + + Transfer Mainnet Gas ${STORAGE_WALLET_PATH} ${DEPOSIT + 1} + NeoFS Deposit ${STORAGE_WALLET_PATH} ${DEPOSIT} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} # Put ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PRIV_CID} Run Keyword And Expect Error * ... Put object ${WALLET_OTH} ${FILE_S} ${PRIV_CID} - ${S_OID_SYS_IR} = Put Object ${WALLET_IR} ${FILE_S} ${PRIV_CID} - ${S_OID_SYS_SN} = Put Object ${WALLET_SN} ${FILE_S} ${PRIV_CID} + ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${PRIV_CID} wallet_config=${IR_WALLET_CONFIG} + ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PRIV_CID} # Get Get Object ${USER_WALLET} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Run Keyword And Expect Error * ... Get object ${WALLET_OTH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get Object ${IR_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read wallet_config=${IR_WALLET_CONFIG} + Get Object ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range Get Range ${USER_WALLET} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * ... Get Range ${WALLET_OTH} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash Get Range hash ${USER_WALLET} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * ... Get Range Hash ${WALLET_OTH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range hash ${WALLET_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range hash ${WALLET_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + # TODO: always fails for complex object + #Get Range hash ${IR_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} + Get Range hash ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} Search Object ${USER_WALLET} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} Run Keyword And Expect Error * ... Search object ${WALLET_OTH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} - Search Object ${WALLET_IR} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} - Search Object ${WALLET_SN} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} + Search Object ${IR_WALLET_PATH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} wallet_config=${IR_WALLET_CONFIG} + Search Object ${STORAGE_WALLET_PATH} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} # Head Head Object ${USER_WALLET} ${PRIV_CID} ${S_OID_USER} Run Keyword And Expect Error * ... Head object ${WALLET_OTH} ${PRIV_CID} ${S_OID_USER} - Head Object ${WALLET_IR} ${PRIV_CID} ${S_OID_USER} - Head Object ${WALLET_SN} ${PRIV_CID} ${S_OID_USER} + Head Object ${IR_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} + Head Object ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} # Delete Run Keyword And Expect Error * ... Delete object ${WALLET_OTH} ${PRIV_CID} ${S_OID_USER} Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${PRIV_CID} ${S_OID_USER} + ... Delete object ${IR_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${PRIV_CID} ${S_OID_USER} + ... Delete object ${STORAGE_WALLET_PATH} ${PRIV_CID} ${S_OID_USER} Delete Object ${USER_WALLET} ${PRIV_CID} ${S_OID_USER} diff --git a/robot/testsuites/integration/acl/acl_basic_public_container.robot b/robot/testsuites/integration/acl/acl_basic_public_container.robot index 492c471a..85d0285f 100644 --- a/robot/testsuites/integration/acl/acl_basic_public_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_public_container.robot @@ -8,6 +8,9 @@ Library utility_keywords.py Resource payment_operations.robot Resource setup_teardown.robot +*** Variables *** +${DEPOSIT} = ${30} + *** Test cases *** Basic ACL Operations for Public Container @@ -36,64 +39,66 @@ Basic ACL Operations for Public Container Check Public Container [Arguments] ${USER_WALLET} ${FILE_S} ${PUBLIC_CID} ${WALLET_OTH} - ${WALLET_SN} ${ADDR_SN} = Prepare Wallet with WIF And Deposit ${NEOFS_SN_WIF} - ${WALLET_IR} ${ADDR_IR} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} - + Transfer Mainnet Gas ${STORAGE_WALLET_PATH} ${DEPOSIT + 1} + NeoFS Deposit ${STORAGE_WALLET_PATH} ${DEPOSIT} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} # Put ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${PUBLIC_CID} ${S_OID_OTHER} = Put Object ${WALLET_OTH} ${FILE_S} ${PUBLIC_CID} - ${S_OID_SYS_IR} = Put Object ${WALLET_IR} ${FILE_S} ${PUBLIC_CID} - ${S_OID_SYS_SN} = Put Object ${WALLET_SN} ${FILE_S} ${PUBLIC_CID} + ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${PUBLIC_CID} wallet_config=${IR_WALLET_CONFIG} + ${S_OID_SYS_SN} = Put Object ${STORAGE_WALLET_PATH} ${FILE_S} ${PUBLIC_CID} # Get Get Object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read Get Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_SN} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get Object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read wallet_config=${IR_WALLET_CONFIG} + Get Object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range Get Range ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Get Range ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash Get Range Hash ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 Get Range Hash ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${WALLET_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${WALLET_SN} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + # TODO: fails with "object not found" + #Get Range Hash ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} + #Get Range Hash ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} Search object ${USER_WALLET} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} Search object ${WALLET_OTH} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} - Search object ${WALLET_IR} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} - Search object ${WALLET_SN} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} + Search object ${IR_WALLET_PATH} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} wallet_config=${IR_WALLET_CONFIG} + Search object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} keys=--root expected_objects_list=${S_OBJ_PRIV} # Head Head Object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_USER} Head Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_USER} - Head Object ${WALLET_IR} ${PUBLIC_CID} ${S_OID_USER} - Head Object ${WALLET_SN} ${PUBLIC_CID} ${S_OID_USER} + Head Object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} + Head Object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} Head Object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_OTHER} Head Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_OTHER} - Head Object ${WALLET_IR} ${PUBLIC_CID} ${S_OID_OTHER} - Head Object ${WALLET_SN} ${PUBLIC_CID} ${S_OID_OTHER} + Head Object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER} wallet_config=${IR_WALLET_CONFIG} + Head Object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER} Head Object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_SYS_SN} Head Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_SYS_SN} - Head Object ${WALLET_IR} ${PUBLIC_CID} ${S_OID_SYS_SN} - Head Object ${WALLET_SN} ${PUBLIC_CID} ${S_OID_SYS_SN} + Head Object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_SYS_SN} wallet_config=${IR_WALLET_CONFIG} + Head Object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_SYS_SN} # Delete Delete object ${USER_WALLET} ${PUBLIC_CID} ${S_OID_SYS_IR} Delete Object ${WALLET_OTH} ${PUBLIC_CID} ${S_OID_SYS_SN} Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${PUBLIC_CID} ${S_OID_USER} + ... Delete object ${IR_WALLET_PATH} ${PUBLIC_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${PUBLIC_CID} ${S_OID_OTHER} + ... Delete object ${STORAGE_WALLET_PATH} ${PUBLIC_CID} ${S_OID_OTHER} diff --git a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot index dd4b07f6..63f5a5ba 100644 --- a/robot/testsuites/integration/acl/acl_basic_readonly_container.robot +++ b/robot/testsuites/integration/acl/acl_basic_readonly_container.robot @@ -8,6 +8,8 @@ Library utility_keywords.py Resource payment_operations.robot Resource setup_teardown.robot +*** Variables *** +${DEPOSIT} = ${30} *** Test cases *** Basic ACL Operations for Read-Only Container @@ -17,14 +19,8 @@ Basic ACL Operations for Read-Only Container [Setup] Setup - ${WALLET} ${_} ${_} = Prepare Wallet And Deposit - ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit - - ${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE} - Check Read-Only Container Simple ${WALLET} ${FILE_S} ${WALLET_OTH} - - ${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE} - Check Read-Only Container Complex ${WALLET} ${FILE_S} ${WALLET_OTH} + Check Read-Only Container Simple + Check Read-Only Container Complex [Teardown] Teardown acl_basic_readonly_container @@ -32,60 +28,70 @@ Basic ACL Operations for Read-Only Container *** Keywords *** Check Read-Only Container - [Arguments] ${RUN_TYPE} ${USER_WALLET} ${FILE_S} ${WALLET_OTH} + [Arguments] ${COMPLEXITY} + + ${FILE_S} ${_} = Run Keyword If """${COMPLEXITY}""" == """Simple""" + ... Generate file ${SIMPLE_OBJ_SIZE} + ... ELSE + ... Generate file ${COMPLEX_OBJ_SIZE} + + ${USER_WALLET} ${_} ${_} = Prepare Wallet And Deposit + ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit ${READONLY_CID} = Create Container ${USER_WALLET} basic_acl=public-read - ${WALLET_SN} ${_} = Prepare Wallet with WIF And Deposit ${NEOFS_SN_WIF} - ${WALLET_IR} ${_} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} + Transfer Mainnet Gas ${STORAGE_WALLET_PATH} ${DEPOSIT + 1} + NeoFS Deposit ${STORAGE_WALLET_PATH} ${DEPOSIT} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} # Put ${S_OID_USER} = Put Object ${USER_WALLET} ${FILE_S} ${READONLY_CID} Run Keyword And Expect Error * ... Put object ${WALLET_OTH} ${FILE_S} ${READONLY_CID} - ${S_OID_SYS_IR} = Put Object ${WALLET_IR} ${FILE_S} ${READONLY_CID} - ${S_OID_SYS_SN} = Put object ${WALLET_SN} ${FILE_S} ${READONLY_CID} + ${S_OID_SYS_IR} = Put Object ${IR_WALLET_PATH} ${FILE_S} ${READONLY_CID} wallet_config=${IR_WALLET_CONFIG} + ${S_OID_SYS_SN} = Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${READONLY_CID} # Get Get object ${USER_WALLET} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read Get Object ${WALLET_OTH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get Object ${WALLET_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get Object ${IR_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read wallet_config=${IR_WALLET_CONFIG} + Get Object ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range Get Range ${USER_WALLET} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Get Range ${WALLET_OTH} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash Get Range hash ${USER_WALLET} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 Get Range hash ${WALLET_OTH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range hash ${WALLET_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range hash ${WALLET_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + #Get Range hash ${IR_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} + #Get Range hash ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} Search Object ${USER_WALLET} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} Search Object ${WALLET_OTH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} - Search Object ${WALLET_IR} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} - Search Object ${WALLET_SN} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} + Search Object ${IR_WALLET_PATH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} wallet_config=${IR_WALLET_CONFIG} + Search Object ${STORAGE_WALLET_PATH} ${READONLY_CID} keys=--root expected_objects_list=${S_OBJ_RO} # Head Head Object ${USER_WALLET} ${READONLY_CID} ${S_OID_USER} Head Object ${WALLET_OTH} ${READONLY_CID} ${S_OID_USER} - Head Object ${WALLET_IR} ${READONLY_CID} ${S_OID_USER} - Head Object ${WALLET_SN} ${READONLY_CID} ${S_OID_USER} + Head Object ${IR_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} + Head Object ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} # Delete Run Keyword And Expect Error * ... Delete object ${WALLET_OTH} ${READONLY_CID} ${S_OID_USER} Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${READONLY_CID} ${S_OID_USER} + ... Delete object ${IR_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${READONLY_CID} ${S_OID_USER} + ... Delete object ${STORAGE_WALLET_PATH} ${READONLY_CID} ${S_OID_USER} Delete Object ${USER_WALLET} ${READONLY_CID} ${S_OID_USER} diff --git a/robot/testsuites/integration/acl/acl_bearer_compound.robot b/robot/testsuites/integration/acl/acl_bearer_compound.robot index 9e16756b..df5cebfe 100644 --- a/robot/testsuites/integration/acl/acl_bearer_compound.robot +++ b/robot/testsuites/integration/acl/acl_bearer_compound.robot @@ -12,7 +12,7 @@ Resource payment_operations.robot Resource setup_teardown.robot *** Variables *** -${SYSTEM_KEY} = ${NEOFS_IR_WIF} +${DEPOSIT} = ${30} &{USER_HEADER} = key1=1 key2=abc &{ANOTHER_HEADER} = key1=oth key2=oth @@ -43,21 +43,22 @@ BearerToken Operations for Сompound Operations Check Сompound Operations [Arguments] ${USER_WALLET} ${OTHER_WALLET} ${FILE_S} - ${WALLET_SYS} ${ADDR_SYS} = Prepare Wallet with WIF And Deposit ${SYSTEM_KEY} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} - Check Bearer Сompound Get ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - Check Bearer Сompound Get ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - Check Bearer Сompound Get ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + Check Bearer Сompound Get ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} + Check Bearer Сompound Get ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} + #Check Bearer Сompound Get ${IR_WALLET_PATH} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} - Check Bearer Сompound Delete ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - Check Bearer Сompound Delete ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} - Check Bearer Сompound Delete ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + Check Bearer Сompound Delete ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} + Check Bearer Сompound Delete ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} + #Check Bearer Сompound Delete ${IR_WALLET_PATH} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} - Check Bearer Сompound Get Range Hash ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} - Check Bearer Сompound Get Range Hash ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} - Check Bearer Сompound Get Range Hash ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} + Check Bearer Сompound Get Range Hash ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${USER_WALLET} ${FILE_S} + Check Bearer Сompound Get Range Hash ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${USER_WALLET} ${FILE_S} + #Check Bearer Сompound Get Range Hash ${IR_WALLET_PATH} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${USER_WALLET} ${FILE_S} Check Bearer Сompound Get - [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} @@ -82,7 +83,7 @@ Check Bearer Сompound Get ... Head object ${WALLET} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} Get Object ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl - IF "${WALLET}" == "${WALLET_SYS}" + IF "${WALLET}" == "${IR_WALLET_PATH}" Run Keyword And Expect Error * ... Get Range ${WALLET} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256 ELSE @@ -92,14 +93,14 @@ Check Bearer Сompound Get Check Bearer Сompound Delete - [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${D_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - IF "${WALLET}" == "${WALLET_SYS}" + IF "${WALLET}" == "${IR_WALLET_PATH}" Run Keyword And Expect Error * ... Delete object ${WALLET} ${CID} ${D_OID_USER} ${EMPTY} ELSE @@ -127,14 +128,14 @@ Check Bearer Сompound Delete Check Bearer Сompound Get Range Hash - [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${USER_WALLET} ${FILE_S} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${USER_WALLET} ${FILE_S} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write Prepare eACL Role rules ${CID} ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - Get Range hash ${WALLET_SYS} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range hash ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 Set eACL ${USER_WALLET} ${CID} ${DENY_EACL} # The current ACL cache lifetime is 30 sec diff --git a/robot/testsuites/integration/acl/acl_extended_actions_pubkey.robot b/robot/testsuites/integration/acl/acl_extended_actions_pubkey.robot index 76c2dbec..fd77f4ae 100644 --- a/robot/testsuites/integration/acl/acl_extended_actions_pubkey.robot +++ b/robot/testsuites/integration/acl/acl_extended_actions_pubkey.robot @@ -26,16 +26,12 @@ Extended ACL Operations [Setup] Setup - ${WALLET} ${_} ${_} = Prepare Wallet And Deposit - ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit - Log Check extended ACL with simple object ${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE} - Check eACL Deny All Other and Allow All Pubkey ${WALLET} ${FILE_S} ${WALLET_OTH} + Check eACL Deny All Other and Allow All Pubkey ${FILE_S} - Log Check extended ACL with complex object ${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE} - Check eACL Deny All Other and Allow All Pubkey ${WALLET} ${FILE_S} ${WALLET_OTH} + Check eACL Deny All Other and Allow All Pubkey ${FILE_S} [Teardown] Teardown acl_extended_actions_pubkey @@ -44,7 +40,10 @@ Extended ACL Operations *** Keywords *** Check eACL Deny All Other and Allow All Pubkey - [Arguments] ${USER_WALLET} ${FILE_S} ${WALLET_OTH} + [Arguments] ${FILE_S} + + ${USER_WALLET} ${_} ${_} = Prepare Wallet And Deposit + ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} diff --git a/robot/testsuites/integration/acl/acl_extended_actions_system.robot b/robot/testsuites/integration/acl/acl_extended_actions_system.robot index a253dd29..3b763f94 100644 --- a/robot/testsuites/integration/acl/acl_extended_actions_system.robot +++ b/robot/testsuites/integration/acl/acl_extended_actions_system.robot @@ -15,6 +15,7 @@ Resource eacl_tables.robot &{USER_HEADER} = key1=1 key2=abc &{USER_HEADER_DEL} = key1=del key2=del &{ANOTHER_USER_HEADER} = key1=oth key2=oth +${DEPOSIT} = ${30} *** Test cases *** Extended ACL Operations @@ -42,8 +43,10 @@ Extended ACL Operations Check eACL Deny and Allow All System [Arguments] ${WALLET} ${FILE_S} - ${WALLET_SN} ${_} = Prepare Wallet with WIF And Deposit ${NEOFS_SN_WIF} - ${WALLET_IR} ${_} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} + Transfer Mainnet Gas ${STORAGE_WALLET_PATH} ${DEPOSIT + 1} + NeoFS Deposit ${STORAGE_WALLET_PATH} ${DEPOSIT} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} ${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write @@ -53,30 +56,30 @@ Check eACL Deny and Allow All System @{S_OBJ_H} = Create List ${S_OID_USER} - Put object ${WALLET_IR} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} - Put object ${WALLET_SN} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} + Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} + Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} - Get object ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl wallet_config=${IR_WALLET_CONFIG} + Get object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${WALLET_IR} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} - Search object ${WALLET_SN} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} + Search object ${IR_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} wallet_config=${IR_WALLET_CONFIG} + Search object ${STORAGE_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} - Head object ${WALLET_IR} ${CID} ${S_OID_USER} - Head object ${WALLET_SN} ${CID} ${S_OID_USER} + Head object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} + Head object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range Hash ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + #Get Range Hash ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} + #Get Range Hash ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${CID} ${D_OID_USER_S} + ... Delete object ${IR_WALLET_PATH} ${CID} ${D_OID_USER_S} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${CID} ${D_OID_USER_SN} + ... Delete object ${STORAGE_WALLET_PATH} ${CID} ${D_OID_USER_SN} Set eACL ${WALLET} ${CID} ${EACL_DENY_ALL_SYSTEM} @@ -84,42 +87,42 @@ Check eACL Deny and Allow All System Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT} Run Keyword And Expect Error * - ... Put object ${WALLET_IR} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} + ... Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Put object ${WALLET_SN} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} + ... Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} Run Keyword And Expect Error * - ... Get object ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + ... Get object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get object ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + ... Get object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Run Keyword And Expect Error * - ... Search object ${WALLET_IR} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} + ... Search object ${IR_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Search object ${WALLET_SN} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} + ... Search object ${STORAGE_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} Run Keyword And Expect Error * - ... Head object ${WALLET_IR} ${CID} ${S_OID_USER} + ... Head object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Head object ${WALLET_SN} ${CID} ${S_OID_USER} + ... Head object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range Hash ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range Hash ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range Hash ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range Hash ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${CID} ${S_OID_USER} + ... Delete object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${CID} ${S_OID_USER} + ... Delete object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} Set eACL ${WALLET} ${CID} ${EACL_ALLOW_ALL_SYSTEM} @@ -133,27 +136,27 @@ Check eACL Deny and Allow All System ${D_OID_USER_S} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} ${D_OID_USER_SN} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL} - Put object ${WALLET_IR} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} - Put object ${WALLET_SN} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} + Put object ${IR_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} wallet_config=${IR_WALLET_CONFIG} + Put object ${STORAGE_WALLET_PATH} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER} - Get object ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl wallet_config=${IR_WALLET_CONFIG} + Get object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${WALLET_IR} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} - Search object ${WALLET_SN} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} + Search object ${IR_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} wallet_config=${IR_WALLET_CONFIG} + Search object ${STORAGE_WALLET_PATH} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H} - Head object ${WALLET_IR} ${CID} ${S_OID_USER} - Head object ${WALLET_SN} ${CID} ${S_OID_USER} + Head object ${IR_WALLET_PATH} ${CID} ${S_OID_USER} wallet_config=${IR_WALLET_CONFIG} + Head object ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} Run Keyword And Expect Error * - ... Get Range ${WALLET_IR} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${IR_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Get Range ${WALLET_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range Hash ${WALLET_IR} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${WALLET_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + #Get Range Hash ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 wallet_config=${IR_WALLET_CONFIG} + #Get Range Hash ${STORAGE_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Delete object ${WALLET_IR} ${CID} ${D_OID_USER_S} + ... Delete object ${IR_WALLET_PATH} ${CID} ${D_OID_USER_S} wallet_config=${IR_WALLET_CONFIG} Run Keyword And Expect Error * - ... Delete object ${WALLET_SN} ${CID} ${D_OID_USER_SN} + ... Delete object ${STORAGE_WALLET_PATH} ${CID} ${D_OID_USER_SN} diff --git a/robot/testsuites/integration/acl/acl_extended_compound.robot b/robot/testsuites/integration/acl/acl_extended_compound.robot index 47f5cb98..d9484602 100644 --- a/robot/testsuites/integration/acl/acl_extended_compound.robot +++ b/robot/testsuites/integration/acl/acl_extended_compound.robot @@ -12,9 +12,9 @@ Resource setup_teardown.robot Resource eacl_tables.robot *** Variables *** -${SYSTEM_KEY} = ${NEOFS_IR_WIF} &{USER_HEADER} = key1=1 key2=abc &{ANOTHER_HEADER} = key1=oth key2=oth +${DEPOSIT} = ${30} *** Test cases *** @@ -45,22 +45,23 @@ Extended ACL Operations Check Сompound Operations [Arguments] ${WALLET} ${WALLET_OTH} ${FILE_S} - ${WALLET_SYS} ${ADDR_SYS} = Prepare Wallet with WIF And Deposit ${SYSTEM_KEY} + Transfer Mainnet Gas ${IR_WALLET_PATH} ${DEPOSIT + 1} wallet_password=${IR_WALLET_PASS} + NeoFS Deposit ${IR_WALLET_PATH} ${DEPOSIT} wallet_password=${IR_WALLET_PASS} - Check eACL Сompound Get ${WALLET_OTH} ${EACL_COMPOUND_GET_OTHERS} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Get ${WALLET} ${EACL_COMPOUND_GET_USER} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Get ${WALLET_SYS} ${EACL_COMPOUND_GET_SYSTEM} ${FILE_S} ${WALLET} ${WALLET_SYS} + Check eACL Сompound Get ${WALLET_OTH} ${EACL_COMPOUND_GET_OTHERS} ${FILE_S} ${WALLET} + Check eACL Сompound Get ${WALLET} ${EACL_COMPOUND_GET_USER} ${FILE_S} ${WALLET} + #Check eACL Сompound Get ${IR_WALLET_PATH} ${EACL_COMPOUND_GET_SYSTEM} ${FILE_S} ${WALLET} - Check eACL Сompound Delete ${WALLET_OTH} ${EACL_COMPOUND_DELETE_OTHERS} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Delete ${WALLET} ${EACL_COMPOUND_DELETE_USER} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Delete ${WALLET_SYS} ${EACL_COMPOUND_DELETE_SYSTEM} ${FILE_S} ${WALLET} ${WALLET_SYS} + Check eACL Сompound Delete ${WALLET_OTH} ${EACL_COMPOUND_DELETE_OTHERS} ${FILE_S} ${WALLET} + Check eACL Сompound Delete ${WALLET} ${EACL_COMPOUND_DELETE_USER} ${FILE_S} ${WALLET} + #Check eACL Сompound Delete ${IR_WALLET_PATH} ${EACL_COMPOUND_DELETE_SYSTEM} ${FILE_S} ${WALLET} - Check eACL Сompound Get Range Hash ${WALLET_OTH} ${EACL_COMPOUND_GET_HASH_OTHERS} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Get Range Hash ${WALLET} ${EACL_COMPOUND_GET_HASH_USER} ${FILE_S} ${WALLET} ${WALLET_SYS} - Check eACL Сompound Get Range Hash ${WALLET_SYS} ${EACL_COMPOUND_GET_HASH_SYSTEM} ${FILE_S} ${WALLET} ${WALLET_SYS} + Check eACL Сompound Get Range Hash ${WALLET_OTH} ${EACL_COMPOUND_GET_HASH_OTHERS} ${FILE_S} ${WALLET} + Check eACL Сompound Get Range Hash ${WALLET} ${EACL_COMPOUND_GET_HASH_USER} ${FILE_S} ${WALLET} + #Check eACL Сompound Get Range Hash ${IR_WALLET_PATH} ${EACL_COMPOUND_GET_HASH_SYSTEM} ${FILE_S} ${WALLET} Check eACL Сompound Get - [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write @@ -76,7 +77,7 @@ Check eACL Сompound Get ... Head object ${WALLET} ${CID} ${S_OID_USER} Get object ${WALLET} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - IF "${WALLET}" == "${WALLET_SYS}" + IF "${WALLET}" == "${IR_WALLET_PATH}" Run Keyword And Expect Error * ... Get Range ${WALLET} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 ELSE @@ -86,14 +87,14 @@ Check eACL Сompound Get Check eACL Сompound Delete - [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} ${D_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - IF "${WALLET}" == "${WALLET_SYS}" + IF "${WALLET}" == "${IR_WALLET_PATH}" Run Keyword And Expect Error * ... Delete object ${WALLET} ${CID} ${D_OID_USER} ELSE @@ -109,7 +110,7 @@ Check eACL Сompound Delete ... Head object ${WALLET} ${CID} ${S_OID_USER} Run Keyword And Expect Error * ... Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - IF "${WALLET}" == "${WALLET_SYS}" + IF "${WALLET}" == "${IR_WALLET_PATH}" Run Keyword And Expect Error * ... Delete object ${WALLET} ${CID} ${S_OID_USER} ELSE @@ -118,13 +119,13 @@ Check eACL Сompound Delete Check eACL Сompound Get Range Hash - [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS} + [Arguments] ${WALLET} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write ${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER} Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} - Get Range Hash ${WALLET_SYS} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${IR_WALLET_PATH} ${CID} ${S_OID_USER} ${EMPTY} 0:256 Set eACL ${USER_WALLET} ${CID} ${DENY_EACL} diff --git a/robot/testsuites/integration/acl/storage_group/basic_private_container_sg.robot b/robot/testsuites/integration/acl/storage_group/basic_private_container_sg.robot index 1805c008..1ce60016 100644 --- a/robot/testsuites/integration/acl/storage_group/basic_private_container_sg.robot +++ b/robot/testsuites/integration/acl/storage_group/basic_private_container_sg.robot @@ -18,16 +18,8 @@ Basic ACL Operations for Private Container [Setup] Setup - ${WALLET} ${_} ${_} = Prepare Wallet And Deposit - ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit - - ${PRIV_CID} = Create Container ${WALLET} - ${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE} - Check Private Container Simple ${WALLET} ${FILE_S} ${PRIV_CID} ${WALLET_OTH} - - ${PRIV_CID} = Create Container ${WALLET} - ${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE} - Check Private Container Complex ${WALLET} ${FILE_S} ${PRIV_CID} ${WALLET_OTH} + Check Private Container Simple + Check Private Container Complex [Teardown] Teardown acl_basic_private_container_storagegroup @@ -35,16 +27,23 @@ Basic ACL Operations for Private Container *** Keywords *** Check Private Container - [Arguments] ${RUN_TYPE} ${USER_WALLET} ${FILE_S} ${PRIV_CID} ${OTHER_WALLET} + [Arguments] ${COMPLEXITY} - ${WALLET_IR} ${ADDR_IR} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} + ${FILE_S} ${_} = Run Keyword If """${COMPLEXITY}""" == """Simple""" + ... Generate file ${SIMPLE_OBJ_SIZE} + ... ELSE + ... Generate file ${COMPLEX_OBJ_SIZE} + + ${USER_WALLET} ${_} ${_} = Prepare Wallet And Deposit + ${OTHER_WALLET} ${_} ${_} = Prepare Wallet And Deposit + ${PRIV_CID} = Create Container ${USER_WALLET} ${OID} = Put object ${USER_WALLET} ${FILE_S} ${PRIV_CID} @{OBJECTS} = Create List ${OID} ${SG} = Put Storagegroup ${USER_WALLET} ${PRIV_CID} ${OBJECTS} Run Storage Group Operations And Expect Success - ... ${USER_WALLET} ${PRIV_CID} ${OBJECTS} ${RUN_TYPE} + ... ${USER_WALLET} ${PRIV_CID} ${OBJECTS} ${COMPLEXITY} Run Storage Group Operations And Expect Failure ... ${OTHER_WALLET} ${PRIV_CID} ${OBJECTS} ${SG} @@ -52,4 +51,4 @@ Check Private Container # In private container, Inner Ring is allowed to read (Storage Group List and Get), # so using here keyword for read-only container. Run Storage Group Operations On System's Behalf In RO Container - ... ${PRIV_CID} ${OBJECTS} ${RUN_TYPE} + ... ${PRIV_CID} ${OBJECTS} ${COMPLEXITY} diff --git a/robot/testsuites/integration/acl/storage_group/basic_readonly_container_sg.robot b/robot/testsuites/integration/acl/storage_group/basic_readonly_container_sg.robot index fe9c93ff..95476383 100644 --- a/robot/testsuites/integration/acl/storage_group/basic_readonly_container_sg.robot +++ b/robot/testsuites/integration/acl/storage_group/basic_readonly_container_sg.robot @@ -18,16 +18,8 @@ Basic ACL Operations for Read-Only Container [Setup] Setup - ${WALLET} ${_} ${_} = Prepare Wallet And Deposit - ${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit - - ${READONLY_CID} = Create Container ${WALLET} basic_acl=public-read - ${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE} - Check Read-Only Container Simple ${WALLET} ${FILE_S} ${READONLY_CID} ${WALLET_OTH} - - ${READONLY_CID} = Create Container ${WALLET} basic_acl=public-read - ${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE} - Check Read-Only Container Complex ${WALLET} ${FILE_S} ${READONLY_CID} ${WALLET_OTH} + Check Read-Only Container Simple + Check Read-Only Container Complex [Teardown] Teardown acl_basic_readonly_container_storagegroup @@ -36,9 +28,20 @@ Basic ACL Operations for Read-Only Container Check Read-Only Container - [Arguments] ${RUN_TYPE} ${USER_WALLET} ${FILE} ${READONLY_CID} ${WALLET_OTH} + [Arguments] ${COMPLEXITY} - ${WALLET_IR} ${ADDR_IR} = Prepare Wallet with WIF And Deposit ${NEOFS_IR_WIF} + ${FILE} ${_} = Run Keyword If """${COMPLEXITY}""" == """Simple""" + ... Generate file ${SIMPLE_OBJ_SIZE} + ... ELSE + ... Generate file ${COMPLEX_OBJ_SIZE} + + ${USER_WALLET} + ... ${_} + ... ${_} = Prepare Wallet And Deposit + ${WALLET_OTH} + ... ${_} + ... ${_} = Prepare Wallet And Deposit + ${READONLY_CID} = Create Container ${USER_WALLET} basic_acl=public-read ${OID} = Put object ${USER_WALLET} ${FILE} ${READONLY_CID} @{OBJECTS} = Create List ${OID} @@ -46,10 +49,10 @@ Check Read-Only Container ${SG_1} = Put Storagegroup ${USER_WALLET} ${READONLY_CID} ${OBJECTS} Run Storage Group Operations And Expect Success - ... ${USER_WALLET} ${READONLY_CID} ${OBJECTS} ${RUN_TYPE} + ... ${USER_WALLET} ${READONLY_CID} ${OBJECTS} ${COMPLEXITY} Run Storage Group Operations On Other's Behalf in RO Container - ... ${USER_WALLET} ${READONLY_CID} ${OBJECTS} ${RUN_TYPE} + ... ${USER_WALLET} ${READONLY_CID} ${OBJECTS} ${COMPLEXITY} Run Storage Group Operations On System's Behalf in RO Container - ... ${READONLY_CID} ${OBJECTS} ${RUN_TYPE} + ... ${READONLY_CID} ${OBJECTS} ${COMPLEXITY} diff --git a/robot/testsuites/integration/cli/accounting/balance.robot b/robot/testsuites/integration/cli/accounting/balance.robot index f31963a6..d6119b1b 100644 --- a/robot/testsuites/integration/cli/accounting/balance.robot +++ b/robot/testsuites/integration/cli/accounting/balance.robot @@ -25,18 +25,18 @@ CLI Accounting Balance Test ${WALLET} ${ADDR} ${_} = Prepare Wallet And Deposit ${DEPOSIT_AMOUNT} # Getting balance with wallet and address - ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ADDR} --wallet ${WALLET} --config ${WALLET_PASS} + ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ADDR} --wallet ${WALLET} --config ${WALLET_CONFIG} ... shell=True Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT} # Getting balance with wallet only - ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --wallet ${WALLET} --config ${WALLET_PASS} + ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --wallet ${WALLET} --config ${WALLET_CONFIG} ... shell=True Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT} # Getting balance with wallet and wrong address ${ANOTHER_WALLET} ${ANOTHER_ADDR} ${ANOTHER_WIF} = Init Wallet With Address ${ASSETS_DIR} - ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ANOTHER_ADDR} --wallet ${WALLET} --config ${WALLET_PASS} + ${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ANOTHER_ADDR} --wallet ${WALLET} --config ${WALLET_CONFIG} ... shell=True Should Be Equal As Strings ${OUTPUT.stderr} --address option must be specified and valid Should Be Equal As Numbers ${OUTPUT.rc} 1 diff --git a/robot/testsuites/integration/cli/netmap/networkinfo_rpc_method.robot b/robot/testsuites/integration/cli/netmap/networkinfo_rpc_method.robot index a339b4b2..5d220039 100644 --- a/robot/testsuites/integration/cli/netmap/networkinfo_rpc_method.robot +++ b/robot/testsuites/integration/cli/netmap/networkinfo_rpc_method.robot @@ -10,13 +10,14 @@ Resource payment_operations.robot Resource setup_teardown.robot *** Variables *** -${SN_01_ADDR} = s01.neofs.devenv:8080 -${SN_02_ADDR} = s02.neofs.devenv:8080 +${SN_01_ADDR} = s01.neofs.devenv:8080 +${SN_02_ADDR} = s02.neofs.devenv:8080 +${DEPOSIT} = ${30} *** Test cases *** NetworkInfo RPC Method [Documentation] Testcase to check NetworkInfo RPC method. - [Tags] RPC NeoFS NeoFSCLI NetworkInfo + [Tags] RPC NetworkInfo [Timeout] 10 min [Setup] Setup @@ -24,53 +25,54 @@ NetworkInfo RPC Method ###################################################################### # Checking if the command returns equal results for two storage nodes ###################################################################### -#TODO: Remove line for it's unnecessary (#194) - ${WALLET_MAINNET} ${ADDR_MAINNET} = Prepare Wallet with WIF And Deposit ${MAINNET_WALLET_WIF} - - ${RESULT1_S01} Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${WALLET_MAINNET} --config ${WALLET_PASS} shell=True - Should Be Equal As Integers ${RESULT1_S01.rc} 0 - ${RESULT1_S02} Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${WALLET_MAINNET} --config ${WALLET_PASS} shell=True - Should Be Equal As Integers ${RESULT1_S02.rc} 0 + ${RESULT1_S01} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG} + ... shell=True + Should Be Equal As Integers ${RESULT1_S01.rc} 0 + ${RESULT1_S02} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG} + ... shell=True + Should Be Equal As Integers ${RESULT1_S02.rc} 0 ############################################# # Checking if morph magic number is relevant ############################################# - ${NETWORK_MAGIC_S01} = Parse Magic ${RESULT1_S01.stdout} - Should Be Equal ${NETWORK_MAGIC_S01} ${MORPH_MAGIC} + ${NETWORK_MAGIC_S01} = Parse Magic ${RESULT1_S01.stdout} + Should Be Equal ${NETWORK_MAGIC_S01} ${MORPH_MAGIC} - ${NETWORK_MAGIC_S02} = Parse Magic ${RESULT1_S02.stdout} - Should Be Equal ${NETWORK_MAGIC_S02} ${MORPH_MAGIC} + ${NETWORK_MAGIC_S02} = Parse Magic ${RESULT1_S02.stdout} + Should Be Equal ${NETWORK_MAGIC_S02} ${MORPH_MAGIC} ####################################################################### # Checking if epoch numbers requested from two storage nodes are equal ####################################################################### - ${EPOCH1_S01} = Parse Epoch ${RESULT1_S01.stdout} - ${EPOCH1_S02} = Parse Epoch ${RESULT1_S02.stdout} - Should Be Equal As Integers ${EPOCH1_S01} ${EPOCH1_S02} + ${EPOCH1_S01} = Parse Epoch ${RESULT1_S01.stdout} + ${EPOCH1_S02} = Parse Epoch ${RESULT1_S02.stdout} + Should Be Equal As Integers ${EPOCH1_S01} ${EPOCH1_S02} ######################################## # Ticking epoch and getting new netinfo ######################################## - Tick Epoch + Tick Epoch - ${RESULT2_S01} Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${WALLET_MAINNET} --config ${WALLET_PASS} shell=True - Should Be Equal As Integers ${RESULT2_S01.rc} 0 - ${RESULT2_S02} Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${WALLET_MAINNET} --config ${WALLET_PASS} shell=True - Should Be Equal As Integers ${RESULT2_S02.rc} 0 + ${RESULT2_S01} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG} + ... shell=True + Should Be Equal As Integers ${RESULT2_S01.rc} 0 + ${RESULT2_S02} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG} + ... shell=True + Should Be Equal As Integers ${RESULT2_S02.rc} 0 - Should Be Equal As Strings ${RESULT2_S01.stdout} ${RESULT2_S02.stdout} + Should Be Equal As Strings ${RESULT2_S01.stdout} ${RESULT2_S02.stdout} - ${EPOCH2_S01} = Parse Epoch ${RESULT2_S01.stdout} + ${EPOCH2_S01} = Parse Epoch ${RESULT2_S01.stdout} ################################################################# # Checking if the second epoch value is more than the first by 1 ################################################################# - ${NEW_EPOCH} = Evaluate ${EPOCH1_S01}+${1} - Should Be Equal ${EPOCH2_S01} ${NEW_EPOCH} + ${NEW_EPOCH} = Evaluate ${EPOCH1_S01}+${1} + Should Be Equal ${EPOCH2_S01} ${NEW_EPOCH} [Teardown] Teardown network_rpc_method diff --git a/robot/testsuites/integration/network/netmap_control.robot b/robot/testsuites/integration/network/netmap_control.robot index f7e7560b..69c37b64 100644 --- a/robot/testsuites/integration/network/netmap_control.robot +++ b/robot/testsuites/integration/network/netmap_control.robot @@ -22,33 +22,33 @@ Control Operations with storage nodes ${WALLET_STORAGE} ${ADDR_STORAGE} = Prepare Wallet with WIF And Deposit ${WIF} ${empty_list} = Create List - ${SNAPSHOT} = Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True - ${HEALTHCHECK} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True + ${SNAPSHOT} = Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True + ${HEALTHCHECK} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True Should Be Equal As Integers ${HEALTHCHECK.rc} 0 - Run Process ${NEOFS_CLI_EXEC} control set-status --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} --status 'offline' shell=True + Run Process ${NEOFS_CLI_EXEC} control set-status --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} --status 'offline' shell=True Sleep ${MAINNET_BLOCK_TIME} Tick Epoch - ${SNAPSHOT_OFFLINE}= Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True + ${SNAPSHOT_OFFLINE}= Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True ${NODE_NUM_OFFLINE}= Get Regexp Matches ${SNAPSHOT_OFFLINE.stdout} ${NODE_NUM} Should Be Equal ${NODE_NUM_OFFLINE} ${empty_list} - ${HEALTHCHECK_OFFLINE} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True + ${HEALTHCHECK_OFFLINE} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True Should Be Equal As Integers ${HEALTHCHECK_OFFLINE.rc} 0 Should Not Be Equal ${HEALTHCHECK.stdout} ${HEALTHCHECK_OFFLINE.stdout} - Run Process ${NEOFS_CLI_EXEC} control set-status --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} --status 'online' shell=True + Run Process ${NEOFS_CLI_EXEC} control set-status --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} --status 'online' shell=True Sleep ${MAINNET_BLOCK_TIME} Tick Epoch - ${SNAPSHOT_ONLINE} = Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True + ${SNAPSHOT_ONLINE} = Run Process ${NEOFS_CLI_EXEC} control netmap-snapshot --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True ${NODE_NUM_ONLINE} = Get Regexp Matches ${SNAPSHOT_ONLINE.stdout} ${NODE_NUM} Should Be Equal ${NODE_NUM_ONLINE}[0] ${NODE_NUM} - ${HEALTHCHECK_ONLINE} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_PASS} shell=True + ${HEALTHCHECK_ONLINE} = Run Process ${NEOFS_CLI_EXEC} control healthcheck --endpoint ${NODE} --wallet ${WALLET_STORAGE} --config ${WALLET_CONFIG} shell=True Should Be Equal As Integers ${HEALTHCHECK_ONLINE.rc} 0 Should Be Equal ${HEALTHCHECK.stdout} ${HEALTHCHECK_ONLINE.stdout} diff --git a/robot/testsuites/integration/payment/emission_threshold.robot b/robot/testsuites/integration/payment/emission_threshold.robot index 411ab5e1..ff678b47 100644 --- a/robot/testsuites/integration/payment/emission_threshold.robot +++ b/robot/testsuites/integration/payment/emission_threshold.robot @@ -23,22 +23,16 @@ IR GAS emission threshold value [Setup] Setup - ${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR} + ${WALLET} ${ADDR} ${_} = Init Wallet with Address ${ASSETS_DIR} ${SC_BALANCE} = Get Sidechain Balance ${ADDR} + Transfer Mainnet Gas ${WALLET} ${DEPOSIT} - ${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${DEPOSIT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX} - ########################################################################################## # Threshold is set to default 0 and sidechain balance has changed after deposit operation ########################################################################################## - ${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX_DEPOSIT} - + NeoFS Deposit ${WALLET} ${DEPOSIT_AMOUNT} Sleep ${MAINNET_BLOCK_TIME} ${BALANCE_CHANGED} = Get Sidechain Balance ${ADDR} @@ -51,10 +45,7 @@ IR GAS emission threshold value # Threshold is exceeded and sidechain balance has not changed after deposit operation ###################################################################################### - ${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX_DEPOSIT} - + NeoFS Deposit ${WALLET} ${DEPOSIT_AMOUNT} Sleep ${MAINNET_BLOCK_TIME} ${BALANCE_UNCHANGED} = Get Sidechain Balance ${ADDR} diff --git a/robot/testsuites/integration/payment/withdraw.robot b/robot/testsuites/integration/payment/withdraw.robot index 75cb6e6b..9fad068d 100644 --- a/robot/testsuites/integration/payment/withdraw.robot +++ b/robot/testsuites/integration/payment/withdraw.robot @@ -16,7 +16,6 @@ ${TRANSFER_AMOUNT} = ${15} *** Test cases *** NeoFS Deposit and Withdraw [Documentation] Testcase to validate NeoFS Withdraw operation. - [Tags] Withdraw NeoFS NeoCLI [Timeout] 10 min [Setup] Setup @@ -27,47 +26,36 @@ NeoFS Deposit and Withdraw ########################################################## # Transferring GAS from initial wallet to our test wallet ########################################################## - ${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX} - ${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR} - Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT} + Transfer Mainnet Gas ${WALLET} ${TRANSFER_AMOUNT} + ${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR} + Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT} ############################ # Making deposit into NeoFS ############################ - ${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX_DEPOSIT} + NeoFS Deposit ${WALLET} ${DEPOSIT_AMOUNT} ${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR} ${EXPECTED_BALANCE} = Evaluate ${TRANSFER_AMOUNT}-${DEPOSIT_AMOUNT} - Should Be True ${MAINNET_BALANCE} < ${EXPECTED_BALANCE} - ${DEPOSIT_FEE} = Evaluate ${EXPECTED_BALANCE} - ${MAINNET_BALANCE} - Log Deposit fee is ${DEPOSIT_FEE} + Should Be True ${MAINNET_BALANCE} < ${EXPECTED_BALANCE} - ${NEOFS_BALANCE} = Get NeoFS Balance ${WIF} - Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT} + ${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET} + Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT} # TODO: try to withdraw more than was deposited ########################### # Withdrawing deposit back ########################### - ${TX} = Withdraw Mainnet Gas ${WALLET} ${ADDR} ${SCRIPT_HASH} ${WITHDRAW_AMOUNT} - Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME} - ... Transaction accepted in block ${TX} - + Withdraw Mainnet Gas ${WALLET} ${ADDR} ${SCRIPT_HASH} ${WITHDRAW_AMOUNT} Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT} - ${NEOFS_BALANCE} = Get NeoFS Balance ${WIF} - ${EXPECTED_BALANCE} = Evaluate ${DEPOSIT_AMOUNT} - ${WITHDRAW_AMOUNT} - Should Be Equal As numbers ${NEOFS_BALANCE} ${EXPECTED_BALANCE} + ${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET} + ${EXPECTED_BALANCE} = Evaluate ${DEPOSIT_AMOUNT} - ${WITHDRAW_AMOUNT} + Should Be Equal As numbers ${NEOFS_BALANCE} ${EXPECTED_BALANCE} ${MAINNET_BALANCE_AFTER} = Get Mainnet Balance ${ADDR} ${MAINNET_BALANCE_DIFF} = Evaluate ${MAINNET_BALANCE_AFTER} - ${MAINNET_BALANCE} - Should Be True ${MAINNET_BALANCE_DIFF} < ${WITHDRAW_AMOUNT} - ${WITHDRAW_FEE} = Evaluate ${WITHDRAW_AMOUNT} - ${MAINNET_BALANCE_DIFF} - Log Withdraw fee is ${WITHDRAW_FEE} + Should Be True ${MAINNET_BALANCE_DIFF} < ${WITHDRAW_AMOUNT} [Teardown] Teardown withdraw diff --git a/robot/variables/common.py b/robot/variables/common.py index 46054507..6d1d949c 100644 --- a/robot/variables/common.py +++ b/robot/variables/common.py @@ -23,21 +23,16 @@ NEOFS_CONTRACT_CACHE_TIMEOUT = os.getenv("NEOFS_CONTRACT_CACHE_TIMEOUT", "30s") SHARD_0_GC_SLEEP = os.getenv("NEOFS_STORAGE_SHARD_0_GC_REMOVER_SLEEP_INTERVAL", "1m") -NEOFS_IR_WIF = os.getenv("NEOFS_IR_WIF", "KxyjQ8eUa4FHt3Gvioyt1Wz29cTUrE4eTqX3yFSk1YFCsPL8uNsY") -NEOFS_SN_WIF = os.getenv("NEOFS_SN_WIF", "Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s") -MAINNET_WALLET_WIF = os.getenv("MAINNET_WALLET_WIF", "KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr") - NEOFS_ENDPOINT = os.getenv("NEOFS_ENDPOINT", "s01.neofs.devenv:8080") NEOGO_CLI_EXEC = os.getenv("NEOGO_EXECUTABLE", "neo-go") NEO_MAINNET_ENDPOINT = os.getenv("NEO_MAINNET_ENDPOINT", 'http://main-chain.neofs.devenv:30333') -NEOFS_NEO_API_ENDPOINT = os.getenv("NEOFS_NEO_API_ENDPOINT", 'http://morph-chain.neofs.devenv:30333') +MORPH_ENDPOINT = os.getenv("MORPH_ENDPOINT", 'http://morph-chain.neofs.devenv:30333') HTTP_GATE = os.getenv("HTTP_GATE", 'http://http.neofs.devenv') S3_GATE = os.getenv("S3_GATE", 'https://s3.neofs.devenv:8080') GAS_HASH = '0xd2a4cff31913016155e38e474a2c06d08be276cf' -NEOFS_CONTRACT = (os.getenv("NEOFS_CONTRACT") if os.getenv("NEOFS_CONTRACT") - else os.getenv("NEOFS_IR_CONTRACTS_NEOFS", '008b43d3de8741b896015f79ac0fbfa4055b4574')) +NEOFS_CONTRACT = os.getenv("NEOFS_IR_CONTRACTS_NEOFS") COMMON_PLACEMENT_RULE = "REP 2 IN X CBF 1 SELECT 4 FROM * AS X" @@ -72,4 +67,12 @@ NEOFS_NETMAP = [i['rpc'] for i in NEOFS_NETMAP_DICT.values()] NEOGO_EXECUTABLE = os.getenv('NEOGO_EXECUTABLE', 'neo-go') NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli') -WALLET_PASS = f"{os.getcwd()}/wallet_pass.yml" +WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/empty_passwd.yml" +MAINNET_WALLET_PATH = f"{os.getenv('DEVENV_PATH')}/services/chain/node-wallet.json" +MAINNET_WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/mainnet_wallet_passwd.yml" +MAINNET_SINGLE_ADDR = 'NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP' +MAINNET_WALLET_PASS = 'one' +IR_WALLET_PATH = f"{os.getenv('DEVENV_PATH')}/services/ir/wallet01.json" +IR_WALLET_CONFIG = f"{os.getcwd()}/neofs_cli_configs/ir_wallet_passwd.yml" +IR_WALLET_PASS = 'one' +STORAGE_WALLET_PATH = f"{os.getenv('DEVENV_PATH')}/services/storage/wallet01.json"