From 776c2d7b90330f8f6818fe532c9f81aa1fa5eb20 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Thu, 26 Nov 2020 11:32:18 +0300 Subject: [PATCH 01/15] update --- robot/resources/lib/eacl/bearer_token | 25 + .../resources/lib/eacl/eacl_encoded_allow_all | 69 +++ .../lib/eacl/eacl_encoded_allow_all_pubkey | 132 +++++ .../lib/eacl/eacl_encoded_allow_all_sys | 68 +++ .../lib/eacl/eacl_encoded_allow_all_user | 68 +++ .../resources/lib/eacl/eacl_encoded_deny_all | 68 +++ .../lib/eacl/eacl_encoded_deny_all_pubkey | 68 +++ .../lib/eacl/eacl_encoded_deny_all_sys | 68 +++ .../lib/eacl/eacl_encoded_deny_all_user | 68 +++ .../lib/eacl/eacl_encoded_deny_filter | 21 + .../lib/eacl/eacl_encoded_deny_filter_check | 68 +++ robot/resources/lib/neofs.py | 391 ++++++++++++-- .../integration/acl_basic_api2.robot | 45 +- .../integration/acl_bearer_api2.robot | 229 +++++++++ .../integration/acl_extended_api2.robot | 481 ++++++++++++++++++ .../integration/object_complex_api2.robot | 21 +- .../integration/object_simple_api2.robot | 29 +- 17 files changed, 1849 insertions(+), 70 deletions(-) create mode 100644 robot/resources/lib/eacl/bearer_token create mode 100755 robot/resources/lib/eacl/eacl_encoded_allow_all create mode 100755 robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey create mode 100755 robot/resources/lib/eacl/eacl_encoded_allow_all_sys create mode 100755 robot/resources/lib/eacl/eacl_encoded_allow_all_user create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_all create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_all_pubkey create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_all_sys create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_all_user create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_filter create mode 100755 robot/resources/lib/eacl/eacl_encoded_deny_filter_check create mode 100644 robot/testsuites/integration/acl_bearer_api2.robot create mode 100644 robot/testsuites/integration/acl_extended_api2.robot diff --git a/robot/resources/lib/eacl/bearer_token b/robot/resources/lib/eacl/bearer_token new file mode 100644 index 0000000..2f7f746 --- /dev/null +++ b/robot/resources/lib/eacl/bearer_token @@ -0,0 +1,25 @@ +{ + "body": { + "eaclTable": { + "containerID": { + "value": "5nWjhWaME7krQsEKwwczsxAatT4SNqB1bnxKR36Szwtb" + }, + "records": [ + { + "operation": "GET", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + } + ] + }, + "lifetime": { + "exp": "100500", + "nbf": "1", + "iat": "0" + } + } +} diff --git a/robot/resources/lib/eacl/eacl_encoded_allow_all b/robot/resources/lib/eacl/eacl_encoded_allow_all new file mode 100755 index 0000000..ff2631e --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_allow_all @@ -0,0 +1,69 @@ +{ + "records": [ + { + "operation": "GET", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "HEAD", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "PUT", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "DELETE", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "SEARCH", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGE", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "ALLOW", + "targets": [ + { + "role": "OTHERS" + } + ] + } + ] +} + + diff --git a/robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey b/robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey new file mode 100755 index 0000000..359f0e5 --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey @@ -0,0 +1,132 @@ +{ + "records": [ + { + "operation": "GET", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "HEAD", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "PUT", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "DELETE", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "SEARCH", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "GETRANGE", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "ALLOW", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + } + + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_allow_all_sys b/robot/resources/lib/eacl/eacl_encoded_allow_all_sys new file mode 100755 index 0000000..ab8d9cd --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_allow_all_sys @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "HEAD", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "PUT", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "DELETE", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "SEARCH", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "GETRANGE", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "ALLOW", + "targets": [ + { + "role": "SYSTEM" + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_allow_all_user b/robot/resources/lib/eacl/eacl_encoded_allow_all_user new file mode 100755 index 0000000..1186a55 --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_allow_all_user @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "HEAD", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "PUT", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "DELETE", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "SEARCH", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "GETRANGE", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "ALLOW", + "targets": [ + { + "role": "USER" + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_all b/robot/resources/lib/eacl/eacl_encoded_deny_all new file mode 100755 index 0000000..5e63d2b --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_all @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_all_pubkey b/robot/resources/lib/eacl/eacl_encoded_deny_all_pubkey new file mode 100755 index 0000000..e570cc1 --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_all_pubkey @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "keys": [ "NSNKmYXGM6TUH4AjAbtC2afxbJMV87XdDT" ] + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_all_sys b/robot/resources/lib/eacl/eacl_encoded_deny_all_sys new file mode 100755 index 0000000..83e31f9 --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_all_sys @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "role": "SYSTEM" + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_all_user b/robot/resources/lib/eacl/eacl_encoded_deny_all_user new file mode 100755 index 0000000..05dde4c --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_all_user @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "role": "USER" + } + ] + } + ] +} + diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_filter b/robot/resources/lib/eacl/eacl_encoded_deny_filter new file mode 100755 index 0000000..90b2c28 --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_filter @@ -0,0 +1,21 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "filters": [ + { + "headerType": "OBJECT", + "matchType": "STRING_NOT_EQUAL", + "key": "$Object:objectID", + "value": "X" + } + ], + "targets": [ + { + "role": "OTHERS" + } + ] + } + ] +} diff --git a/robot/resources/lib/eacl/eacl_encoded_deny_filter_check b/robot/resources/lib/eacl/eacl_encoded_deny_filter_check new file mode 100755 index 0000000..5e63d2b --- /dev/null +++ b/robot/resources/lib/eacl/eacl_encoded_deny_filter_check @@ -0,0 +1,68 @@ +{ + "records": [ + { + "operation": "GET", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "HEAD", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "PUT", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "DELETE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "SEARCH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGE", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": "DENY", + "targets": [ + { + "role": "OTHERS" + } + ] + } + ] +} + diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 3e7089e..e4362d2 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -8,7 +8,7 @@ import uuid import hashlib from robot.api.deco import keyword from robot.api import logger - +import json ROBOT_AUTO_KEYWORDS = False @@ -122,13 +122,23 @@ def validate_storage_policy_for_object(private_key: str, expected_copies: int, c @keyword('Get eACL') def get_eacl(private_key: bytes, cid: str): - Cmd = f'{CLI_PREFIX}neofs-cli --host {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} container get-eacl --cid {cid}' + Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} container get-eacl --cid {cid}' logger.info("Cmd: %s" % Cmd) - complProc = subprocess.run(Cmd, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) - output = complProc.stdout - logger.info("Output: %s" % output) + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) + output = complProc.stdout + logger.info("Output: %s" % output) + + return output + except subprocess.CalledProcessError as e: + if re.search(r'extended ACL table is not set for this container', e.output): + logger.info("Server is not presented in container.") + else: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + @keyword('Convert Str to Hex Str with Len') @@ -139,25 +149,12 @@ def conver_str_to_hex(string_convert: str): return str(prev_len_2)+str(converted) -@keyword('Set custom eACL') -def set_custom_eacl(private_key: bytes, cid: str, eacl_prefix: str, eacl_slice: str, eacl_postfix: str): - - logger.info(str(eacl_prefix)) - logger.info(str(eacl_slice)) - logger.info(str(eacl_postfix)) - - eacl = str(eacl_prefix) + str(eacl_slice) + str(eacl_postfix) - logger.info("Custom eACL: %s" % eacl) - - set_eacl(private_key, cid, eacl) - return - @keyword('Set eACL') -def set_eacl(private_key: bytes, cid: str, eacl: str): +def set_eacl(private_key: str, cid: str, eacl: str, add_keys: str = ""): - Cmd = f'{CLI_PREFIX}neofs-cli --host {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} container set-eacl --cid {cid} --eacl {eacl}' + Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} container set-eacl --cid {cid} --table {eacl} {add_keys}' logger.info("Cmd: %s" % Cmd) complProc = subprocess.run(Cmd, check=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) @@ -166,19 +163,322 @@ def set_eacl(private_key: bytes, cid: str, eacl: str): +@keyword('Form BearerToken file for all ops') +def form_bearertoken_file_for_all_ops(file_name: str, private_key: str, cid: str, action: str, target_role: str, lifetime_exp: str ): + + eacl = get_eacl(private_key, cid) + input_records = "" + if eacl: + res_json = re.split(r'[\s\n]+\][\s\n]+\}[\s\n]+Signature:', eacl) + records = re.split(r'"records": \[', res_json[0]) + input_records = ",\n" + records[1] + + myjson = """ +{ + "body": { + "eaclTable": { + "containerID": { + "value": \"""" + cid + """" + }, + "records": [ + { + "operation": "GET", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "PUT", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "HEAD", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "DELETE", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "SEARCH", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "GETRANGE", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }""" + input_records + """ + ] + }, + "lifetime": { + "exp": \"""" + lifetime_exp + """", + "nbf": "1", + "iat": "0" + } + } +} +""" + with open(file_name,'w') as out: + out.write(myjson) + logger.info("Output: %s" % myjson) + + # Sign bearer token + Cmd = f'neofs-cli util sign bearer-token --from {file_name} --to {file_name} --key {private_key} --json' + logger.info("Cmd: %s" % Cmd) + + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=15, shell=True) + output = complProc.stdout + logger.info("Output: %s" % str(output)) + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + return file_name + + + +@keyword('Form BearerToken file filter for all ops') +def form_bearertoken_file_filter_for_all_ops(file_name: str, private_key: str, cid: str, action: str, target_role: str, lifetime_exp: str, matchType: str, key: str, value: str): + + # SEARCH should be allowed without filters to use GET, HEAD, DELETE, and SEARCH. + + eacl = get_eacl(private_key, cid) + input_records = "" + if eacl: + res_json = re.split(r'[\s\n]+\][\s\n]+\}[\s\n]+Signature:', eacl) + records = re.split(r'"records": \[', res_json[0]) + input_records = ",\n" + records[1] + + myjson = """ +{ + "body": { + "eaclTable": { + "containerID": { + "value": \"""" + cid + """" + }, + "records": [ + { + "operation": "GET", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "PUT", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "HEAD", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "DELETE", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "SEARCH", + "action": \"""" + action + """", + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "GETRANGE", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }, + { + "operation": "GETRANGEHASH", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + }""" + input_records + """ + ] + }, + "lifetime": { + "exp": \"""" + lifetime_exp + """", + "nbf": "1", + "iat": "0" + } + } +} +""" + with open(file_name,'w') as out: + out.write(myjson) + logger.info("Output: %s" % myjson) + + # Sign bearer token + Cmd = f'neofs-cli util sign bearer-token --from {file_name} --to {file_name} --key {private_key} --json' + logger.info("Cmd: %s" % Cmd) + + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=15, shell=True) + output = complProc.stdout + logger.info("Output: %s" % str(output)) + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + return file_name + + + +@keyword('Form eACL json file') +def form_eacl_json_file(file_name: str, operation: str, action: str, matchType: str, key: str, value: str, target_role: str): + + myjson = """ +{ + "records": [ + { + "operation": \"""" + operation + """", + "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], + "targets": [ + { + "role": \"""" + target_role + """" + } + ] + } + ] +} +""" + with open(file_name,'w') as out: + out.write(myjson) + logger.info("Output: %s" % myjson) + + return file_name + + + + @keyword('Get Range') -def get_range(private_key: str, cid: str, oid: str, bearer: str, range_cut: str): +def get_range(private_key: str, cid: str, oid: str, range_file: str, bearer: str, range_cut: str): bearer_token = "" if bearer: bearer_token = f"--bearer {bearer}" - Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} object get-range --cid {cid} --oid {oid} {bearer_token} {range_cut} ' + Cmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} object range --cid {cid} --oid {oid} {bearer_token} --range {range_cut} --file {range_file} ' logger.info("Cmd: %s" % Cmd) - complProc = subprocess.run(Cmd, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) - output = complProc.stdout - logger.info("Output: %s" % output) + + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) + output = complProc.stdout + logger.info("Output: %s" % str(output)) + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) @keyword('Create container') @@ -425,36 +725,28 @@ def parse_object_system_header(header: str): #SystemHeader logger.info("Input: %s" % header) # ID - m = re.search(r'- ID=([a-zA-Z0-9-]+)', header) + m = re.search(r'ID: (\w+)', header) if m.start() != m.end(): # e.g., if match found something result_header['ID'] = m.group(1) else: raise Exception("no ID was parsed from object header: \t%s" % output) # CID - m = re.search(r'- CID=([a-zA-Z0-9]+)', header) + m = re.search(r'CID: (\w+)', header) if m.start() != m.end(): # e.g., if match found something result_header['CID'] = m.group(1) else: raise Exception("no CID was parsed from object header: \t%s" % output) # Owner - m = re.search(r'- OwnerID=([a-zA-Z0-9]+)', header) + m = re.search(r'Owner: ([a-zA-Z0-9]+)', header) if m.start() != m.end(): # e.g., if match found something result_header['OwnerID'] = m.group(1) else: raise Exception("no OwnerID was parsed from object header: \t%s" % output) - # Version - m = re.search(r'- Version=(\d+)', header) - if m.start() != m.end(): # e.g., if match found something - result_header['Version'] = m.group(1) - else: - raise Exception("no Version was parsed from object header: \t%s" % output) - - # PayloadLength - m = re.search(r'- PayloadLength=(\d+)', header) + m = re.search(r'Size: (\d+)', header) if m.start() != m.end(): # e.g., if match found something result_header['PayloadLength'] = m.group(1) else: @@ -462,15 +754,15 @@ def parse_object_system_header(header: str): - # CreatedAtUnixTime - m = re.search(r'- CreatedAt={UnixTime=(\d+)', header) + # CreatedAtUnixTime + m = re.search(r'Timestamp=(\d+)', header) if m.start() != m.end(): # e.g., if match found something result_header['CreatedAtUnixTime'] = m.group(1) else: raise Exception("no CreatedAtUnixTime was parsed from object header: \t%s" % output) # CreatedAtEpoch - m = re.search(r'- CreatedAt={UnixTime=\d+ Epoch=(\d+)', header) + m = re.search(r'CreatedAt: (\d+)', header) if m.start() != m.end(): # e.g., if match found something result_header['CreatedAtEpoch'] = m.group(1) else: @@ -584,11 +876,16 @@ def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers: putObjectCmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} object put --file {path} --cid {cid} {bearer} {user_headers}' logger.info("Cmd: %s" % putObjectCmd) - complProc = subprocess.run(putObjectCmd, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60, shell=True) - logger.info("Output: %s" % complProc.stdout) - oid = _parse_oid(complProc.stdout) - return oid + + try: + complProc = subprocess.run(putObjectCmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60, shell=True) + logger.info("Output: %s" % complProc.stdout) + oid = _parse_oid(complProc.stdout) + return oid + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + @keyword('Get Range Hash') diff --git a/robot/testsuites/integration/acl_basic_api2.robot b/robot/testsuites/integration/acl_basic_api2.robot index d6f2800..c32621e 100644 --- a/robot/testsuites/integration/acl_basic_api2.robot +++ b/robot/testsuites/integration/acl_basic_api2.robot @@ -56,7 +56,7 @@ Generate Keys Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} # Basic ACL manual page: https://neospcc.atlassian.net/wiki/spaces/NEOF/pages/362348545/NeoFS+ACL - # TODO: X - Sticky bit validation on public container!!! + # TODO: X - Sticky bit validation on public container Payment Operations @@ -84,7 +84,7 @@ Create Containers Log Create Private Container - ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x1C8C8CCC ${RULE_FOR_ALL} + ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL} Container Existing ${USER_KEY} ${PRIV_CID_GEN} Log Create Public Container @@ -92,7 +92,7 @@ Create Containers Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} Log Create Read-Only Container - ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF8CFF ${RULE_FOR_ALL} + ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF88FF ${RULE_FOR_ALL} Container Existing ${USER_KEY} ${READONLY_CID_GEN} Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} @@ -115,9 +115,9 @@ Check Private Container # Put ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - # https://github.com/nspcc-dev/neofs-node/issues/178 - ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} @@ -127,9 +127,19 @@ Check Private Container Get object from NeoFS ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Run Keyword And Expect Error * ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + Run Keyword And Expect Error * + ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + # Get Range + Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Get Range ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + # Get Range Hash Get Range Hash ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * @@ -140,7 +150,7 @@ Check Private Container # TODO: GetRange https://github.com/nspcc-dev/neofs-node/issues/179 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} Run Keyword And Expect Error * ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} @@ -184,6 +194,13 @@ Check Public Container Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + # Get Range + Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + # Get Range Hash Get Range Hash ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 Get Range Hash ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 @@ -229,7 +246,8 @@ Check Read-Only Container ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} # Get @@ -238,6 +256,13 @@ Check Read-Only Container Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + # Get Range + Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + # Get Range Hash Get Range Hash ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 Get Range Hash ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 @@ -245,7 +270,7 @@ Check Read-Only Container Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${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} + @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} diff --git a/robot/testsuites/integration/acl_bearer_api2.robot b/robot/testsuites/integration/acl_bearer_api2.robot new file mode 100644 index 0000000..e7ee400 --- /dev/null +++ b/robot/testsuites/integration/acl_bearer_api2.robot @@ -0,0 +1,229 @@ +*** Settings *** +Variables ../../variables/common.py + +Library Collections +Library ${RESOURCES}/environment.py +Library ${RESOURCES}/neo.py +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Variables *** +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_DEL} = key1=del,key2=del +${FILE_OTH_HEADER} = key1=oth,key2=oth +${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X + +*** Test cases *** +BearerToken Operations + [Documentation] Testcase to validate NeoFS operations with BearerToken. + [Tags] ACL NeoFS NeoCLI BearerToken + [Timeout] 20 min + + Generate Keys + Generate file + Prepare eACL Role rules + Check Bearer + + + +*** Keywords *** + + +Check Bearer + Check Container Inaccessible and Allow All Bearer + Check eACL Deny and Allow All Bearer + Check eACL Deny and Allow All Bearer Filter OID + + + + + + +Generate Keys + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + + ${WALLET_OTH} = Init wallet + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + + + ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 + + Set Global Variable ${USER_KEY} ${USER_KEY_GEN} + Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} + Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} + + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + + + +Create Container Public + Log Create Public Container + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x0FFFFFFF + [Return] ${PUBLIC_CID_GEN} + + +Create Container Inaccessible + Log Create Inaccessible Container + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x40000000 + [Return] ${PUBLIC_CID_GEN} + + + +Generate file + # Generate small file + ${FILE_S_GEN} = Generate file of bytes 1024 + Set Global Variable ${FILE_S} ${FILE_S_GEN} + + +Prepare eACL Role rules + Log Set eACL for different Role cases + Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all + Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all + + Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user + Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user + + Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys + Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys + + Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey + + + +Check Container Inaccessible and Allow All Bearer + ${CID} = Create Container Inaccessible + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} + + Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} + + + +Check eACL Deny and Allow All Bearer + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await + + Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + + + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + + + + + +Check eACL Deny and Allow All Bearer Filter OID + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${S_OID_USER_2} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await + + Form BearerToken file filter for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 STRING_EQUAL $Object:objectID ${S_OID_USER} + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + + + + # eacl_encoded_deny_all_user + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} + + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + + + Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + + Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user + + \ No newline at end of file diff --git a/robot/testsuites/integration/acl_extended_api2.robot b/robot/testsuites/integration/acl_extended_api2.robot new file mode 100644 index 0000000..44c239e --- /dev/null +++ b/robot/testsuites/integration/acl_extended_api2.robot @@ -0,0 +1,481 @@ +*** Settings *** +Variables ../../variables/common.py + +Library Collections +Library ${RESOURCES}/environment.py +Library ${RESOURCES}/neo.py +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Variables *** +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_DEL} = key1=del,key2=del +${FILE_OTH_HEADER} = key1=oth,key2=oth +${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X + +*** Test cases *** +Extended ACL Operations + [Documentation] Testcase to validate NeoFS operations with extended ACL. + [Tags] ACL eACL NeoFS NeoCLI + [Timeout] 20 min + + Generate Keys + Generate file + Prepare eACL Role rules + + Check Actions + Check Filters + + + +*** Keywords *** + +Check Actions + Check eACL Deny and Allow All Other + Check eACL Deny and Allow All User + Check eACL Deny and Allow All System + + #https://github.com/nspcc-dev/neofs-node/issues/212 + #Check eACL Deny All Other and Allow All Pubkey + + +Check Filters + Check eACL MatchType String Equal + Check eACL MatchType String Not Equal + + +Check eACL MatchType String Equal + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} + + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Log Set eACL for Deny GET operation with StringEqual Object ID + ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + + +# +Check eACL MatchType String Equal REMOVED TEMPORARY + Log Set eACL for Deny GET operation with StringEqual Object CID + ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID + ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} + Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000010003434944 ${CID_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object OwnerID + ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID + ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} + Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000100084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object Version + ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version + ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000756455253494f4e ${Version_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object PayloadLength + ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength + ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime + ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime + ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch + ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch + ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + + +Check eACL MatchType String Not Equal + ${CID} = Create Container Public + ${FILE_S_2} = Generate file of bytes 2048 + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + # Sleep for 1 epoch + Sleep ${NEOFS_EPOCH_TIMEOUT} + ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} + &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} + + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringNotEqual Object ID + ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + + +# +Check eACL MatchType String Not Equal REMOVED TEMPORARY + + Log Set eACL for Deny GET operation with StringEqual Object CID + ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID + ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} + Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000020003434944 ${CID_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object OwnerID + ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID + ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} + Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000200084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object Version + ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version + ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000756455253494f4e ${Version_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object PayloadLength + ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength + ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime + ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime + ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch + ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch + ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} + Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 + Sleep ${MORPH_BLOCK_TIMEOUT} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + + +Generate Keys + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + + ${WALLET_OTH} = Init wallet + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + + + ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 + + Set Global Variable ${USER_KEY} ${USER_KEY_GEN} + Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} + Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} + + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + + + +Create Container Public + Log Create Public Container + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${RULE_FOR_ALL} + [Return] ${PUBLIC_CID_GEN} + + +Generate file + # Generate small file + ${FILE_S_GEN} = Generate file of bytes 1024 + Set Global Variable ${FILE_S} ${FILE_S_GEN} + + +Prepare eACL Role rules + Log Set eACL for different Role cases + Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all + Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all + + Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user + Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user + + Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys + Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys + + Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey + + +Check eACL Deny and Allow All User + Check eACL Deny and Allow All ${USER_KEY} ${EACL_DENY_ALL_USER} ${EACL_ALLOW_ALL_USER} + + +Check eACL Deny and Allow All Other + Check eACL Deny and Allow All ${OTHER_KEY} ${EACL_DENY_ALL_OTHER} ${EACL_ALLOW_ALL_OTHER} + + +Check eACL Deny and Allow All System + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + + @{S_OBJ_H} = Create List ${S_OID_USER} + + # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment + Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + + + Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + + + Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} + + + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM} + Sleep ${MORPH_BLOCK_TIMEOUT} + + + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + Run Keyword And Expect Error * + ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Run Keyword And Expect Error * + ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + + + Run Keyword And Expect Error * + ... Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + + Run Keyword And Expect Error * + ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + Run Keyword And Expect Error * + ... Delete object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Delete object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + + + Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_SYSTEM} + Sleep ${MORPH_BLOCK_TIMEOUT} + + ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + + + Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + + Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + + Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} + + + +Check eACL Deny All Other and Allow All Pubkey + + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} + Sleep ${MORPH_BLOCK_TIMEOUT} + + Run Keyword And Expect Error * + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + + Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + +Check eACL Deny and Allow All + [Arguments] ${KEY} ${DENY_EACL} ${ALLOW_EACL} + + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + + + Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${DENY_EACL} + Sleep ${MORPH_BLOCK_TIMEOUT} + + Run Keyword And Expect Error * + ... Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + + + Set eACL ${USER_KEY} ${CID} ${ALLOW_EACL} + Sleep ${MORPH_BLOCK_TIMEOUT} + + + Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + diff --git a/robot/testsuites/integration/object_complex_api2.robot b/robot/testsuites/integration/object_complex_api2.robot index efab2bc..a670e5d 100644 --- a/robot/testsuites/integration/object_complex_api2.robot +++ b/robot/testsuites/integration/object_complex_api2.robot @@ -9,7 +9,8 @@ Library ${RESOURCES}/assertions.py Library ${RESOURCES}/neo.py *** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_OTH} = key1=2 *** Test cases *** @@ -51,9 +52,11 @@ NeoFS Simple Object Operations ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} # @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} @@ -67,17 +70,25 @@ NeoFS Simple Object Operations - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} + @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} @{S_OBJ_H} = Create List ${H_OID} + @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} h_file_read + Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read Verify file hash s_file_read ${FILE_HASH} Verify file hash h_file_read ${FILE_HASH} + Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 + Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 + + Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 + Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} @@ -96,6 +107,8 @@ NeoFS Simple Object Operations Cleanup File ${FILE} Cleanup File s_file_read Cleanup File h_file_read + Cleanup File s_get_range + Cleanup File h_get_range # 4.86192020 diff --git a/robot/testsuites/integration/object_simple_api2.robot b/robot/testsuites/integration/object_simple_api2.robot index cd35db4..d870c6e 100644 --- a/robot/testsuites/integration/object_simple_api2.robot +++ b/robot/testsuites/integration/object_simple_api2.robot @@ -2,15 +2,14 @@ Variables ../../variables/common.py Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py Library ${RESOURCES}/assertions.py Library ${RESOURCES}/neo.py *** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc - +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_OTH} = key1=2 *** Test cases *** NeoFS Simple Object Operations @@ -50,27 +49,37 @@ NeoFS Simple Object Operations ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} + @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} @{S_OBJ_H} = Create List ${H_OID} + @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} h_file_read + Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read Verify file hash s_file_read ${FILE_HASH} Verify file hash h_file_read ${FILE_HASH} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - + Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 + Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 + + Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 + Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 + + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} + Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} + Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} #Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} Sleep 2min @@ -84,6 +93,8 @@ NeoFS Simple Object Operations Cleanup File ${FILE} Cleanup File s_file_read Cleanup File h_file_read + Cleanup File s_get_range + Cleanup File h_get_range # 4.86192020 From 48813bc5199c5cce5850f332aa1313cefce141dd Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Fri, 27 Nov 2020 03:33:11 +0300 Subject: [PATCH 02/15] update --- robot/resources/lib/neofs.py | 10 +- robot/testsuites/integration/acl_basic.robot | 257 ++++++---- .../integration/acl_basic_api2.robot | 293 ----------- robot/testsuites/integration/acl_bearer.robot | 257 +++++++--- .../integration/acl_bearer_api2.robot | 229 --------- .../testsuites/integration/acl_extended.robot | 303 ++++++----- .../integration/acl_extended_api2.robot | 481 ------------------ .../integration/netmap_simple.robot | 179 ++++--- .../integration/object_complex.robot | 161 +++--- .../integration/object_complex_api2.robot | 117 ----- .../integration/object_simple.robot | 136 ++--- .../integration/object_simple_api2.robot | 103 ---- 12 files changed, 767 insertions(+), 1759 deletions(-) delete mode 100644 robot/testsuites/integration/acl_basic_api2.robot delete mode 100644 robot/testsuites/integration/acl_bearer_api2.robot delete mode 100644 robot/testsuites/integration/acl_extended_api2.robot delete mode 100644 robot/testsuites/integration/object_complex_api2.robot delete mode 100644 robot/testsuites/integration/object_simple_api2.robot diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index e4362d2..f4bc568 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -277,7 +277,7 @@ def form_bearertoken_file_for_all_ops(file_name: str, private_key: str, cid: str @keyword('Form BearerToken file filter for all ops') def form_bearertoken_file_filter_for_all_ops(file_name: str, private_key: str, cid: str, action: str, target_role: str, lifetime_exp: str, matchType: str, key: str, value: str): - # SEARCH should be allowed without filters to use GET, HEAD, DELETE, and SEARCH. + # SEARCH should be allowed without filters to use GET, HEAD, DELETE, and SEARCH? Need to clarify. eacl = get_eacl(private_key, cid) input_records = "" @@ -314,6 +314,14 @@ def form_bearertoken_file_filter_for_all_ops(file_name: str, private_key: str, c { "operation": "PUT", "action": \"""" + action + """", + "filters": [ + { + "headerType": "OBJECT", + "matchType": \"""" + matchType + """", + "key": \"""" + key + """", + "value": \"""" + value + """" + } + ], "targets": [ { "role": \"""" + target_role + """" diff --git a/robot/testsuites/integration/acl_basic.robot b/robot/testsuites/integration/acl_basic.robot index 2981ab9..c32621e 100644 --- a/robot/testsuites/integration/acl_basic.robot +++ b/robot/testsuites/integration/acl_basic.robot @@ -5,10 +5,13 @@ Variables ../../variables/common.py Library ${RESOURCES}/environment.py Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment.py +Library ${RESOURCES}/payment_neogo.py Library ${RESOURCES}/assertions.py Library ${RESOURCES}/neo.py +*** Variables *** +${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X + *** Test cases *** Basic ACL Operations @@ -18,41 +21,78 @@ Basic ACL Operations Generate Keys Create Containers + Generate file Check Private Container Check Public Container Check Read-Only Container + + *** Keywords *** Generate Keys - ${USER_KEY_GEN} = Generate Neo private key - ${OTHER_KEY_GEN} = Generate Neo private key - ${SYSTEM_KEY_GEN} = Form Privkey from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - ${SYSTEM_KEY_GEN_SN} = Form Privkey from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + + ${WALLET_OTH} = Init wallet + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 Set Global Variable ${USER_KEY} ${USER_KEY_GEN} Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} Set Global Variable ${SYSTEM_KEY_STOR_NODE} ${SYSTEM_KEY_GEN_SN} + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + # Basic ACL manual page: https://neospcc.atlassian.net/wiki/spaces/NEOF/pages/362348545/NeoFS+ACL - # TODO: X - Sticky bit validation on public container!!! + # TODO: X - Sticky bit validation on public container + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + + Create Containers # Create containers: - Log Create Private Container - ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x1C8C8CCC + + + + Log Create Private Container + ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL} Container Existing ${USER_KEY} ${PRIV_CID_GEN} Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x3FFFFFFF + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x1FFFFFFF ${RULE_FOR_ALL} Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} - Log Create Read-Only Container - ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF8CFF + Log Create Read-Only Container + ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF88FF ${RULE_FOR_ALL} Container Existing ${USER_KEY} ${READONLY_CID_GEN} Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} @@ -73,12 +113,12 @@ Check Private Container # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PRIV_CID} ${EMPTY} + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} @@ -88,52 +128,52 @@ Check Private Container Run Keyword And Expect Error * ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] + # Get Range Hash + Get Range Hash ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Get Range Hash ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + # TODO: GetRange https://github.com/nspcc-dev/neofs-node/issues/179 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} + Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} # Head - Head object ${USER_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${EMPTY} ${True} + Head object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${EMPTY} ${True} - Head object ${SYSTEM_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OBJ_PRIV} ${EMPTY} ${True} + ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + - - - # Delete - Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} + # Delete Run Keyword And Expect Error * ... Delete object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * ... Delete object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * ... Delete object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - + Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Check Public Container @@ -141,122 +181,113 @@ Check Public Container # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PUBLIC_CID} ${EMPTY} + # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment ??? + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + # https://github.com/nspcc-dev/neofs-node/issues/178 + ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} # Get Get object from NeoFS ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] + # Get Range Hash + Get Range Hash ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + Search object ${USER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} # Head - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${True} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${True} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${True} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${True} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${True} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${True} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} # Delete - Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} - Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} - Delete object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} + # https://github.com/nspcc-dev/neofs-node/issues/178 + Delete object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} + Delete object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} + Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_IR} ${EMPTY} + Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} Check Read-Only Container # Check Read Only container: # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${READONLY_CID} ${EMPTY} + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} # Get Get object from NeoFS ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] + # Get Range Hash + Get Range Hash ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} + Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} # Head - Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${True} + Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} # Delete - Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * ... Delete object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * ... Delete object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} \ No newline at end of file + ... Delete object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} + Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} \ No newline at end of file diff --git a/robot/testsuites/integration/acl_basic_api2.robot b/robot/testsuites/integration/acl_basic_api2.robot deleted file mode 100644 index c32621e..0000000 --- a/robot/testsuites/integration/acl_basic_api2.robot +++ /dev/null @@ -1,293 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - - -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py - -*** Variables *** -${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X - - -*** Test cases *** -Basic ACL Operations - [Documentation] Testcase to validate NeoFS operations with ACL. - [Tags] ACL NeoFS NeoCLI - [Timeout] 20 min - - Generate Keys - Create Containers - - Generate file - Check Private Container - Check Public Container - Check Read-Only Container - - - - - -*** Keywords *** - -Generate Keys - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} - - ${WALLET_OTH} = Init wallet - Generate wallet ${WALLET_OTH} - ${ADDR_OTH} = Dump Address ${WALLET_OTH} - ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} - - ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - - Set Global Variable ${USER_KEY} ${USER_KEY_GEN} - Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} - Set Global Variable ${SYSTEM_KEY_STOR_NODE} ${SYSTEM_KEY_GEN_SN} - - Payment Operations ${WALLET} ${ADDR} ${USER_KEY} - Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} - - # Basic ACL manual page: https://neospcc.atlassian.net/wiki/spaces/NEOF/pages/362348545/NeoFS+ACL - # TODO: X - Sticky bit validation on public container - - -Payment Operations - [Arguments] ${WALLET} ${ADDR} ${KEY} - - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} - - - - -Create Containers - # Create containers: - - - - Log Create Private Container - ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${PRIV_CID_GEN} - - Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x1FFFFFFF ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} - - Log Create Read-Only Container - ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF88FF ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${READONLY_CID_GEN} - - Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} - Set Global Variable ${PUBLIC_CID} ${PUBLIC_CID_GEN} - Set Global Variable ${READONLY_CID} ${READONLY_CID_GEN} - - -Generate file - # Generate small file - ${FILE_S_GEN} = Generate file of bytes 1024 - ${FILE_S_HASH_GEN} = Get file hash ${FILE_S_GEN} - - Set Global Variable ${FILE_S} ${FILE_S_GEN} - Set Global Variable ${FILE_S_HASH} ${FILE_S_HASH_GEN} - -Check Private Container - # Check Private: - # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). - - # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - - - - - # Get - Get object from NeoFS ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - - # Get Range - Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - # Get Range Hash - Get Range Hash ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range Hash ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - - # TODO: GetRange https://github.com/nspcc-dev/neofs-node/issues/179 - - # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - - - # Head - Head object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - - - # Delete - Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - - -Check Public Container - # Check Public: - # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). - - # Put - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment ??? - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - # https://github.com/nspcc-dev/neofs-node/issues/178 - ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - - # Get - Get object from NeoFS ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - - # Get Range - Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - - # Get Range Hash - Get Range Hash ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${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_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - - # Head - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - - - # Delete - # https://github.com/nspcc-dev/neofs-node/issues/178 - Delete object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} - Delete object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} - Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_IR} ${EMPTY} - Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} - - -Check Read-Only Container - # Check Read Only container: - - # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - - # Get - Get object from NeoFS ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - - # Get Range - Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - - # Get Range Hash - Get Range Hash ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - - # Search - @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - - - # Head - Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - - # Delete - Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} - Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} \ No newline at end of file diff --git a/robot/testsuites/integration/acl_bearer.robot b/robot/testsuites/integration/acl_bearer.robot index 3edddbb..1965cfc 100644 --- a/robot/testsuites/integration/acl_bearer.robot +++ b/robot/testsuites/integration/acl_bearer.robot @@ -5,16 +5,17 @@ Library Collections Library ${RESOURCES}/environment.py Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py - +Library ${RESOURCES}/payment_neogo.py *** Variables *** -&{FILE_USR_HEADER} = key1=1 key2='abc1' -&{FILE_USR_HEADER_DEL} = key1=del key2=del -&{FILE_OTH_HEADER} = key1=oth key2=oth +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_DEL} = key1=del,key2=del +${FILE_OTH_HEADER} = key1=oth,key2=oth +${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X *** Test cases *** -Extended ACL Operations - [Documentation] Testcase to validate NeoFS operations with extended ACL. +BearerToken Operations + [Documentation] Testcase to validate NeoFS operations with BearerToken. [Tags] ACL NeoFS NeoCLI BearerToken [Timeout] 20 min @@ -29,41 +30,69 @@ Extended ACL Operations Check Bearer - Check eACL Deny and Allow All Bearer Check Container Inaccessible and Allow All Bearer + Check eACL Deny and Allow All Bearer + Check eACL Deny and Allow All Bearer Filter OID Equal + #Check eACL Deny and Allow All Bearer Filter OID NotEqual Generate Keys - ${USER_KEY_GEN} = Generate Neo private key - ${OTHER_KEY_GEN} = Generate Neo private key - ${EACL_KEY_GEN} = Form Privkey from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de - Get Neo public key ${EACL_KEY_GEN} - ${SYSTEM_KEY_GEN} = Form Privkey from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + ${WALLET_OTH} = Init wallet + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + - ${SYSTEM_KEY_GEN_SN} = Form Privkey from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - + ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 Set Global Variable ${USER_KEY} ${USER_KEY_GEN} Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} + + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + - Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} Create Container Public Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x2FFFFFFF + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x0FFFFFFF [Return] ${PUBLIC_CID_GEN} Create Container Inaccessible Log Create Inaccessible Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x20000000 + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x40000000 [Return] ${PUBLIC_CID_GEN} @@ -76,100 +105,178 @@ Generate file Prepare eACL Role rules Log Set eACL for different Role cases - Set Global Variable ${EACL_DENY_ALL_OTHER} 0007000000020000000100000001000000030000000000020000000300000001000000030000000000020000000200000001000000030000000000020000000500000001000000030000000000020000000400000001000000030000000000020000000600000001000000030000000000020000000700000001000000030000 - Set Global Variable ${EACL_ALLOW_ALL_OTHER} 0007000000010000000100000001000000030000000000010000000300000001000000030000000000010000000200000001000000030000000000010000000500000001000000030000000000010000000400000001000000030000000000010000000600000001000000030000000000010000000700000001000000030000 - - Set Global Variable ${EACL_DENY_ALL_USER} 0007000000020000000100000001000000010000000000020000000300000001000000010000000000020000000200000001000000010000000000020000000500000001000000010000000000020000000400000001000000010000000000020000000600000001000000010000000000020000000700000001000000010000 - Set Global Variable ${EACL_ALLOW_ALL_USER} 0007000000010000000100000001000000010000000000010000000300000001000000010000000000010000000200000001000000010000000000010000000500000001000000010000000000010000000400000001000000010000000000010000000600000001000000010000000000010000000700000001000000010000 + Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all + Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all + + Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user + Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user - Set Global Variable ${EACL_DENY_ALL_SYSTEM} 0007000000020000000100000001000000020000000000020000000300000001000000020000000000020000000200000001000000020000000000020000000500000001000000020000000000020000000400000001000000020000000000020000000600000001000000020000000000020000000700000001000000020000 - Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} 0007000000010000000100000001000000020000000000010000000300000001000000020000000000010000000200000001000000020000000000010000000500000001000000020000000000010000000400000001000000020000000000010000000600000001000000020000000000010000000700000001000000020000 - + Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys + Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys - Set Global Variable ${EACL_ALLOW_ALL_Pubkey} 000e000000010000000100000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000300000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000200000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000500000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000400000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000600000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000700000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000020000000100000001000000030000000000020000000300000001000000030000000000020000000200000001000000030000000000020000000500000001000000030000000000020000000400000001000000030000000000020000000600000001000000030000000000020000000700000001000000030000 - + Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey + + Check Container Inaccessible and Allow All Bearer ${CID} = Create Container Inaccessible Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Run Keyword And Expect Error * - ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} + + Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EACL_ALLOW_ALL_USER} &{FILE_USR_HEADER} + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_USR_HEADER} Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_ALLOW_ALL_USER} @{S_OBJ_H} &{FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} ${True} - Run Keyword And Expect Error * - ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} 0:256 - Run Keyword And Expect Error * - ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} - + ... Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} + Check eACL Deny and Allow All Bearer ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER_DEL} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} @{S_OBJ_H} = Create List ${S_OID_USER} - - - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Get Range ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} - Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} - Sleep ${MORPH_BLOCK_TIMEOUT} + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await + + Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} Run Keyword And Expect Error * ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * - ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EACL_ALLOW_ALL_USER} &{FILE_OTH_HEADER} - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} local_file_eacl - Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_ALLOW_ALL_USER} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} ${True} - Get Range ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_ALLOW_ALL_USER} 0:256 - Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EACL_ALLOW_ALL_USER} + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user - -Check eACL Deny and Allow All - [Arguments] ${KEY} ${DENY_EACL} ${ALLOW_EACL} - +Check eACL Deny and Allow All Bearer Filter OID Equal + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${S_OID_USER_2} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await + + Form BearerToken file filter for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 STRING_EQUAL $Object:objectID ${S_OID_USER} + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - + # https://github.com/nspcc-dev/neofs-node/issues/215 + + Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} + + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} + + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + + + #Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + #Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user + + + + +Check eACL Deny and Allow All Bearer Filter OID NotEqual + ${CID} = Create Container Public + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${S_OID_USER_2} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} + + + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} + + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await + + Form BearerToken file filter for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 STRING_NOT_EQUAL $Object:objectID ${S_OID_USER_2} + + Run Keyword And Expect Error * + ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Run Keyword And Expect Error * + ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Run Keyword And Expect Error * + ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + + # Search is allowed. + Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} + Run Keyword And Expect Error * + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl + Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} + #Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + #Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user + + +# https://github.com/nspcc-dev/neofs-node/issues/215 +#Check eACL Deny and Allow All Bearer Filter UserHeader Equal +#Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual +#Check eACL Deny and Allow All Bearer for big object +#Check eACL Deny and Allow All Bearer Filter UserHeader Equal for big object \ No newline at end of file diff --git a/robot/testsuites/integration/acl_bearer_api2.robot b/robot/testsuites/integration/acl_bearer_api2.robot deleted file mode 100644 index e7ee400..0000000 --- a/robot/testsuites/integration/acl_bearer_api2.robot +++ /dev/null @@ -1,229 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - -Library Collections -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment_neogo.py - -*** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc -${FILE_USR_HEADER_DEL} = key1=del,key2=del -${FILE_OTH_HEADER} = key1=oth,key2=oth -${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X - -*** Test cases *** -BearerToken Operations - [Documentation] Testcase to validate NeoFS operations with BearerToken. - [Tags] ACL NeoFS NeoCLI BearerToken - [Timeout] 20 min - - Generate Keys - Generate file - Prepare eACL Role rules - Check Bearer - - - -*** Keywords *** - - -Check Bearer - Check Container Inaccessible and Allow All Bearer - Check eACL Deny and Allow All Bearer - Check eACL Deny and Allow All Bearer Filter OID - - - - - - -Generate Keys - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} - - ${WALLET_OTH} = Init wallet - Generate wallet ${WALLET_OTH} - ${ADDR_OTH} = Dump Address ${WALLET_OTH} - ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} - - - ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de - ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - - Set Global Variable ${USER_KEY} ${USER_KEY_GEN} - Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} - Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} - Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} - - Payment Operations ${WALLET} ${ADDR} ${USER_KEY} - Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} - - -Payment Operations - [Arguments] ${WALLET} ${ADDR} ${KEY} - - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} - - - - -Create Container Public - Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x0FFFFFFF - [Return] ${PUBLIC_CID_GEN} - - -Create Container Inaccessible - Log Create Inaccessible Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x40000000 - [Return] ${PUBLIC_CID_GEN} - - - -Generate file - # Generate small file - ${FILE_S_GEN} = Generate file of bytes 1024 - Set Global Variable ${FILE_S} ${FILE_S_GEN} - - -Prepare eACL Role rules - Log Set eACL for different Role cases - Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all - Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all - - Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user - Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user - - Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys - Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys - - Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey - - - -Check Container Inaccessible and Allow All Bearer - ${CID} = Create Container Inaccessible - - Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} - - Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 - - Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} - - - -Check eACL Deny and Allow All Bearer - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} - - - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} - - Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await - - Form BearerToken file for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 - - Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - - - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl - Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user - Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 - Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user - - - - - -Check eACL Deny and Allow All Bearer Filter OID - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${S_OID_USER_2} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} - - - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY} - - Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER} --await - - Form BearerToken file filter for all ops bearer_allow_all_user ${USER_KEY} ${CID} ALLOW USER 100500 STRING_EQUAL $Object:objectID ${S_OID_USER} - - Run Keyword And Expect Error * - ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - - - - # eacl_encoded_deny_all_user - Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} - - Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl - Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 - - - Search object ${USER_KEY} ${CID} ${EMPTY} bearer_allow_all_user ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user - - Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user - - \ No newline at end of file diff --git a/robot/testsuites/integration/acl_extended.robot b/robot/testsuites/integration/acl_extended.robot index f35c6bd..44c239e 100644 --- a/robot/testsuites/integration/acl_extended.robot +++ b/robot/testsuites/integration/acl_extended.robot @@ -5,12 +5,13 @@ Library Collections Library ${RESOURCES}/environment.py Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py - +Library ${RESOURCES}/payment_neogo.py *** Variables *** -&{FILE_USR_HEADER} = key1=1 key2='abc1' -&{FILE_USR_HEADER_DEL} = key1=del key2=del -&{FILE_OTH_HEADER} = key1=oth key2=oth +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_DEL} = key1=del,key2=del +${FILE_OTH_HEADER} = key1=oth,key2=oth +${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X *** Test cases *** Extended ACL Operations @@ -21,6 +22,7 @@ Extended ACL Operations Generate Keys Generate file Prepare eACL Role rules + Check Actions Check Filters @@ -32,7 +34,9 @@ Check Actions Check eACL Deny and Allow All Other Check eACL Deny and Allow All User Check eACL Deny and Allow All System - Check eACL Deny All Other and Allow All Pubkey + + #https://github.com/nspcc-dev/neofs-node/issues/212 + #Check eACL Deny All Other and Allow All Pubkey Check Filters @@ -42,22 +46,31 @@ Check Filters Check eACL MatchType String Equal ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Log Set eACL for Deny GET operation with StringEqual Object ID ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${ID_value_hex} = Convert Str to Hex Str with Len ${ID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000100024944 ${ID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await Run Keyword And Expect Error * ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + +# +Check eACL MatchType String Equal REMOVED TEMPORARY Log Set eACL for Deny GET operation with StringEqual Object CID ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} @@ -111,40 +124,45 @@ Check eACL MatchType String Equal ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - Set eACL ${USER_KEY} ${CID} 000100000002000000010001000000030000000100046b65793200062761626331270001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl Check eACL MatchType String Not Equal ${CID} = Create Container Public ${FILE_S_2} = Generate file of bytes 2048 - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} # Sleep for 1 epoch Sleep ${NEOFS_EPOCH_TIMEOUT} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} ${True} + ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Log Set eACL for Deny GET operation with StringNotEqual Object ID ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${ID_value_hex} = Convert Str to Hex Str with Len ${ID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000200024944 ${ID_value_hex} 0001000000030000 - - Sleep ${MORPH_BLOCK_TIMEOUT} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + + + + +# +Check eACL MatchType String Not Equal REMOVED TEMPORARY Log Set eACL for Deny GET operation with StringEqual Object CID ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID @@ -203,37 +221,56 @@ Check eACL MatchType String Not Equal Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - Set eACL ${USER_KEY} ${CID} 000100000002000000010001000000030000000200046b65793200062761626331270001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Generate Keys - ${USER_KEY_GEN} = Generate Neo private key - ${OTHER_KEY_GEN} = Generate Neo private key - ${EACL_KEY_GEN} = Form Privkey from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de - Get Neo public key ${EACL_KEY_GEN} - ${SYSTEM_KEY_GEN} = Form Privkey from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + ${WALLET_OTH} = Init wallet + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + - ${SYSTEM_KEY_GEN_SN} = Form Privkey from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - + ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 Set Global Variable ${USER_KEY} ${USER_KEY_GEN} Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} + + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + - Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} Create Container Public Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x2FFFFFFF + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${RULE_FOR_ALL} [Return] ${PUBLIC_CID_GEN} @@ -245,18 +282,16 @@ Generate file Prepare eACL Role rules Log Set eACL for different Role cases - Set Global Variable ${EACL_DENY_ALL_OTHER} 0007000000020000000100000001000000030000000000020000000300000001000000030000000000020000000200000001000000030000000000020000000500000001000000030000000000020000000400000001000000030000000000020000000600000001000000030000000000020000000700000001000000030000 - Set Global Variable ${EACL_ALLOW_ALL_OTHER} 0007000000010000000100000001000000030000000000010000000300000001000000030000000000010000000200000001000000030000000000010000000500000001000000030000000000010000000400000001000000030000000000010000000600000001000000030000000000010000000700000001000000030000 - - Set Global Variable ${EACL_DENY_ALL_USER} 0007000000020000000100000001000000010000000000020000000300000001000000010000000000020000000200000001000000010000000000020000000500000001000000010000000000020000000400000001000000010000000000020000000600000001000000010000000000020000000700000001000000010000 - Set Global Variable ${EACL_ALLOW_ALL_USER} 0007000000010000000100000001000000010000000000010000000300000001000000010000000000010000000200000001000000010000000000010000000500000001000000010000000000010000000400000001000000010000000000010000000600000001000000010000000000010000000700000001000000010000 + Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all + Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all + + Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user + Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user - Set Global Variable ${EACL_DENY_ALL_SYSTEM} 0007000000020000000100000001000000020000000000020000000300000001000000020000000000020000000200000001000000020000000000020000000500000001000000020000000000020000000400000001000000020000000000020000000600000001000000020000000000020000000700000001000000020000 - Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} 0007000000010000000100000001000000020000000000010000000300000001000000020000000000010000000200000001000000020000000000010000000500000001000000020000000000010000000400000001000000020000000000010000000600000001000000020000000000010000000700000001000000020000 - + Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys + Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys - Set Global Variable ${EACL_ALLOW_ALL_Pubkey} 000e000000010000000100000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000300000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000200000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000500000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000400000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000600000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000010000000700000001000000000001002103db43cba61ef948a65c20b326b9409911341436478dfdd7472c9af6b10bb60000000000020000000100000001000000030000000000020000000300000001000000030000000000020000000200000001000000030000000000020000000500000001000000030000000000020000000400000001000000030000000000020000000600000001000000030000000000020000000700000001000000030000 - + Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey Check eACL Deny and Allow All User @@ -269,35 +304,32 @@ Check eACL Deny and Allow All Other Check eACL Deny and Allow All System ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER_DEL} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + @{S_OBJ_H} = Create List ${S_OID_USER} # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - - - Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} ${True} + + Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER} ${EMPTY} - Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER} ${EMPTY} + Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM} @@ -305,9 +337,9 @@ Check eACL Deny and Allow All System Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Run Keyword And Expect Error * ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl @@ -315,20 +347,20 @@ Check eACL Deny and Allow All System ... Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * - ... Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ... Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ... Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * ... Delete object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} @@ -339,100 +371,99 @@ Check eACL Deny and Allow All System Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_SYSTEM} Sleep ${MORPH_BLOCK_TIMEOUT} + ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + + Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} ${True} + Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER} ${EMPTY} - Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER} ${EMPTY} + Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} Check eACL Deny All Other and Allow All Pubkey ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER_DEL} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} @{S_OBJ_H} = Create List ${S_OID_USER} - Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Get Range ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} Sleep ${MORPH_BLOCK_TIMEOUT} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + ... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} - Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Get Range ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} + Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} Check eACL Deny and Allow All [Arguments] ${KEY} ${DENY_EACL} ${ALLOW_EACL} ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER_DEL} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} @{S_OBJ_H} = Create List ${S_OID_USER} - Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Get Range ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + + + Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY} Set eACL ${USER_KEY} ${CID} ${DENY_EACL} Sleep ${MORPH_BLOCK_TIMEOUT} Run Keyword And Expect Error * - ... Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_USR_HEADER} + ... Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} Run Keyword And Expect Error * ... Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Run Keyword And Expect Error * - ... Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} + ... Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * - ... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} + ... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Get Range ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 + ... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * ... Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} @@ -441,10 +472,10 @@ Check eACL Deny and Allow All Sleep ${MORPH_BLOCK_TIMEOUT} - Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} &{FILE_OTH_HEADER} + Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} ${True} - Get Range ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 - Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY} + Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} + Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} diff --git a/robot/testsuites/integration/acl_extended_api2.robot b/robot/testsuites/integration/acl_extended_api2.robot deleted file mode 100644 index 44c239e..0000000 --- a/robot/testsuites/integration/acl_extended_api2.robot +++ /dev/null @@ -1,481 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - -Library Collections -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment_neogo.py - -*** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc -${FILE_USR_HEADER_DEL} = key1=del,key2=del -${FILE_OTH_HEADER} = key1=oth,key2=oth -${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X - -*** Test cases *** -Extended ACL Operations - [Documentation] Testcase to validate NeoFS operations with extended ACL. - [Tags] ACL eACL NeoFS NeoCLI - [Timeout] 20 min - - Generate Keys - Generate file - Prepare eACL Role rules - - Check Actions - Check Filters - - - -*** Keywords *** - -Check Actions - Check eACL Deny and Allow All Other - Check eACL Deny and Allow All User - Check eACL Deny and Allow All System - - #https://github.com/nspcc-dev/neofs-node/issues/212 - #Check eACL Deny All Other and Allow All Pubkey - - -Check Filters - Check eACL MatchType String Equal - Check eACL MatchType String Not Equal - - -Check eACL MatchType String Equal - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} - - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object ID - ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL $Object:objectID ${ID_value} OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL key1 1 OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl - - -# -Check eACL MatchType String Equal REMOVED TEMPORARY - Log Set eACL for Deny GET operation with StringEqual Object CID - ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID - ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} - Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000010003434944 ${CID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object OwnerID - ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID - ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000100084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object Version - ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version - ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000756455253494f4e ${Version_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object PayloadLength - ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength - ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime - ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime - ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch - ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch - ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - - -Check eACL MatchType String Not Equal - ${CID} = Create Container Public - ${FILE_S_2} = Generate file of bytes 2048 - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - # Sleep for 1 epoch - Sleep ${NEOFS_EPOCH_TIMEOUT} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} - &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} - - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringNotEqual Object ID - ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL $Object:objectID ${ID_value} OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL key1 1 OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - - -# -Check eACL MatchType String Not Equal REMOVED TEMPORARY - - Log Set eACL for Deny GET operation with StringEqual Object CID - ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID - ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} - Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000020003434944 ${CID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object OwnerID - ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID - ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000200084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object Version - ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version - ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000756455253494f4e ${Version_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object PayloadLength - ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength - ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime - ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime - ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch - ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch - ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - - -Generate Keys - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} - - ${WALLET_OTH} = Init wallet - Generate wallet ${WALLET_OTH} - ${ADDR_OTH} = Dump Address ${WALLET_OTH} - ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} - - - ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de - ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - - Set Global Variable ${USER_KEY} ${USER_KEY_GEN} - Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} - Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} - Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} - - Payment Operations ${WALLET} ${ADDR} ${USER_KEY} - Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} - - -Payment Operations - [Arguments] ${WALLET} ${ADDR} ${KEY} - - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} - - - - -Create Container Public - Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${RULE_FOR_ALL} - [Return] ${PUBLIC_CID_GEN} - - -Generate file - # Generate small file - ${FILE_S_GEN} = Generate file of bytes 1024 - Set Global Variable ${FILE_S} ${FILE_S_GEN} - - -Prepare eACL Role rules - Log Set eACL for different Role cases - Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all - Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all - - Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user - Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user - - Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys - Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys - - Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey - - -Check eACL Deny and Allow All User - Check eACL Deny and Allow All ${USER_KEY} ${EACL_DENY_ALL_USER} ${EACL_ALLOW_ALL_USER} - - -Check eACL Deny and Allow All Other - Check eACL Deny and Allow All ${OTHER_KEY} ${EACL_DENY_ALL_OTHER} ${EACL_ALLOW_ALL_OTHER} - - -Check eACL Deny and Allow All System - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - - @{S_OBJ_H} = Create List ${S_OID_USER} - - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - - Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - - - Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} - - - Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} - Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} - - - Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM} - Sleep ${MORPH_BLOCK_TIMEOUT} - - - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - - - Run Keyword And Expect Error * - ... Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} - - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} - - - Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_SYSTEM} - Sleep ${MORPH_BLOCK_TIMEOUT} - - ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - - - Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - - Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - - Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} - - Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} - Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} - - - -Check eACL Deny All Other and Allow All Pubkey - - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} - - Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} - - Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey} - Sleep ${MORPH_BLOCK_TIMEOUT} - - Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - - Put object to NeoFS ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY} - - -Check eACL Deny and Allow All - [Arguments] ${KEY} ${DENY_EACL} ${ALLOW_EACL} - - ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${D_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} - - Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - - Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} - - - Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY} - - Set eACL ${USER_KEY} ${CID} ${DENY_EACL} - Sleep ${MORPH_BLOCK_TIMEOUT} - - Run Keyword And Expect Error * - ... Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} - Run Keyword And Expect Error * - ... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Run Keyword And Expect Error * - ... Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} - - - Set eACL ${USER_KEY} ${CID} ${ALLOW_EACL} - Sleep ${MORPH_BLOCK_TIMEOUT} - - - Put object to NeoFS ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} - Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} - diff --git a/robot/testsuites/integration/netmap_simple.robot b/robot/testsuites/integration/netmap_simple.robot index 3639ce0..a69a0c7 100644 --- a/robot/testsuites/integration/netmap_simple.robot +++ b/robot/testsuites/integration/netmap_simple.robot @@ -2,12 +2,9 @@ Variables ../../variables/common.py Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment.py Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py - +Library ${RESOURCES}/payment_neogo.py *** Test cases *** @@ -16,101 +13,149 @@ NeoFS Simple Netmap [Tags] Netmap NeoFS NeoCLI [Timeout] 20 min - ${PRIV_KEY} = Generate Neo private key - ${PUB_KEY} = Get Neo public key ${PRIV_KEY} - ${ADDR} = Get Neo address ${PRIV_KEY} - - ${FILE} = Generate file of bytes 1024 - - Log Container with rule "RF 2 SELECT 2 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 2 SELECT 2 Node - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} + Generate Key and Pre-payment + Generate file - Log Container with rule "RF 1 SELECT 1 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 1 Node - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 1 ${CID} ${S_OID} + + + # https://github.com/nspcc-dev/neofs-api-go/issues/212 + # Validate Policy REP 2 IN X CBF 2 SELECT 2 FROM * AS X 2 @{EMPTY} + + Validate Policy REP 2 IN X CBF 1 SELECT 2 FROM * AS X 2 @{EMPTY} + + Validate Policy REP 3 IN X CBF 1 SELECT 3 FROM * AS X 3 @{EMPTY} + + Validate Policy REP 1 IN X CBF 1 SELECT 1 FROM * AS X 1 @{EMPTY} + + # https://github.com/nspcc-dev/neofs-api-go/issues/212 + # Validate Policy REP 1 IN X CBF 2 SELECT 1 FROM * AS X 1 @{EMPTY} + + Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EMPTY} + + Validate Policy REP 2 IN X CBF 1 SELECT 4 FROM * AS X 2 @{EMPTY} + + @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080 + Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EXPECTED} + + @{EXPECTED} = Create List s03.neofs.devenv:8080 + Validate Policy REP 1 IN LOC_PLACE CBF 1 SELECT 1 FROM LOC_SW AS LOC_PLACE FILTER Country EQ Sweden AS LOC_SW 1 @{EXPECTED} + + @{EXPECTED} = Create List s02.neofs.devenv:8080 + Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City EQ 'Saint-Petersburg' AS LOC_SPB 1 @{EXPECTED} - Log Container with rule "RF 2 SELECT 1 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 2 SELECT 1 Node - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 1 ${CID} ${S_OID} + # https://github.com/nspcc-dev/neofs-api-go/issues/215 + # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 + # Validate Policy REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK 2 @{EXPECTED} - Log Container with rule "RF 1 SELECT 4 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 4 Node - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 4 ${CID} ${S_OID} +# REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK +# REP 1 IN LOC_SPB_PLACE +# REP 1 IN LOC_MSK_PLACE +# CBF 1 +# SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE +# SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE +# FILTER City EQ 'Saint-Petersburg' AS LOC_SPB +# FILTER City EQ 'Moscow' AS LOC_MSK + + # https://github.com/nspcc-dev/neofs-api-go/issues/213 + # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080 + # Validate Policy REP 4 CBF 1 SELECT 4 FROM LOC_EU FILTER Location EQ Europe AS LOC_EU 4 @{EXPECTED} + + @{EXPECTED} = Create List s02.neofs.devenv:8080 + Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER City NE 'Moscow' AND City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_SPB 1 @{EXPECTED} + + # https://github.com/nspcc-dev/neofs-api-go/issues/213 + # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 + # Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER City NE 'Stockholm' AND City NE 'Helsinki' AS LOC_RU 2 @{EXPECTED} - Log Container with rule "RF 2 SELECT 1 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 2 SELECT 1 Node - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 1 ${CID} ${S_OID} + # https://github.com/nspcc-dev/neofs-api-go/issues/214 + # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 + # Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER Country EQ 'Russia' AS LOC_RU 2 @{EXPECTED} + + # https://github.com/nspcc-dev/neofs-api-go/issues/214 + # @{EXPECTED} = Create List s03.neofs.devenv:8080 s04.neofs.devenv:8080 + # Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU 2 @{EXPECTED} + + # Log Operation should be failed with container rule "RF 1 SELECT 6 Node" + # ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node + +*** Keywords *** - Log Container with rule "RF 1 SELECT 1 Node FILTER Country EQ GB" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 1 Node FILTER Country EQ GB - @{EXPECTED} = Create List 192.168.123.74 - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 1 ${CID} ${S_OID} - Log Container with rule "RF 1 SELECT 1 Node FILTER Country NE GB Country NE SG Country NE DE" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 1 Node FILTER Country NE GB Country NE SG Country NE DE - @{EXPECTED} = Create List 192.168.123.71 - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 1 ${CID} ${S_OID} - - - Log Container with rule "RF 1 SELECT 2 Node FILTER Country NE GB Country NE DE" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 2 Node FILTER Country NE GB Country NE DE - @{EXPECTED} = Create List 192.168.123.71 192.168.123.72 - Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} +NeoFS Simple Netmap CONTINUE1 + + Log Operation should be failed with container rule "RF 2 SELECT 2 Node FILTER Country NE GB Country NE DE" ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 2 SELECT 2 Node FILTER Country NE GB Country NE DE Container Existing ${PRIV_KEY} ${CID} Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} + ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} Log Operation should be failed with container rule "RF 3 SELECT 2 Node" ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 3 SELECT 2 Node Container Existing ${PRIV_KEY} ${CID} Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} + ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} Log Operation should be failed with container rule "RF 1 SELECT 6 Node" ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node Container Existing ${PRIV_KEY} ${CID} Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} + ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} -# Netmap: {"Epoch":916,"NetMap":[ -#{"address":"/ip4/192.168.123.74/tcp/8080","pubkey":"A4yGKVnla0PiD3kYfE/p4Lx8jGbBYD5s8Ox/h6trCNw1", -#"options":["/City:London","/Capacity:100","/Price:1","/Location:Europe","/Country:GB"],"status":0}, -#{"address":"/ip4/192.168.123.72/tcp/8080","pubkey":"A/9ltq55E0pNzp0NOdOFHpurTul6v4boHhxbvFDNKCau", -#"options":["/City:Singapore","/Capacity:100","/Price:1","/Location:Asia","/Country:SG"],"status":0}, -#{"address":"/ip4/192.168.123.71/tcp/8080","pubkey":"Aiu0BBxQ1gf/hx3sfkzXd4OI4OpoSdhMy9mqjzLhaoEx", -#"options":["/Location:NorthAmerica","/Country:US","/City:NewYork","/Capacity:100","/Price:1"],"status":0}, -#{"address":"/ip4/192.168.123.73/tcp/8080","pubkey":"AqySDNffC2GyiQcua5RuLaThoxuascYhu0deMPpKsQLD", -#"options":["/Capacity:100","/Price:1","/Location:Europe","/Country:DE","/City:Frankfurt"],"status":0}]} \ No newline at end of file + +Generate file + ${FILE} = Generate file of bytes 1024 + Set Global Variable ${FILE} ${FILE} + +Generate Key and Pre-payment + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + + Set Global Variable ${PRIV_KEY} ${USER_KEY_GEN} + + Payment Operations ${WALLET} ${ADDR} ${PRIV_KEY} + + +Payment Operations + [Arguments] ${WALLET} ${ADDR} ${KEY} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + +Validate Policy + [Arguments] ${POLICY} ${EXPECTED_VAL} @{EXPECTED_LIST} + + Log Container with rule ${POLICY} + + ${CID} = Create container ${PRIV_KEY} ${EMPTY} ${POLICY} + Container Existing ${PRIV_KEY} ${CID} + ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} + Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST} + # Can be on each of nodes + diff --git a/robot/testsuites/integration/object_complex.robot b/robot/testsuites/integration/object_complex.robot index 156d6a8..a670e5d 100644 --- a/robot/testsuites/integration/object_complex.robot +++ b/robot/testsuites/integration/object_complex.robot @@ -4,107 +4,114 @@ Variables ../../variables/common.py Library ${RESOURCES}/environment.py Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment.py +Library ${RESOURCES}/payment_neogo.py Library ${RESOURCES}/assertions.py Library ${RESOURCES}/neo.py *** Variables *** -&{FILE_USR_HEADER} = key1=1 key2='abc' +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_OTH} = key1=2 + *** Test cases *** -NeoFS Complex Object Operations - [Documentation] Testcase to validate NeoFS operations with complex object. +NeoFS Simple Object Operations + [Documentation] Testcase to validate NeoFS operations with simple object. [Tags] Object NeoFS NeoCLI - [Timeout] 15 min + [Timeout] 20 min + + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + ${BALANCE} = Wait Until Keyword Succeeds 5 min 1 min + ... Expected Balance ${PRIV_KEY} 0 50 - ${PRIV_KEY} = Generate Neo private key - ${PUB_KEY} = Get Neo public key ${PRIV_KEY} - ${ADDR} = Get Neo address ${PRIV_KEY} -# ${TX} = Request NeoFS Deposit ${PUB_KEY} -# Wait Until Keyword Succeeds 1 min 15 sec -# ... Transaction accepted in block ${TX} -# Get Transaction ${TX} -# Due to develop branch with zero-payment for container and different blockchains for payment. -# Temporarily removed. -# ${BALANCE} = Wait Until Keyword Succeeds 10 min 1 min -# ... Get Balance ${PUB_KEY} -# Expected Balance ${PUB_KEY} 0 50 ${CID} = Create container ${PRIV_KEY} Container Existing ${PRIV_KEY} ${CID} -# Due to develop branch with zero-payment for container and different blockchains for payment. -# Fail will be ignored temporarily. -# Run Keyword And Ignore Error -# ... Wait Until Keyword Succeeds 2 min 30 sec -# ... Expected Balance ${PUB_KEY} ${BALANCE} -0.00001424 + + Wait Until Keyword Succeeds 2 min 30 sec + ... Expected Balance ${PRIV_KEY} 50 -0.0007 ${SIZE} = Set Variable 20e+6 ${FILE} = Generate file of bytes ${SIZE} ${FILE_HASH} = Get file hash ${FILE} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} &{FILE_USR_HEADER} - @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} - @{Link_obj_H} = Verify linked objects ${PRIV_KEY} ${CID} ${H_OID} ${SIZE} - @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} + ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} + ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} -# Next keyword has been removed due to https://neospcc.atlassian.net/browse/NSPCC-1103 -# Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} - ${SGID} = Create storage group ${PRIV_KEY} ${CID} ${S_OID} ${H_OID} - - @{S_OBJ_SG} = Create List ${SGID} - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${SGID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} + + +# @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} +# @{Link_obj_H} = Verify linked objects ${PRIV_KEY} ${CID} ${H_OID} ${SIZE} +# @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} +# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} + + Run Keyword And Expect Error * + ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} + + + + + @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} @{S_OBJ_H} = Create List ${H_OID} + @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} - Search object ${PRIV_KEY} ${CID} --sg ${EMPTY} @{S_OBJ_SG} - Get storage group ${PRIV_KEY} ${CID} ${SGID} - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} h_file_read - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} @{S_OBJ_ALL} - # Check sub-objects + Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + + Verify file hash s_file_read ${FILE_HASH} + Verify file hash h_file_read ${FILE_HASH} - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${True} - Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${True} &{FILE_USR_HEADER} + Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 + Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 + + Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 + Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 + + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${EMPTY} @{S_OBJ_ALL} + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} - Run Keyword And Expect Error REGEXP:User header (\\w+=\\w+\\s?)+ was not found - ... Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${False} &{FILE_USR_HEADER} - - Verify file hash s_file_read ${FILE_HASH} - Verify file hash h_file_read ${FILE_HASH} - &{ID_OBJ_S} = Create Dictionary ID=${S_OID} + Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} + Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} + Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} -# Removed due to tombstones zombies. -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} --root ${EMPTY} @{EMPTY} &{ID_OBJ_S} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read_2 - - &{ID_OBJ_H} = Create Dictionary ID=${H_OID} Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${H_OID} -# Removed due to tombstones zombies. -# Search object ${PRIV_KEY} ${CID} --root ${EMPTY} @{EMPTY} &{FILE_USR_HEADER} -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} --root ${EMPTY} @{EMPTY} &{ID_OBJ_H} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} s_file_read_2 - - - &{SGID_OBJ} = Create Dictionary ID=${SGID} - Delete object ${PRIV_KEY} ${CID} ${SGID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${SGID} -# Removed due to tombstones zombies. -# Search object ${PRIV_KEY} ${CID} --sg ${EMPTY} @{EMPTY} -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{EMPTY} &{SGID_OBJ} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${SGID} ${EMPTY} s_file_read_2 + #Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} + + Sleep 2min + + Run Keyword And Expect Error * + ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + Run Keyword And Expect Error * + ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read Cleanup File ${FILE} Cleanup File s_file_read Cleanup File h_file_read - Run Keyword And Expect Error Error: 's_file_read_2' file not found - ... Cleanup File s_file_read_2 + Cleanup File s_get_range + Cleanup File h_get_range + +# 4.86192020 + + + + diff --git a/robot/testsuites/integration/object_complex_api2.robot b/robot/testsuites/integration/object_complex_api2.robot deleted file mode 100644 index a670e5d..0000000 --- a/robot/testsuites/integration/object_complex_api2.robot +++ /dev/null @@ -1,117 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py - -*** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc -${FILE_USR_HEADER_OTH} = key1=2 - - -*** Test cases *** -NeoFS Simple Object Operations - [Documentation] Testcase to validate NeoFS operations with simple object. - [Tags] Object NeoFS NeoCLI - [Timeout] 20 min - - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} - - ${BALANCE} = Wait Until Keyword Succeeds 5 min 1 min - ... Expected Balance ${PRIV_KEY} 0 50 - - ${CID} = Create container ${PRIV_KEY} - Container Existing ${PRIV_KEY} ${CID} - - Wait Until Keyword Succeeds 2 min 30 sec - ... Expected Balance ${PRIV_KEY} 50 -0.0007 - - ${SIZE} = Set Variable 20e+6 - ${FILE} = Generate file of bytes ${SIZE} - ${FILE_HASH} = Get file hash ${FILE} - - - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} - - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} - - -# @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} -# @{Link_obj_H} = Verify linked objects ${PRIV_KEY} ${CID} ${H_OID} ${SIZE} -# @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} -# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} - - Run Keyword And Expect Error * - ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - - - - - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} - @{S_OBJ_H} = Create List ${H_OID} - @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} - - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - - Verify file hash s_file_read ${FILE_HASH} - Verify file hash h_file_read ${FILE_HASH} - - Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 - Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 - - Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 - Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 - - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} - - Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} - - Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} - #Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} - - Sleep 2min - - Run Keyword And Expect Error * - ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Run Keyword And Expect Error * - ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - - Cleanup File ${FILE} - Cleanup File s_file_read - Cleanup File h_file_read - Cleanup File s_get_range - Cleanup File h_get_range - -# 4.86192020 - - - - diff --git a/robot/testsuites/integration/object_simple.robot b/robot/testsuites/integration/object_simple.robot index 4dac46b..d870c6e 100644 --- a/robot/testsuites/integration/object_simple.robot +++ b/robot/testsuites/integration/object_simple.robot @@ -2,15 +2,14 @@ Variables ../../variables/common.py Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment.py +Library ${RESOURCES}/payment_neogo.py Library ${RESOURCES}/assertions.py Library ${RESOURCES}/neo.py *** Variables *** -&{FILE_USR_HEADER} = key1=1 key2='abc' - +${FILE_USR_HEADER} = key1=1,key2=abc +${FILE_USR_HEADER_OTH} = key1=2 *** Test cases *** NeoFS Simple Object Operations @@ -18,84 +17,87 @@ NeoFS Simple Object Operations [Tags] Object NeoFS NeoCLI [Timeout] 20 min - ${PRIV_KEY} = Generate Neo private key - ${PUB_KEY} = Get Neo public key ${PRIV_KEY} - ${ADDR} = Get Neo address ${PRIV_KEY} -# ${TX} = Request NeoFS Deposit ${PUB_KEY} -# Wait Until Keyword Succeeds 1 min 15 sec -# ... Transaction accepted in block ${TX} -# Get Transaction ${TX} -# Due to develop branch with zero-payment for container and different blockchains for payment. -# Temporarily removed. -# ${BALANCE} = Wait Until Keyword Succeeds 10 min 1 min -# ... Get Balance ${PUB_KEY} -# Expected Balance ${PUB_KEY} 0 50 + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + ${BALANCE} = Wait Until Keyword Succeeds 5 min 1 min + ... Expected Balance ${PRIV_KEY} 0 50 + ${CID} = Create container ${PRIV_KEY} Container Existing ${PRIV_KEY} ${CID} -# Due to develop branch with zero-payment for container and different blockchains for payment. -# Fail will be ignored temporarily. Temporarily removed. -# Run Keyword And Ignore Error -# ... Wait Until Keyword Succeeds 2 min 30 sec -# ... Expected Balance ${PUB_KEY} ${BALANCE} -0.00001424 + + Wait Until Keyword Succeeds 2 min 30 sec + ... Expected Balance ${PRIV_KEY} 50 -0.0007 + ${FILE} = Generate file of bytes 1024 ${FILE_HASH} = Get file hash ${FILE} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} - ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} &{FILE_USR_HEADER} + + + ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} + ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} - ${SGID} = Create storage group ${PRIV_KEY} ${CID} ${S_OID} ${H_OID} - - @{S_OBJ_SG} = Create List ${SGID} - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${SGID} - @{S_OBJ_H} = Create List ${H_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} - Search object ${PRIV_KEY} ${CID} --sg ${EMPTY} @{S_OBJ_SG} - Get storage group ${PRIV_KEY} ${CID} ${SGID} - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} h_file_read - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{S_OBJ_H} &{FILE_USR_HEADER} - Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${True} - Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${True} &{FILE_USR_HEADER} - - Run Keyword And Expect Error REGEXP:User header (\\w+=\\w+\\s?)+ was not found - ... Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${False} &{FILE_USR_HEADER} - + @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} + @{S_OBJ_H} = Create List ${H_OID} + @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} + + Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read + Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read + Verify file hash s_file_read ${FILE_HASH} Verify file hash h_file_read ${FILE_HASH} - &{ID_OBJ_S} = Create Dictionary ID=${S_OID} + + Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 + Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 + + Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 + Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 + + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} + + Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} + Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} + Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} -# Removed due to tombstones zombies. -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{EMPTY} &{ID_OBJ_S} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read_2 - &{ID_OBJ_H} = Create Dictionary ID=${H_OID} Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${H_OID} + #Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} -# Removed due to tombstones zombies. -# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{EMPTY} &{FILE_USR_HEADER} -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{EMPTY} &{ID_OBJ_H} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} s_file_read_2 + Sleep 2min + + Run Keyword And Expect Error * + ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - - &{SGID_OBJ} = Create Dictionary ID=${SGID} - Delete object ${PRIV_KEY} ${CID} ${SGID} ${EMPTY} - Verify Head tombstone ${PRIV_KEY} ${CID} ${SGID} -# Removed due to tombstones zombies. -# Search object ${PRIV_KEY} ${CID} --sg ${EMPTY} @{EMPTY} -# Wait Until Keyword Succeeds 2 min 30 sec -# ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{EMPTY} &{SGID_OBJ} -# Run Keyword And Expect Error * -# ... Get object from NeoFS ${PRIV_KEY} ${CID} ${SGID} ${EMPTY} s_file_read_2 + Run Keyword And Expect Error * + ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read Cleanup File ${FILE} Cleanup File s_file_read Cleanup File h_file_read - Run Keyword And Expect Error Error: 's_file_read_2' file not found - ... Cleanup File s_file_read_2 + Cleanup File s_get_range + Cleanup File h_get_range + +# 4.86192020 + + + diff --git a/robot/testsuites/integration/object_simple_api2.robot b/robot/testsuites/integration/object_simple_api2.robot deleted file mode 100644 index d870c6e..0000000 --- a/robot/testsuites/integration/object_simple_api2.robot +++ /dev/null @@ -1,103 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py - -*** Variables *** -${FILE_USR_HEADER} = key1=1,key2=abc -${FILE_USR_HEADER_OTH} = key1=2 - -*** Test cases *** -NeoFS Simple Object Operations - [Documentation] Testcase to validate NeoFS operations with simple object. - [Tags] Object NeoFS NeoCLI - [Timeout] 20 min - - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} - - ${BALANCE} = Wait Until Keyword Succeeds 5 min 1 min - ... Expected Balance ${PRIV_KEY} 0 50 - - ${CID} = Create container ${PRIV_KEY} - Container Existing ${PRIV_KEY} ${CID} - - Wait Until Keyword Succeeds 2 min 30 sec - ... Expected Balance ${PRIV_KEY} 50 -0.0007 - - ${FILE} = Generate file of bytes 1024 - ${FILE_HASH} = Get file hash ${FILE} - - - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - ${H_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${H_OID_OTH} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH} - - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID} - Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} - - @{S_OBJ_ALL} = Create List ${S_OID} ${H_OID} ${H_OID_OTH} - @{S_OBJ_H} = Create List ${H_OID} - @{S_OBJ_H_OTH} = Create List ${H_OID_OTH} - - Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - - Verify file hash s_file_read ${FILE_HASH} - Verify file hash h_file_read ${FILE_HASH} - - Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10 - Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10 - - Get Range ${PRIV_KEY} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10 - Get Range ${PRIV_KEY} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10 - - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} - - Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} - - Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} - #Verify Head tombstone ${PRIV_KEY} ${CID} ${S_OID} - - Sleep 2min - - Run Keyword And Expect Error * - ... Get object from NeoFS ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read - - Run Keyword And Expect Error * - ... Get object from NeoFS ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read - - Cleanup File ${FILE} - Cleanup File s_file_read - Cleanup File h_file_read - Cleanup File s_get_range - Cleanup File h_get_range - -# 4.86192020 - - - - From b7a30c763dac077f3b828ef5fd5ea70fb410f281 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sat, 28 Nov 2020 06:16:10 +0300 Subject: [PATCH 03/15] update --- robot/resources/lib/assertions.py | 21 - robot/resources/lib/eacl/bearer_token | 25 -- robot/resources/lib/environment.py | 30 -- robot/resources/lib/neo.py | 62 --- robot/resources/lib/neofs.py | 2 +- robot/resources/lib/payment.py | 83 ---- robot/resources/lib/payment_neogo.py | 43 --- robot/testsuites/integration/acl_basic.robot | 239 ++++++------ robot/testsuites/integration/acl_bearer.robot | 16 +- .../testsuites/integration/acl_extended.robot | 359 ++++++------------ .../integration/netmap_simple.robot | 70 +--- .../integration/object_complex.robot | 14 +- .../integration/object_simple.robot | 8 +- .../integration/tmp/acl_basic_fix_check.robot | 235 ------------ 14 files changed, 262 insertions(+), 945 deletions(-) delete mode 100644 robot/resources/lib/assertions.py delete mode 100644 robot/resources/lib/eacl/bearer_token delete mode 100644 robot/resources/lib/environment.py delete mode 100644 robot/resources/lib/neo.py delete mode 100644 robot/resources/lib/payment.py delete mode 100644 robot/testsuites/integration/tmp/acl_basic_fix_check.robot diff --git a/robot/resources/lib/assertions.py b/robot/resources/lib/assertions.py deleted file mode 100644 index f39844d..0000000 --- a/robot/resources/lib/assertions.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/python3 - -""" -A file with specific assertions that Robot Framework -doesn't have in its builtins. -""" - -from robot.api.deco import keyword -from robot.utils.asserts import assert_equal - -@keyword('Should Be Equal as Binaries') -def sbe_as_binaries(fst: str, snd: str): - """ - Assertion to compare binary contents of - two files. Parameters: - - `fst`: path to first file - - `snd`: path to second file - """ - fst_fd, snd_fd = open(fst, 'rb'), open(snd, 'rb') - fst_bytes, snd_bytes = fst_fd.read(), snd_fd.read() - assert_equal(fst_bytes, snd_bytes, msg='Given files are not equal as binaries') diff --git a/robot/resources/lib/eacl/bearer_token b/robot/resources/lib/eacl/bearer_token deleted file mode 100644 index 2f7f746..0000000 --- a/robot/resources/lib/eacl/bearer_token +++ /dev/null @@ -1,25 +0,0 @@ -{ - "body": { - "eaclTable": { - "containerID": { - "value": "5nWjhWaME7krQsEKwwczsxAatT4SNqB1bnxKR36Szwtb" - }, - "records": [ - { - "operation": "GET", - "action": "ALLOW", - "targets": [ - { - "role": "OTHERS" - } - ] - } - ] - }, - "lifetime": { - "exp": "100500", - "nbf": "1", - "iat": "0" - } - } -} diff --git a/robot/resources/lib/environment.py b/robot/resources/lib/environment.py deleted file mode 100644 index 40c6c37..0000000 --- a/robot/resources/lib/environment.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import re -import os -import shutil -import json -import binascii -import time - - -from robot.api.deco import keyword -from robot.api import logger - -import robot.errors -import requests -import uuid -from robot.libraries.BuiltIn import BuiltIn - -ROBOT_AUTO_KEYWORDS = False - -@keyword('Prepare Environment') -def prepare_environment(): - return - - -@keyword('Cleanup Environment') -def cleanup_environment(): - return - diff --git a/robot/resources/lib/neo.py b/robot/resources/lib/neo.py deleted file mode 100644 index 92aecfb..0000000 --- a/robot/resources/lib/neo.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import re -import json -import binascii - -from robot.api.deco import keyword -from robot.api import logger - -import robot.errors -import requests - -from robot.libraries.BuiltIn import BuiltIn -from neocore.KeyPair import KeyPair - -from Crypto import Random - -ROBOT_AUTO_KEYWORDS = False -NEOFS_NEO_API_ENDPOINT = "main_chain.neofs.devenv:30333" - -@keyword('Generate Neo private key') -def generate_neo_private_key(): - """ - This function generates new random Neo private key. - Parameters: None - :rtype: 'bytes' object - """ - private_key = Random.get_random_bytes(32) - logger.info("Generated private key: %s" % binascii.hexlify(private_key)) - - return private_key - - -@keyword('Get Neo public key') -def get_neo_public_key(private_key: bytes): - """ - This function return neo public key. - Parameters: - :param private_key: neo private key - :rtype: string - """ - keypair_gen = KeyPair(bytes(private_key)) - pubkey = keypair_gen.PublicKey.encode_point(True).decode("utf-8") - logger.info("Generated public key: %s" % pubkey) - return pubkey - -@keyword('Get Neo address') -def get_neo_address(private_key: bytes): - """ - This function return neo address. - Parameters: - :param private_key: neo private key - :rtype: string - """ - keypair_gen = KeyPair(private_key) - address = keypair_gen.GetAddress() - wif = keypair_gen.Export() - logger.info("Generated Neo address: %s" % address) - logger.info("Generated WIF: %s" % wif) - return address - diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index f4bc568..4d92a95 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -8,7 +8,7 @@ import uuid import hashlib from robot.api.deco import keyword from robot.api import logger -import json + ROBOT_AUTO_KEYWORDS = False diff --git a/robot/resources/lib/payment.py b/robot/resources/lib/payment.py deleted file mode 100644 index 4fd7ff3..0000000 --- a/robot/resources/lib/payment.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import re - -from robot.api.deco import keyword -from robot.api import logger - -import logging -import robot.errors -import requests - -from robot.libraries.BuiltIn import BuiltIn -from neocore.KeyPair import KeyPair - -from Crypto import Random - -ROBOT_AUTO_KEYWORDS = False - -@keyword('Request NeoFS Deposit') -def request_neofs_deposit(public_key: str): - """ - This function requests Deposit to the selected public key. - :param public_key: neo public key - """ - - response = requests.get('https://fs.localtest.nspcc.ru/api/deposit/'+str(public_key), verify='ca/nspcc-ca.pem') - - if response.status_code != 200: - BuiltIn().fatal_error('Can not run Deposit to {} with error: {}'.format(public_key, response.text)) - else: - logger.info("Deposit has been completed for '%s'; tx: '%s'" % (public_key, response.text) ) - - return response.text - -@keyword('Get Balance') -def get_balance(public_key: str): - """ - This function returns NeoFS balance for selected public key. - :param public_key: neo public key - """ - - balance = _get_balance_request(public_key) - - return balance - -@keyword('Expected Balance') -def expected_balance(public_key: str, init_amount: float, deposit_size: float): - """ - This function returns NeoFS balance for selected public key. - :param public_key: neo public key - :param init_amount: initial number of tokens in the account - :param deposit_size: expected amount of the balance increasing - """ - - balance = _get_balance_request(public_key) - - deposit_change = round((float(balance) - init_amount),8) - if deposit_change != deposit_size: - raise Exception('Expected deposit increase: {}. This does not correspond to the actual change in account: {}'.format(deposit_size, deposit_change)) - - logger.info('Expected deposit increase: {}. This correspond to the actual change in account: {}'.format(deposit_size, deposit_change)) - - return deposit_change - - -def _get_balance_request(public_key: str): - ''' - Internal method. - ''' - response = requests.get('https://fs.localtest.nspcc.ru/api/balance/neofs/'+str(public_key)+'/', verify='ca/nspcc-ca.pem') - - if response.status_code != 200: - raise Exception('Can not get balance for {} with error: {}'.format(public_key, response.text)) - - m = re.match(r"\"+([\d.\.?\d*]+)", response.text ) - if m is None: - BuiltIn().fatal_error('Can not parse balance: "%s"' % response.text) - balance = m.group(1) - - logger.info("Balance for '%s' is '%s'" % (public_key, balance) ) - - return balance \ No newline at end of file diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index fe3ac42..39f10bb 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -16,8 +16,6 @@ import json from robot.libraries.BuiltIn import BuiltIn from neocore.KeyPair import KeyPair -from Crypto import Random - ROBOT_AUTO_KEYWORDS = False @@ -54,7 +52,6 @@ def generate_wallet(wallet: str): @keyword('Dump Address') def dump_address(wallet: str): - #"address": "Ngde6LSaBZ58p72trTNkgqEZmX8dTWBgHo", address = "" cmd = ( f"{NEOGO_CLI_PREFIX} wallet dump -w {wallet}" ) @@ -82,8 +79,6 @@ def dump_privkey(wallet: str, address: str): @keyword('Transfer Mainnet Gas') -# docker cp wallets/wallet.json main_chain:/wallets/ - def transfer_mainnet_gas(wallet: str, address: str, address_to: str, amount: int): cmd = ( f"{NEOGO_CLI_PREFIX} wallet nep5 transfer -w {wallet} -r http://main_chain.neofs.devenv:30333 --from {address} " f"--to {address_to} --token gas --amount {amount}" ) @@ -98,8 +93,6 @@ def transfer_mainnet_gas(wallet: str, address: str, address_to: str, amount: int return out @keyword('Withdraw Mainnet Gas') -# docker cp wallets/wallet.json main_chain:/wallets/ - def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int): cmd = ( f"{NEOGO_CLI_PREFIX} contract invokefunction -w {wallet} -a {address} -r http://main_chain.neofs.devenv:30333 " f"{NEOFS_CONTRACT} withdraw {scripthash} int:{amount} -- {scripthash}" ) @@ -113,8 +106,6 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int return out -# neo-go contract invokefunction -w wallets/deploy_wallet.json -a NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx -r http://main_chain.neofs.devenv:30333 -# 5f490fbd8010fd716754073ee960067d28549b7d withdraw 12b97a2206ae4b10c7e0194b7b655c32cc912057 int:10 -- 12b97a2206ae4b10c7e0194b7b655c32cc912057 @keyword('Mainnet Balance') @@ -145,10 +136,6 @@ def expected_mainnet_balance(address: str, expected: int): raise Exception(f"Expected amount ({expected}) of GAS has not been found. Found {amount}.") return True -# balance":[{"assethash":"668e0c1f9d7b70a99dd9e06eadd4c784d641afbc","amount":"50" -#curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getnep5balances", "params": ["NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx"] }' main_chain.neofs.devenv:30333 -#{"id":1,"jsonrpc":"2.0","result":{"balance":[{"assethash":"668e0c1f9d7b70a99dd9e06eadd4c784d641afbc","amount":"9237.47595500","lastupdatedblock":158}],"address":"NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx"}} - @@ -168,35 +155,8 @@ def neofs_deposit(wallet: str, address: str, scripthash: str, amount: int): tx = m.group(1) - # Sent invocation transaction - return tx - #docker exec -it main_chain \ - # neo-go contract invokefunction \ - # -w wallets/wallet.json \ - # -a NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx \ - # -r http://main_chain.${LOCAL_DOMAIN}:30333 \ - # ${NEOFS_CONTRACT_MAINCHAIN} \ - # deposit \ - # 12b97a2206ae4b10c7e0194b7b655c32cc912057 \ - # int:500 \ - # bytes: \ - # -- 12b97a2206ae4b10c7e0194b7b655c32cc912057 - -#neo-go contract invokefunction -w wallets/wallet.json -a NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx -#-r af5dc5f7e6a6efc64d679098f328027591a2e518 -#deposit 12b97a2206ae4b10c7e0194b7b655c32cc912057 int:60 bytes: -- -#12b97a2206ae4b10c7e0194b7b655c32cc912057 - - - - - -# wallet nep5 transfer -w wallets/wallet.json -r http://main_chain.neofs.devenv:30333 --from NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx -# --to NULwe3UAHckN2fzNdcVg31tDiaYtMDwANt --token gas --amount 50 - - @keyword('Transaction accepted in block') def transaction_accepted_in_block(tx_id): @@ -209,9 +169,6 @@ def transaction_accepted_in_block(tx_id): logger.info("Transaction id: %s" % tx_id) - - -# curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "getnep5transfers", "params": ["NULwe3UAHckN2fzNdcVg31tDiaYtMDwANt"] }' main_chain.neofs.devenv:30333 TX_request = 'curl -X POST '+NEO_MAINNET_ENDPOINT+' --cacert ca/nspcc-ca.pem -H \'Content-Type: application/json\' -d \'{ "jsonrpc": "2.0", "id": 5, "method": "gettransactionheight", "params": [\"'+ tx_id +'\"] }\'' logger.info(f"Executing command: {TX_request}") diff --git a/robot/testsuites/integration/acl_basic.robot b/robot/testsuites/integration/acl_basic.robot index c32621e..5174a0a 100644 --- a/robot/testsuites/integration/acl_basic.robot +++ b/robot/testsuites/integration/acl_basic.robot @@ -1,13 +1,9 @@ *** Settings *** Variables ../../variables/common.py - - -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py + Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py + *** Variables *** ${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X @@ -49,8 +45,8 @@ Generate Keys Set Global Variable ${USER_KEY} ${USER_KEY_GEN} Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} - Set Global Variable ${SYSTEM_KEY_STOR_NODE} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${SYSTEM_KEY_IR} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} Payment Operations ${WALLET} ${ADDR} ${USER_KEY} Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} @@ -83,211 +79,206 @@ Create Containers - Log Create Private Container - ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${PRIV_CID_GEN} + Log Create Private Container + ${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL} + Container Existing ${USER_KEY} ${PRIV_CID_GEN} - Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x1FFFFFFF ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} + Log Create Public Container + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x1FFFFFFF ${RULE_FOR_ALL} + Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} - Log Create Read-Only Container - ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF88FF ${RULE_FOR_ALL} - Container Existing ${USER_KEY} ${READONLY_CID_GEN} + Log Create Read-Only Container + ${READONLY_CID_GEN} = Create container ${USER_KEY} 0x1FFF88FF ${RULE_FOR_ALL} + Container Existing ${USER_KEY} ${READONLY_CID_GEN} - Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} - Set Global Variable ${PUBLIC_CID} ${PUBLIC_CID_GEN} - Set Global Variable ${READONLY_CID} ${READONLY_CID_GEN} + Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} + Set Global Variable ${PUBLIC_CID} ${PUBLIC_CID_GEN} + Set Global Variable ${READONLY_CID} ${READONLY_CID_GEN} Generate file # Generate small file - ${FILE_S_GEN} = Generate file of bytes 1024 - ${FILE_S_HASH_GEN} = Get file hash ${FILE_S_GEN} + ${FILE_S_GEN} = Generate file of bytes 1024 + ${FILE_S_HASH_GEN} = Get file hash ${FILE_S_GEN} - Set Global Variable ${FILE_S} ${FILE_S_GEN} - Set Global Variable ${FILE_S_HASH} ${FILE_S_HASH_GEN} + Set Global Variable ${FILE_S} ${FILE_S_GEN} + Set Global Variable ${FILE_S_HASH} ${FILE_S_HASH_GEN} Check Private Container # Check Private: # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ... Put object to NeoFS ${SYSTEM_KEY_IR} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY} # Get - Get object from NeoFS ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + ... Get object from NeoFS ${SYSTEM_KEY_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY_IR} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + ... Get Range ${SYSTEM_KEY_SN} ${PRIV_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash - Get Range Hash ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 Run Keyword And Expect Error * - ... Get Range Hash ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 - - # TODO: GetRange https://github.com/nspcc-dev/neofs-node/issues/179 + ... Get Range Hash ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} + Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_IR} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_SN} ${PRIV_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} # Head - Head object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} # Delete Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${SYSTEM_KEY_IR} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_STOR_NODE} ${PRIV_CID} ${S_OID_USER} ${EMPTY} - Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${SYSTEM_KEY_SN} ${PRIV_CID} ${S_OID_USER} ${EMPTY} + Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} Check Public Container - # Check Public: - # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). # Put - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment ??? - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} # https://github.com/nspcc-dev/neofs-node/issues/178 - ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_IR} = Put object to NeoFS ${SYSTEM_KEY_IR} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${EMPTY} # Get - Get object from NeoFS ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash - Get Range Hash ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_SN} ${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_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} ${S_OID_SYS_SN} ${S_OID_SYS_IR} + Search object ${USER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} + Search object ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_PRIV} # Head - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} ${EMPTY} - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} ${EMPTY} # Delete # https://github.com/nspcc-dev/neofs-node/issues/178 - Delete object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} - Delete object ${SYSTEM_KEY_STOR_NODE} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} - Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_IR} ${EMPTY} - Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} + Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_SYS_IR} ${EMPTY} + Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_SYS_SN} ${EMPTY} + Delete object ${SYSTEM_KEY_IR} ${PUBLIC_CID} ${S_OID_USER} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${PUBLIC_CID} ${S_OID_OTHER} ${EMPTY} Check Read-Only Container # Check Read Only container: # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} - ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_STOR_NODE} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + ... Put object to NeoFS ${SYSTEM_KEY_IR} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} + ${S_OID_SYS_SN} = Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${READONLY_CID} ${EMPTY} ${EMPTY} # Get - Get object from NeoFS ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read - Get object from NeoFS ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read + Get object from NeoFS ${SYSTEM_KEY_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} s_file_read # Get Range - Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_IR} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${READONLY_CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 # Get Range Hash - Get Range Hash ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 - Get Range Hash ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 + Get Range Hash ${SYSTEM_KEY_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} 0:256 # Search - @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} - Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + @{S_OBJ_RO} = Create List ${S_OID_USER} ${S_OID_SYS_SN} + Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${SYSTEM_KEY_IR} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} + Search object ${SYSTEM_KEY_SN} ${READONLY_CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_RO} # Head - Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} - Head object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} ${EMPTY} # Delete Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} + ... Delete object ${SYSTEM_KEY_IR} ${READONLY_CID} ${S_OID_USER} ${EMPTY} Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY_STOR_NODE} ${READONLY_CID} ${S_OID_USER} ${EMPTY} - Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} \ No newline at end of file + ... Delete object ${SYSTEM_KEY_SN} ${READONLY_CID} ${S_OID_USER} ${EMPTY} + Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${EMPTY} \ No newline at end of file diff --git a/robot/testsuites/integration/acl_bearer.robot b/robot/testsuites/integration/acl_bearer.robot index 1965cfc..6676b7f 100644 --- a/robot/testsuites/integration/acl_bearer.robot +++ b/robot/testsuites/integration/acl_bearer.robot @@ -2,8 +2,7 @@ Variables ../../variables/common.py Library Collections -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py + Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py @@ -33,7 +32,8 @@ Check Bearer Check Container Inaccessible and Allow All Bearer Check eACL Deny and Allow All Bearer Check eACL Deny and Allow All Bearer Filter OID Equal - #Check eACL Deny and Allow All Bearer Filter OID NotEqual + # + # Check eACL Deny and Allow All Bearer Filter OID NotEqual @@ -221,12 +221,14 @@ Check eACL Deny and Allow All Bearer Filter OID Equal ... Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} bearer_allow_all_user ${FILE_OTH_HEADER} Run Keyword And Expect Error * - ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl - Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl - Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 + ... Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_allow_all_user local_file_eacl + + # TODO: Issue - observe and validate - Do not work and with allowed search operation! + # Get object from NeoFS ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user local_file_eacl + # Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range bearer_allow_all_user 0:256 - #Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user + #Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user #Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer_allow_all_user diff --git a/robot/testsuites/integration/acl_extended.robot b/robot/testsuites/integration/acl_extended.robot index 44c239e..d0098ab 100644 --- a/robot/testsuites/integration/acl_extended.robot +++ b/robot/testsuites/integration/acl_extended.robot @@ -2,8 +2,7 @@ Variables ../../variables/common.py Library Collections -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py + Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py @@ -46,310 +45,190 @@ Check Filters Check eACL MatchType String Equal ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} - - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object ID - ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL $Object:objectID ${ID_value} OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL key1 1 OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + &{HEADER_DICT} = Parse Object System Header ${HEADER} + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl -# -Check eACL MatchType String Equal REMOVED TEMPORARY - Log Set eACL for Deny GET operation with StringEqual Object CID - ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID - ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} - Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000010003434944 ${CID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Log Set eACL for Deny GET operation with StringEqual Object ID + ${ID_value} = Get From Dictionary ${HEADER_DICT} ID + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Log Set eACL for Deny GET operation with StringEqual Object OwnerID - ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID - ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000100084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object Version - ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version - ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000756455253494f4e ${Version_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object PayloadLength - ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength - ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime - ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime - ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch - ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch - ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000001000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl Check eACL MatchType String Not Equal ${CID} = Create Container Public - ${FILE_S_2} = Generate file of bytes 2048 - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - # Sleep for 1 epoch - Sleep ${NEOFS_EPOCH_TIMEOUT} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} - &{SYS_HEADER_PARSED} = Parse Object System Header ${HEADER} - - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + ${FILE_S_2} = Generate file of bytes 2048 + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + ${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} - Log Set eACL for Deny GET operation with StringNotEqual Object ID - ${ID_value} = Get From Dictionary ${SYS_HEADER_PARSED} ID - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL $Object:objectID ${ID_value} OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + &{HEADER_DICT} = Parse Object System Header ${HEADER} + + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + + Log Set eACL for Deny GET operation with StringNotEqual Object ID + ${ID_value} = Get From Dictionary ${HEADER_DICT} ID + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL $Object:objectID ${ID_value} OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Log Set eACL for Deny GET operation with StringEqual Object Extended User Header - ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL key1 1 OTHERS - Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - - -# -Check eACL MatchType String Not Equal REMOVED TEMPORARY - - Log Set eACL for Deny GET operation with StringEqual Object CID - ${CID_value} = Get From Dictionary ${SYS_HEADER_PARSED} CID - ${CID_value_hex} = Convert Str to Hex Str with Len ${CID_value} - Set custom eACL ${USER_KEY} ${CID} 00010000000200000001000100000002000000020003434944 ${CID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object OwnerID - ${OwnerID_value} = Get From Dictionary ${SYS_HEADER_PARSED} OwnerID - ${OwnerID_value_hex} = Convert Str to Hex Str with Len ${OwnerID_value} - Set custom eACL ${USER_KEY} ${CID} 000100000002000000010001000000020000000200084f574e45525f4944 ${OwnerID_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object Version - ${Version_value} = Get From Dictionary ${SYS_HEADER_PARSED} Version - ${Version_value_hex} = Convert Str to Hex Str with Len ${Version_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000756455253494f4e ${Version_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object PayloadLength - ${Payload_value} = Get From Dictionary ${SYS_HEADER_PARSED} PayloadLength - ${Payload_value_hex} = Convert Str to Hex Str with Len ${Payload_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000e5041594c4f41445f4c454e475448 ${Payload_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtUnixTime - ${AtUnixTime_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtUnixTime - ${AtUnixTime_value_hex} = Convert Str to Hex Str with Len ${AtUnixTime_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000c435245415445445f554e4958 ${AtUnixTime_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - - - Log Set eACL for Deny GET operation with StringEqual Object CreatedAtEpoch - ${AtEpoch_value} = Get From Dictionary ${SYS_HEADER_PARSED} CreatedAtEpoch - ${AtEpoch_value_hex} = Convert Str to Hex Str with Len ${AtEpoch_value} - Set custom eACL ${USER_KEY} ${CID} 0001000000020000000100010000000200000002000d435245415445445f45504f4348 ${AtEpoch_value_hex} 0001000000030000 - Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} local_file_eacl - Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Log Set eACL for Deny GET operation with StringEqual Object Extended User Header + ${S_OID_USER_OTH} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + ${EACL_CUSTOM} = Form eACL json file eacl_custom GET DENY STRING_NOT_EQUAL key1 1 OTHERS + Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM} --await + Run Keyword And Expect Error * + ... Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER_OTH} ${EMPTY} local_file_eacl + Get object from NeoFS ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl Generate Keys ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} ${WALLET_OTH} = Init wallet - Generate wallet ${WALLET_OTH} - ${ADDR_OTH} = Dump Address ${WALLET_OTH} - ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} + Generate wallet ${WALLET_OTH} + ${ADDR_OTH} = Dump Address ${WALLET_OTH} + ${OTHER_KEY_GEN} = Dump PrivKey ${WALLET_OTH} ${ADDR_OTH} - ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de - ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 + ${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de + ${SYSTEM_KEY_GEN} = Form WIF from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 + ${SYSTEM_KEY_GEN_SN} = Form WIF from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - Set Global Variable ${USER_KEY} ${USER_KEY_GEN} - Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} - Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} - Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} - Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} + Set Global Variable ${USER_KEY} ${USER_KEY_GEN} + Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN} + Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN} + Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN} + Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN} - Payment Operations ${WALLET} ${ADDR} ${USER_KEY} - Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} + Payment Operations ${WALLET} ${ADDR} ${USER_KEY} + Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} Payment Operations - [Arguments] ${WALLET} ${ADDR} ${KEY} + [Arguments] ${WALLET} ${ADDR} ${KEY} - ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX} - Get Transaction ${TX} - Expexted Mainnet Balance ${ADDR} 55 - - ${SCRIPT_HASH} = Get ScripHash ${KEY} - - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 - Wait Until Keyword Succeeds 1 min 15 sec - ... Transaction accepted in block ${TX_DEPOSIT} - Get Transaction ${TX_DEPOSIT} + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + ${SCRIPT_HASH} = Get ScripHash ${KEY} + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} Create Container Public - Log Create Public Container - ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${RULE_FOR_ALL} + Log Create Public Container + ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${RULE_FOR_ALL} [Return] ${PUBLIC_CID_GEN} Generate file - # Generate small file - ${FILE_S_GEN} = Generate file of bytes 1024 - Set Global Variable ${FILE_S} ${FILE_S_GEN} + ${FILE_S_GEN} = Generate file of bytes 1024 + Set Global Variable ${FILE_S} ${FILE_S_GEN} Prepare eACL Role rules - Log Set eACL for different Role cases - Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all - Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all + Log Set eACL for different Role cases + Set Global Variable ${EACL_DENY_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_deny_all + Set Global Variable ${EACL_ALLOW_ALL_OTHER} robot/resources/lib/eacl/eacl_encoded_allow_all - Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user - Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user + Set Global Variable ${EACL_DENY_ALL_USER} robot/resources/lib/eacl/eacl_encoded_deny_all_user + Set Global Variable ${EACL_ALLOW_ALL_USER} robot/resources/lib/eacl/eacl_encoded_allow_all_user - Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys - Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys + Set Global Variable ${EACL_DENY_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_deny_all_sys + Set Global Variable ${EACL_ALLOW_ALL_SYSTEM} robot/resources/lib/eacl/eacl_encoded_allow_all_sys - Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey + Set Global Variable ${EACL_ALLOW_ALL_Pubkey} robot/resources/lib/eacl/eacl_encoded_allow_all_pubkey Check eACL Deny and Allow All User - Check eACL Deny and Allow All ${USER_KEY} ${EACL_DENY_ALL_USER} ${EACL_ALLOW_ALL_USER} + Check eACL Deny and Allow All ${USER_KEY} ${EACL_DENY_ALL_USER} ${EACL_ALLOW_ALL_USER} Check eACL Deny and Allow All Other - Check eACL Deny and Allow All ${OTHER_KEY} ${EACL_DENY_ALL_OTHER} ${EACL_ALLOW_ALL_OTHER} + Check eACL Deny and Allow All ${OTHER_KEY} ${EACL_DENY_ALL_OTHER} ${EACL_ALLOW_ALL_OTHER} Check eACL Deny and Allow All System ${CID} = Create Container Public - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} - ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - @{S_OBJ_H} = Create List ${S_OID_USER} + ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER} + ${D_OID_USER_S} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} + ${D_OID_USER_SN} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL} - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + @{S_OBJ_H} = Create List ${S_OID_USER} + + Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - - Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} - Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} + Head object ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} + + Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 + + Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} + Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} - Get Range ${SYSTEM_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - Get Range ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 - - Delete object ${SYSTEM_KEY} ${CID} ${D_OID_USER_S} ${EMPTY} - Delete object ${SYSTEM_KEY_SN} ${CID} ${D_OID_USER_SN} ${EMPTY} - - - Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM} - Sleep ${MORPH_BLOCK_TIMEOUT} + Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM} + Sleep ${MORPH_BLOCK_TIMEOUT} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + Run Keyword And Expect Error * + ... Put object to NeoFS ${SYSTEM_KEY_SN} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} + + Run Keyword And Expect Error * + ... Get object from NeoFS ${SYSTEM_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl + Run Keyword And Expect Error * + ... Get object from NeoFS ${SYSTEM_KEY_SN} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl - Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} - Run Keyword And Expect Error * - ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Search object ${SYSTEM_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} + Run Keyword And Expect Error * + ... Search object ${SYSTEM_KEY_SN} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} @{S_OBJ_H} Run Keyword And Expect Error * diff --git a/robot/testsuites/integration/netmap_simple.robot b/robot/testsuites/integration/netmap_simple.robot index a69a0c7..4a78eef 100644 --- a/robot/testsuites/integration/netmap_simple.robot +++ b/robot/testsuites/integration/netmap_simple.robot @@ -1,9 +1,7 @@ *** Settings *** Variables ../../variables/common.py -Library ${RESOURCES}/environment.py Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/assertions.py Library ${RESOURCES}/payment_neogo.py @@ -17,8 +15,6 @@ NeoFS Simple Netmap Generate file - - # https://github.com/nspcc-dev/neofs-api-go/issues/212 # Validate Policy REP 2 IN X CBF 2 SELECT 2 FROM * AS X 2 @{EMPTY} @@ -49,16 +45,6 @@ NeoFS Simple Netmap # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 # Validate Policy REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK 2 @{EXPECTED} - -# REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER City EQ 'Saint-Petersburg' AS LOC_SPB FILTER City EQ 'Moscow' AS LOC_MSK -# REP 1 IN LOC_SPB_PLACE -# REP 1 IN LOC_MSK_PLACE -# CBF 1 -# SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE -# SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE -# FILTER City EQ 'Saint-Petersburg' AS LOC_SPB -# FILTER City EQ 'Moscow' AS LOC_MSK - # https://github.com/nspcc-dev/neofs-api-go/issues/213 # @{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080 # Validate Policy REP 4 CBF 1 SELECT 4 FROM LOC_EU FILTER Location EQ Europe AS LOC_EU 4 @{EXPECTED} @@ -78,58 +64,26 @@ NeoFS Simple Netmap # https://github.com/nspcc-dev/neofs-api-go/issues/214 # @{EXPECTED} = Create List s03.neofs.devenv:8080 s04.neofs.devenv:8080 # Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU 2 @{EXPECTED} - - # Log Operation should be failed with container rule "RF 1 SELECT 6 Node" - # ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node + # Log Operation should be failed with container rule "RF 1 SELECT 6 Node" + # ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node *** Keywords *** - -NeoFS Simple Netmap CONTINUE1 - - - - - Log Operation should be failed with container rule "RF 2 SELECT 2 Node FILTER Country NE GB Country NE DE" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 2 SELECT 2 Node FILTER Country NE GB Country NE DE - Container Existing ${PRIV_KEY} ${CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - - - Log Operation should be failed with container rule "RF 3 SELECT 2 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 3 SELECT 2 Node - Container Existing ${PRIV_KEY} ${CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - - - Log Operation should be failed with container rule "RF 1 SELECT 6 Node" - ${CID} = Create container ${PRIV_KEY} ${EMPTY} RF 1 SELECT 6 Node - Container Existing ${PRIV_KEY} ${CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - - - - - - Generate file - ${FILE} = Generate file of bytes 1024 - Set Global Variable ${FILE} ${FILE} + ${FILE} = Generate file of bytes 1024 + Set Global Variable ${FILE} ${FILE} Generate Key and Pre-payment - ${WALLET} = Init wallet - Generate wallet ${WALLET} - ${ADDR} = Dump Address ${WALLET} - ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${USER_KEY_GEN} = Dump PrivKey ${WALLET} ${ADDR} - Set Global Variable ${PRIV_KEY} ${USER_KEY_GEN} + Set Global Variable ${PRIV_KEY} ${USER_KEY_GEN} - Payment Operations ${WALLET} ${ADDR} ${PRIV_KEY} + Payment Operations ${WALLET} ${ADDR} ${PRIV_KEY} Payment Operations @@ -155,7 +109,7 @@ Validate Policy ${CID} = Create container ${PRIV_KEY} ${EMPTY} ${POLICY} Container Existing ${PRIV_KEY} ${CID} - ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} - Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST} + ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} + Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST} # Can be on each of nodes diff --git a/robot/testsuites/integration/object_complex.robot b/robot/testsuites/integration/object_complex.robot index a670e5d..57f2172 100644 --- a/robot/testsuites/integration/object_complex.robot +++ b/robot/testsuites/integration/object_complex.robot @@ -1,12 +1,8 @@ *** Settings *** Variables ../../variables/common.py -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py *** Variables *** ${FILE_USR_HEADER} = key1=1,key2=abc @@ -31,7 +27,7 @@ NeoFS Simple Object Operations ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} - ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 Wait Until Keyword Succeeds 1 min 15 sec ... Transaction accepted in block ${TX_DEPOSIT} Get Transaction ${TX_DEPOSIT} @@ -59,10 +55,10 @@ NeoFS Simple Object Operations Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${H_OID_OTH} -# @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} -# @{Link_obj_H} = Verify linked objects ${PRIV_KEY} ${CID} ${H_OID} ${SIZE} -# @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} -# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} +# @{Link_obj_S} = Verify linked objects ${PRIV_KEY} ${CID} ${S_OID} ${SIZE} +# @{Link_obj_H} = Verify linked objects ${PRIV_KEY} ${CID} ${H_OID} ${SIZE} +# @{Full_obj_list} = Create List @{Link_obj_S} @{Link_obj_H} ${S_OID} ${H_OID} +# Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} @{Full_obj_list} Run Keyword And Expect Error * ... Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} @{S_OBJ_ALL} diff --git a/robot/testsuites/integration/object_simple.robot b/robot/testsuites/integration/object_simple.robot index d870c6e..0785599 100644 --- a/robot/testsuites/integration/object_simple.robot +++ b/robot/testsuites/integration/object_simple.robot @@ -1,11 +1,8 @@ *** Settings *** Variables ../../variables/common.py -Library ${RESOURCES}/environment.py Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py *** Variables *** ${FILE_USR_HEADER} = key1=1,key2=abc @@ -76,7 +73,7 @@ NeoFS Simple Object Operations Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER_OTH} @{S_OBJ_H_OTH} Head object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} - Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} + Head object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER} Delete object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} Delete object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} @@ -95,9 +92,6 @@ NeoFS Simple Object Operations Cleanup File h_file_read Cleanup File s_get_range Cleanup File h_get_range - -# 4.86192020 - diff --git a/robot/testsuites/integration/tmp/acl_basic_fix_check.robot b/robot/testsuites/integration/tmp/acl_basic_fix_check.robot deleted file mode 100644 index b11c801..0000000 --- a/robot/testsuites/integration/tmp/acl_basic_fix_check.robot +++ /dev/null @@ -1,235 +0,0 @@ -*** Settings *** -Variables ../../variables/common.py - - -Library ${RESOURCES}/environment.py -Library ${RESOURCES}/neo.py -Library ${RESOURCES}/neofs.py -Library ${RESOURCES}/payment.py -Library ${RESOURCES}/assertions.py -Library ${RESOURCES}/neo.py - - - -*** Variables *** -&{FILE_USR_HEADER} = key1=1 key2='abc' - - -*** Test cases *** -Basic ACL Operations - [Documentation] Testcase to validate NeoFS operations with ACL. - [Tags] ACL NeoFS NeoCLI - [Timeout] 20 min - - # Set private keys for User, Other, System - # Set private keys for each storage node - ${USER_KEY} = Generate Neo private key - ${OTHER_KEY} = Generate Neo private key - ${SYSTEM_KEY} = Form Privkey from String c428b4a06f166fde9f8afcf918194acdde35aa2612ecf42fe0c94273425ded21 - - # Set private keys for each storage node - ${NODE1_KEY} = Form Privkey from String 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 - ${NODE2_KEY} = Form Privkey from String 7befa3cd57bae15420db19fb3639db73f1683412a28271bc413129f286a0f8aa - ${NODE3_KEY} = Form Privkey from String 5dcbb7901b3a377f17e1b43542091affe1291846a4c9365ab21f6b01c72b887d - ${NODE4_KEY} = Form Privkey from String 691970fbb57476ec85f5777d948de91cf3f121688281259feb202f49f4d8e861 - - # Basic ACL manual page: https://neospcc.atlassian.net/wiki/spaces/NEOF/pages/362348545/NeoFS+ACL - - # TODO: X - Sticky bit validation on public container!!! - - - # Create containers: - ${PUB_KEY} = Get Neo public key ${USER_KEY} - ${ADDR} = Get Neo address ${USER_KEY} - - Log Create Private Container - ${PRIV_CID} = Create container ${USER_KEY} 0x1C8C8CCC - Container Existing ${USER_KEY} ${PRIV_CID} - - Log Create Public Container - ${PUBLIC_CID} = Create container ${USER_KEY} 0x3FFFFFFF - Container Existing ${USER_KEY} ${PUBLIC_CID} - - Log Create Read-Only Container - ${READONLY_CID} = Create container ${USER_KEY} 0x1FFFCCFF - Container Existing ${USER_KEY} ${READONLY_CID} - - - # Generate small file - ${FILE_S} = Generate file of bytes 1024 - ${FILE_S_HASH} = Get file hash ${FILE_S} - - # Check Private: - # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). - - # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PRIV_CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PRIV_CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PRIV_CID} - - - # Get - Get object from NeoFS ${USER_KEY} ${PRIV_CID} ${S_OID_USER} s_file_read - Run Keyword And Expect Error * - ... Get object from NeoFS ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} s_file_read - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} s_file_read - - # Get Range - Get Range ${USER_KEY} ${PRIV_CID} ${S_OID_USER} 0:256 - Run Keyword And Expect Error * - ... Get Range ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} 0:256 - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} 0:256 - - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - - - # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} - Search object ${USER_KEY} ${PRIV_CID} ${EMPTY} @{S_OBJ_PRIV} - Run Keyword And Expect Error * - ... Search object ${OTHER_KEY} ${PRIV_CID} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PRIV_CID} ${EMPTY} @{S_OBJ_PRIV} - - - # Head - Head object ${USER_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${True} - Run Keyword And Expect Error * - ... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${True} - Head object ${SYSTEM_KEY} ${PRIV_CID} ${S_OBJ_PRIV} ${True} - - - # Delete - Delete object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} - Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${PRIV_CID} ${S_OID_USER} - - - - - - # Check Public: - # Expected: User - pass, Other - fail, System(IR) - pass (+ System(Container node) - pass, Non-container node - fail). - - # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${PUBLIC_CID} - ${S_OID_OTHER} = Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${PUBLIC_CID} - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${PUBLIC_CID} - - # Get - Get object from NeoFS ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_file_read - Get object from NeoFS ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} s_file_read - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} s_file_read - - # Get Range - Get Range ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} 0:256 - Get Range ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} 0:256 - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} 0:256 - - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - - - # Search - @{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_OTHER} - Search object ${USER_KEY} ${PUBLIC_CID} ${EMPTY} @{S_OBJ_PRIV} - Search object ${OTHER_KEY} ${PUBLIC_CID} ${EMPTY} @{S_OBJ_PRIV} - Search object ${SYSTEM_KEY} ${PUBLIC_CID} ${EMPTY} @{S_OBJ_PRIV} - - - # Head - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${True} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} ${True} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} ${True} - - Head object ${USER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${True} - Head object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${True} - Head object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_OTHER} ${True} - - # Delete - Delete object ${USER_KEY} ${PUBLIC_CID} ${S_OID_USER} - Delete object ${OTHER_KEY} ${PUBLIC_CID} ${S_OID_USER} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${PUBLIC_CID} ${S_OID_USER} - - - - - - - - # Check Read Only container: - - # Put - ${S_OID_USER} = Put object to NeoFS ${USER_KEY} ${FILE_S} ${READONLY_CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${OTHER_KEY} ${FILE_S} ${READONLY_CID} - Run Keyword And Expect Error * - ... Put object to NeoFS ${SYSTEM_KEY} ${FILE_S} ${READONLY_CID} - - # Get - Get object from NeoFS ${USER_KEY} ${READONLY_CID} ${S_OID_USER} s_file_read - Get object from NeoFS ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} s_file_read - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get object from NeoFS ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} s_file_read - - # Get Range - Get Range ${USER_KEY} ${READONLY_CID} ${S_OID_USER} 0:256 - Get Range ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} 0:256 - # By discussion, IR can not make any operations instead of HEAD, SEARCH and GET RANGE HASH at the current moment - Run Keyword And Expect Error * - ... Get Range ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} 0:256 - - # TODO: GetRangeHash - # get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - # neospcc@neospcc:~/GIT/neofs-testcases$ docker exec neofs-cli neofs-cli --host 192.168.123.71:8080 --key 0fa21a94be2227916284e4b3495180d9c93d04f095fe9d5a86f22044f5c411d2 object get-range-hash --cid 4H9iChvzYdBg6qntfYUWGWCzsJFBDdo99KegefsD721Q --oid a101d078-b3d4-4325-8fe8-41dce6917097 - # invalid input - # Usage: get-range-hash --cid --oid [--bearer ] [--verify --file ] [--salt ] [: [...]] - - - # Search - @{S_OBJ_RO} = Create List ${S_OID_USER} - Search object ${USER_KEY} ${READONLY_CID} ${EMPTY} @{S_OBJ_RO} - Search object ${OTHER_KEY} ${READONLY_CID} ${EMPTY} @{S_OBJ_RO} - Search object ${SYSTEM_KEY} ${READONLY_CID} ${EMPTY} @{S_OBJ_RO} - - - # Head - Head object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} ${True} - Head object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} ${True} - Head object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} ${True} - - # Delete - Delete object ${USER_KEY} ${READONLY_CID} ${S_OID_USER} - Run Keyword And Expect Error * - ... Delete object ${OTHER_KEY} ${READONLY_CID} ${S_OID_USER} - Run Keyword And Expect Error * - ... Delete object ${SYSTEM_KEY} ${READONLY_CID} ${S_OID_USER} - - - - - - - - - From 0857de8f77f90e88fb3d58fd20b746e995094f9c Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sat, 28 Nov 2020 06:41:35 +0300 Subject: [PATCH 04/15] update --- robot/resources/lib/neofs.py | 87 +++++++--------------- robot/resources/lib/payment_neogo.py | 104 +++++++-------------------- 2 files changed, 52 insertions(+), 139 deletions(-) diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 4d92a95..39edd18 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -54,7 +54,6 @@ def get_scripthash(privkey: str): return scripthash - @keyword('Get nodes with object') def get_nodes_with_object(private_key: str, cid, oid): storage_nodes = _get_storage_nodes(private_key) @@ -140,17 +139,6 @@ def get_eacl(private_key: bytes, cid: str): - -@keyword('Convert Str to Hex Str with Len') -def conver_str_to_hex(string_convert: str): - converted = binascii.hexlify(bytes(string_convert, encoding= 'utf-8')).decode("utf-8") - prev_len_2 = '{:04x}'.format(int(len(converted)/2)) - - return str(prev_len_2)+str(converted) - - - - @keyword('Set eACL') def set_eacl(private_key: str, cid: str, eacl: str, add_keys: str = ""): @@ -504,10 +492,6 @@ def create_container(private_key: str, basic_acl:str="", rule:str="REP 2 IN X CB cid = _parse_cid(output) logger.info("Created container %s with rule '%s'" % (cid, rule)) -#$ ./bin/neofs-cli -c config.yml container create --policy rule.ql --await -#container ID: GePis2sDpYqYPh4F8vfGUqoujtNcqdXhipbLx2pKbUwX - -# REP 1 IN X CBF 1 SELECT 2 IN SAME Location FROM * AS X return cid @@ -574,11 +558,11 @@ def search_object(private_key: str, cid: str, keys: str, bearer: str, filters: s except subprocess.CalledProcessError as e: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) - +''' @keyword('Verify Head Tombstone') def verify_head_tombstone(private_key: str, cid: str, oid: str): - ObjectCmd = f'{CLI_PREFIX}neofs-cli --host {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} object head --cid {cid} --oid {oid} --full-headers' + ObjectCmd = f'neofs-cli --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} object head --cid {cid} --oid {oid} --full-headers' logger.info("Cmd: %s" % ObjectCmd) try: complProc = subprocess.run(ObjectCmd, check=True, universal_newlines=True, @@ -592,26 +576,10 @@ def verify_head_tombstone(private_key: str, cid: str, oid: str): except subprocess.CalledProcessError as e: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) +''' - - -def _exec_cli_cmd(private_key: bytes, postfix: str): - - # Get linked objects from first - ObjectCmd = f'{CLI_PREFIX}neofs-cli --raw --host {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} {postfix}' - logger.info("Cmd: %s" % ObjectCmd) - try: - complProc = subprocess.run(ObjectCmd, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=15, shell=True) - logger.info("Output: %s" % complProc.stdout) - - except subprocess.CalledProcessError as e: - raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) - - return complProc.stdout - - +''' @keyword('Verify linked objects') def verify_linked_objects(private_key: bytes, cid: str, oid: str, payload_size: float): @@ -655,6 +623,7 @@ def verify_linked_objects(private_key: bytes, cid: str, oid: str, payload_size: return child_obj_list_headers.keys() + def _check_linked_object(obj:str, child_obj_list_headers:dict, payload_size:int, payload:int, parent_id:str): output = child_obj_list_headers[obj] @@ -695,6 +664,8 @@ def _check_linked_object(obj:str, child_obj_list_headers:dict, payload_size:int, else: raise Exception("Can not get Next object ID for the object %s." % obj) +''' + @keyword('Head object') def head_object(private_key: str, cid: str, oid: str, bearer: str, user_headers:str=""): @@ -760,8 +731,6 @@ def parse_object_system_header(header: str): else: raise Exception("no PayloadLength was parsed from object header: \t%s" % output) - - # CreatedAtUnixTime m = re.search(r'Timestamp=(\d+)', header) if m.start() != m.end(): # e.g., if match found something @@ -779,26 +748,6 @@ def parse_object_system_header(header: str): logger.info("Result: %s" % result_header) return result_header - - -@keyword('Parse Object Extended Header') -def parse_object_extended_header(header: str): - result_header = dict() - - - pattern = re.compile(r'- Type=(\w+)\n.+Value=(.+)\n') - - - for (f_type, f_val) in re.findall(pattern, header): - logger.info("found: %s - %s" % (f_type, f_val)) - if f_type not in result_header.keys(): - result_header[f_type] = [] - - result_header[f_type].append(f_val) - - logger.info("Result: %s" % result_header) - return result_header - @keyword('Delete object') def delete_object(private_key: str, cid: str, oid: str, bearer: str): @@ -830,7 +779,7 @@ def verify_file_hash(filename, expected_hash): else: raise Exception("File hash '{}' is not equal to {}".format(file_hash, expected_hash)) - +''' @keyword('Create storage group') def create_storage_group(private_key: bytes, cid: str, *objects_list): objects = "" @@ -856,7 +805,8 @@ def get_storage_group(private_key: bytes, cid: str, sgid: str): logger.info("Output: %s" % complProc.stdout) except subprocess.CalledProcessError as e: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) - +''' + @keyword('Cleanup File') # remove temp files @@ -930,6 +880,23 @@ def get_object(private_key: str, cid: str, oid: str, bearer_token: str, read_obj raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + +def _exec_cli_cmd(private_key: bytes, postfix: str): + + # Get linked objects from first + ObjectCmd = f'{CLI_PREFIX}neofs-cli --raw --host {NEOFS_ENDPOINT} --key {binascii.hexlify(private_key).decode()} {postfix}' + logger.info("Cmd: %s" % ObjectCmd) + try: + complProc = subprocess.run(ObjectCmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=15, shell=True) + logger.info("Output: %s" % complProc.stdout) + + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + return complProc.stdout + + def _get_file_hash(filename): blocksize = 65536 hash = hashlib.md5() diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index 39f10bb..401cfa9 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -31,7 +31,7 @@ def init_wallet(): cmd = ( f"{NEOGO_CLI_PREFIX} wallet init -w {filename}" ) logger.info(f"Executing shell command: {cmd}") - out = run_sh(cmd) + out = _run_sh(cmd) logger.info(f"Command completed with output: {out}") return filename @@ -56,7 +56,7 @@ def dump_address(wallet: str): cmd = ( f"{NEOGO_CLI_PREFIX} wallet dump -w {wallet}" ) logger.info(f"Executing command: {cmd}") - out = run_sh(cmd) + out = _run_sh(cmd) logger.info(f"Command completed with output: {out}") m = re.search(r'"address": "(\w+)"', out) @@ -72,7 +72,7 @@ def dump_privkey(wallet: str, address: str): cmd = ( f"{NEOGO_CLI_PREFIX} wallet export -w {wallet} --decrypt {address}" ) logger.info(f"Executing command: {cmd}") - out = run_sh_with_passwd('', cmd) + out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") return out @@ -84,7 +84,7 @@ def transfer_mainnet_gas(wallet: str, address: str, address_to: str, amount: int f"--to {address_to} --token gas --amount {amount}" ) logger.info(f"Executing command: {cmd}") - out = run_sh_with_passwd('', cmd) + out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") if not re.match(r'^(\w{64})$', out): @@ -98,7 +98,7 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int f"{NEOFS_CONTRACT} withdraw {scripthash} int:{amount} -- {scripthash}" ) logger.info(f"Executing command: {cmd}") - out = run_sh_with_passwd('', cmd) + out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") #if not re.match(r'^(\w{64})$', out): @@ -107,7 +107,6 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int return out - @keyword('Mainnet Balance') def mainnet_balance(address: str): request = 'curl -X POST '+NEO_MAINNET_ENDPOINT+' --cacert ca/nspcc-ca.pem -H \'Content-Type: application/json\' -d \'{ "jsonrpc": "2.0", "id": 5, "method": "getnep5balances", "params": [\"'+address+'\"] }\'' @@ -127,6 +126,7 @@ def mainnet_balance(address: str): return amount + @keyword('Expexted Mainnet Balance') def expected_mainnet_balance(address: str, expected: int): @@ -138,7 +138,6 @@ def expected_mainnet_balance(address: str, expected: int): return True - @keyword('NeoFS Deposit') def neofs_deposit(wallet: str, address: str, scripthash: str, amount: int): cmd = ( f"{NEOGO_CLI_PREFIX} contract invokefunction -w {wallet} -a {address} " @@ -146,7 +145,7 @@ def neofs_deposit(wallet: str, address: str, scripthash: str, amount: int): f"deposit {scripthash} int:{amount} bytes: -- {scripthash}") logger.info(f"Executing command: {cmd}") - out = run_sh_with_passwd('', cmd) + out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") m = re.match(r'^Sent invocation transaction (\w{64})$', out) @@ -200,71 +199,6 @@ def get_transaction(tx_id: str): logger.info(complProc.stdout) - - - - - - - - -def run_sh(args): - complProc = subprocess.run(args, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - timeout=150, shell=True) - output, errors = complProc.stdout, complProc.stderr - if errors: - return errors - return output - - -def run_sh_with_passwd(passwd, cmd): - p = pexpect.spawn(cmd) - p.expect(".*") - p.sendline(passwd) - 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): - -# -# Cmd = f'docker exec -it main_chain neo-go wallet nep5 transfer -w wallets/wallet.json -r http://main_chain.neofs.devenv:30333 --from NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx --to {wallet_to} --token gas --amount {amount}' -# command = ['docker', 'exec', '-it', 'main_chain', 'neo-go', 'wallet', 'nep5', 'transfer', '-w', 'wallets/wallet.json', '-r', 'http://main_chain.neofs.devenv:30333', '--from NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx', '--to', 'NULwe3UAHckN2fzNdcVg31tDiaYtMDwANt', '--token gas', '--amount', '5'] - - - -# logger.info("Cmd: %s" % Cmd) - -#import subprocess -#command = ['myapp', '--arg1', 'value_for_arg1'] -#p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) -#output = p.communicate(input='some data'.encode())[0] - -#a=subprocess.Popen("docker run -t -i fedora bash", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) -#4. >>> a.stdin.write("exit\n") -#5. >>> print a.poll() - - complProc = subprocess.Popen(Cmd.split(), stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) - complProc.stdin.write("\n".encode()) - - output = complProc.stdout.read() #.communicate(input=''.encode())[0] - - logger.info("Output: %s" % output) - - -#from subprocess import Popen, PIPE -#p = Popen(['python test_enter.py'], stdin=PIPE, shell=True) -#p.communicate(input='\n') - - - @keyword('Request NeoFS Deposit') def request_neofs_deposit(public_key: str): """ @@ -333,11 +267,23 @@ def _get_balance_request(privkey: str): return balance - + +def _run_sh(args): + complProc = subprocess.run(args, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + timeout=150, shell=True) + output, errors = complProc.stdout, complProc.stderr + if errors: + return errors + return output - # {"id":5,"jsonrpc":"2.0","result":{"txid":"0x02c178803258a9dbbcce80acfece2f6abb4f51c122e7ce2ddcad332d6a810e5f","trigger":"Application", - # !!!!!!!!!!! - #"vmstate":"FAULT" - # !!!!!!!!!!! - #,"gasconsumed":"11328110","stack":[],"notifications":[]}} \ No newline at end of file +def _run_sh_with_passwd(passwd, cmd): + p = pexpect.spawn(cmd) + p.expect(".*") + p.sendline(passwd) + p.wait() + # throw a string with password prompt + # take a string with tx hash + tx_hash = p.read().splitlines()[-1] + return tx_hash.decode() From 61358128bd75f475069addc6108c7b1b5c787085 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 01:16:52 +0300 Subject: [PATCH 05/15] update readme --- README.md | 58 ++++++++++++++++++++++++---- robot/resources/lib/payment_neogo.py | 1 - 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2184a54..f3d244f 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,22 @@ +## Запуск тесткейсов ### Локальный запуск тесткейсов + 1. Устаносить зависимости (только для первого запуска): - pip3 install robotframework - - pip3 install neocore + - pip3 install pexpect - pip3 install requests (pip3 заменить на соответсвующий менеджер пакетов python в системе). При этом должен быть запущен dev-env с тестируемым окружением. -Из корня dev-env выполнить команду: -``` -docker cp wallets/wallet.json main_chain:/wallets/ -``` - 2. Выпольнить `make run` 3. Логи будут доступны в папке artifacts/ после завершения тестов с любым из статусов. ### Запуск произвольного тесткейса + Для запуска произвольного тесткейса нужно выполнить команду: `robot --timestampoutputs --outputdir artifacts/ robot/testsuites/integration/.robot ` @@ -28,8 +26,8 @@ docker cp wallets/wallet.json main_chain:/wallets/ * object_complex.robot - операции над простым объектом * object_simple.robot - операции над большим объектом - ### Запуск тесткейсов в докере + 1. Задать переменные окружения для работы с dev-env: ``` export REG_USR= @@ -49,5 +47,49 @@ docker cp wallets/wallet.json main_chain:/wallets/ Для этого достаточно задать переменные окружения перед запуском `make build`. ``` export BUILD_NEOFS_NODE= -export BUILD_CLI= ``` + +## Создание тесткейсов + +### Source code overview + +`robot/` - Files related/depended on Robot Framework. + +`robot/resources/` - All resources (Robot Framework Keywords, Python Libraries, etc) which could be used for creating test suites. + +`robot/resources/lib/` - Common Python Libraries depended on Robot Framework (with Keywords). For example neofs.py, payment.py. + +`robot/variables/` - All variables for tests. It is possible to add the auto-loading logic of parameters from the smart-contract in the future. Contain python files. + +`robot/testsuites/` - Robot Test Suites and Test Cases. + +`robot/testsuites/integration/` - Integration test suites and test cases + +`robot/testsuites/fi/` - Fault Injection test suites and test cases + +## Code style + +Robot Framework keyword should use space as a separator between particular words + +The name of the library function in Robot Framework keyword usage and the name of the same function in the Python library must be identical. + +The name of GLOBAL VARIABLE must be in UPPER CASE, the underscore ('_')' symbol must be used as a separator between words. + +The name of local variable must be in lower case, the underscore symbol must be used as a separator between words. + +The names of Python variables, functions and classes must comply with accepted rules, in particular: +Name of variable/function must be in lower case with underscore symbol between words +Name of class must start with a capital letter. It is not allowed to use underscore symbol in name, use capital for each particular word. +For example: NeoFSConf + +Name of other variables should not be ended with underscore symbol + +On keywords definition, one should specify variable type, e.g. path: str + +## Robot style + +Следует всегда заполнять секции [Tags] и [Documentation] для Testcase'ов и Documentation для Test Suite'ов. + +## Robot-framework User Guide + +http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html \ No newline at end of file diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index 401cfa9..6c532d5 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -14,7 +14,6 @@ import requests import json from robot.libraries.BuiltIn import BuiltIn -from neocore.KeyPair import KeyPair ROBOT_AUTO_KEYWORDS = False From d31de2a9ef3d08e6e7aec4137ff637289e38256e Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 02:17:36 +0300 Subject: [PATCH 06/15] update --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f3d244f..8f03263 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,19 @@ export BUILD_NEOFS_NODE= ``` +### Генерация документации + +Для генерации документации по шагам: +``` +python3 -m robot.libdoc robot/resources/lib/neofs.py docs/NeoFS_Library.html +python3 -m robot.libdoc robot/resources/lib/payment_neogo.py docs/Payment_Library.html +``` + +Для генерации документации по тесткейсам: +``` +python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html +``` + ## Создание тесткейсов ### Source code overview From 8774839dbef5d3d677196a353fc77cd12a2f7198 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 03:46:53 +0300 Subject: [PATCH 07/15] update --- README.md | 6 +++--- robot/resources/lib/payment_neogo.py | 26 +++++++------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 8f03263..df1f71e 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html `robot/testsuites/fi/` - Fault Injection test suites and test cases -## Code style +### Code style Robot Framework keyword should use space as a separator between particular words @@ -99,10 +99,10 @@ Name of other variables should not be ended with underscore symbol On keywords definition, one should specify variable type, e.g. path: str -## Robot style +### Robot style Следует всегда заполнять секции [Tags] и [Documentation] для Testcase'ов и Documentation для Test Suite'ов. -## Robot-framework User Guide +### Robot-framework User Guide http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html \ No newline at end of file diff --git a/robot/resources/lib/payment_neogo.py b/robot/resources/lib/payment_neogo.py index 6c532d5..9c2ae85 100644 --- a/robot/resources/lib/payment_neogo.py +++ b/robot/resources/lib/payment_neogo.py @@ -100,10 +100,13 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int out = _run_sh_with_passwd('', cmd) logger.info(f"Command completed with output: {out}") - #if not re.match(r'^(\w{64})$', out): - # raise Exception("Can not get Tx.") + m = re.match(r'^Sent invocation transaction (\w{64})$', out) + if m is None: + raise Exception("Can not get Tx.") + + tx = m.group(1) - return out + return tx @keyword('Mainnet Balance') @@ -127,7 +130,7 @@ def mainnet_balance(address: str): @keyword('Expexted Mainnet Balance') -def expected_mainnet_balance(address: str, expected: int): +def expected_mainnet_balance(address: str, expected: float): amount = mainnet_balance(address) @@ -198,21 +201,6 @@ def get_transaction(tx_id: str): logger.info(complProc.stdout) -@keyword('Request NeoFS Deposit') -def request_neofs_deposit(public_key: str): - """ - This function requests Deposit to the selected public key. - :param public_key: neo public key - """ - - response = requests.get('https://fs.localtest.nspcc.ru/api/deposit/'+str(public_key), verify='ca/nspcc-ca.pem') - - if response.status_code != 200: - BuiltIn().fatal_error('Can not run Deposit to {} with error: {}'.format(public_key, response.text)) - else: - logger.info("Deposit has been completed for '%s'; tx: '%s'" % (public_key, response.text) ) - - return response.text @keyword('Get Balance') def get_balance(privkey: str): From 0ae124ca23965f3cbcb1f74ce9424ad6840f93f7 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 03:51:38 +0300 Subject: [PATCH 08/15] update --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df1f71e..961e3f0 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,13 @@ `robot --timestampoutputs --outputdir artifacts/ robot/testsuites/integration/.robot ` Для запуска доступны следущие сценарии: + * acl_basic.robot - базовый ACL - * acl_extended.robot - extended ACL + * acl_extended.robot - extended + * acl_baearer.robot - Bearer Token ACL * object_complex.robot - операции над простым объектом * object_simple.robot - операции над большим объектом + * withdraw.robot - оперция Deposit и Withdraw с счета NeoFS ### Запуск тесткейсов в докере From b4d6546616319d8211dfcbb809f88d1902f04fc4 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 03:53:14 +0300 Subject: [PATCH 09/15] update --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 961e3f0..d171e57 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ * object_complex.robot - операции над простым объектом * object_simple.robot - операции над большим объектом * withdraw.robot - оперция Deposit и Withdraw с счета NeoFS + * netmap_simple.robot - проверка Placement policy ### Запуск тесткейсов в докере From cad0eb4184d45871336f2e0bde6ef24ef0855a21 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 03:53:41 +0300 Subject: [PATCH 10/15] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d171e57..1ab6d57 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Для запуска доступны следущие сценарии: * acl_basic.robot - базовый ACL - * acl_extended.robot - extended + * acl_extended.robot - extended ACL * acl_baearer.robot - Bearer Token ACL * object_complex.robot - операции над простым объектом * object_simple.robot - операции над большим объектом From 54df07fde75dccbf067ca70ceeaa18d2e9efd6a6 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 06:44:38 +0300 Subject: [PATCH 11/15] update --- Dockerfile | 2 +- robot/resources/lib/neofs.py | 68 ++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 439675a..af07a7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN addgroup nobody root && \ RUN pip3 install wheel RUN pip3 install robotframework -RUN pip3 install neocore +RUN pip3 install pexpect RUN pip3 install requests diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 39edd18..6626267 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -8,6 +8,7 @@ import uuid import hashlib from robot.api.deco import keyword from robot.api import logger +import random ROBOT_AUTO_KEYWORDS = False @@ -44,7 +45,6 @@ def get_scripthash(privkey: str): output = complProc.stdout logger.info("Output: %s" % output) - # ScriptHash3.0 00284fc88f8ac31f8e56c03301bfab0757e3f212 m = re.search(r'ScriptHash3.0 (\w+)', output) if m.start() != m.end(): scripthash = m.group(1) @@ -54,8 +54,53 @@ def get_scripthash(privkey: str): return scripthash +@keyword('Stop nodes') +def stop_nodes(down_num: int, *nodes_list): + + # select nodes to stop from list + stop_nodes = random.sample(nodes_list, down_num) + + for node in stop_nodes: + m = re.search(r'(s\d+).', node) + node = m.group(1) + + Cmd = f'docker stop {node}' + logger.info("Cmd: %s" % Cmd) + + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) + output = complProc.stdout + logger.info("Output: %s" % output) + + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + return stop_nodes + + +@keyword('Start nodes') +def start_nodes(*nodes_list): + + for node in nodes_list: + m = re.search(r'(s\d+).', node) + node = m.group(1) + + Cmd = f'docker start {node}' + logger.info("Cmd: %s" % Cmd) + + try: + complProc = subprocess.run(Cmd, check=True, universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True) + output = complProc.stdout + logger.info("Output: %s" % output) + + except subprocess.CalledProcessError as e: + raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) + + @keyword('Get nodes with object') -def get_nodes_with_object(private_key: str, cid, oid): +def get_nodes_with_object(private_key: str, cid: str, oid: str): storage_nodes = _get_storage_nodes(private_key) copies = 0 @@ -68,10 +113,11 @@ def get_nodes_with_object(private_key: str, cid, oid): nodes_list.append(node) logger.info("Nodes with object: %s" % nodes_list) + return nodes_list @keyword('Get nodes without object') -def get_nodes_without_object(private_key: str, cid, oid): +def get_nodes_without_object(private_key: str, cid: str, oid: str): storage_nodes = _get_storage_nodes(private_key) copies = 0 @@ -85,7 +131,8 @@ def get_nodes_without_object(private_key: str, cid, oid): else: nodes_list.append(node) - logger.info("Nodes with object: %s" % nodes_list) + logger.info("Nodes without object: %s" % nodes_list) + return nodes_list @keyword('Validate storage policy for object') @@ -970,12 +1017,14 @@ def _get_storage_nodes(private_key: bytes): def _search_object(node:str, private_key: str, cid:str, oid: str): # --filters objectID={oid} - Cmd = f'{CLI_PREFIX}neofs-cli --rpc-endpoint {node} --key {private_key} --ttl 1 object search --root --cid {cid} ' + if oid: + oid_cmd = "--oid %s" % oid + Cmd = f'{CLI_PREFIX}neofs-cli --rpc-endpoint {node} --key {private_key} --ttl 1 object search --root --cid {cid} {oid_cmd}' try: logger.info(Cmd) complProc = subprocess.run(Cmd, check=True, universal_newlines=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=15, shell=True) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=30, shell=True) logger.info("Output: %s" % complProc.stdout) if re.search(r'%s' % oid, complProc.stdout): @@ -984,8 +1033,13 @@ def _search_object(node:str, private_key: str, cid:str, oid: str): logger.info("Object is not found.") except subprocess.CalledProcessError as e: + if re.search(r'local node is outside of object placement', e.output): - logger.info("Server is not presented in container.") + logger.error("Server is not presented in container.") + + if ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ): + logger.warn("Node is unavailable") + else: raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) From f4d1f0b0fc971730aff633711f30dfe0d2193283 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 06:54:18 +0300 Subject: [PATCH 12/15] fix --- robot/resources/lib/neofs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 6626267..5f0baa4 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -1037,7 +1037,7 @@ def _search_object(node:str, private_key: str, cid:str, oid: str): if re.search(r'local node is outside of object placement', e.output): logger.error("Server is not presented in container.") - if ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ): + elif ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ): logger.warn("Node is unavailable") else: From 9e786f385d78f92b384c571f6c31a6ad0247730f Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 07:23:56 +0300 Subject: [PATCH 13/15] update --- robot/resources/lib/neofs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 5f0baa4..775a22b 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -1035,7 +1035,7 @@ def _search_object(node:str, private_key: str, cid:str, oid: str): except subprocess.CalledProcessError as e: if re.search(r'local node is outside of object placement', e.output): - logger.error("Server is not presented in container.") + logger.warn("Server is not presented in container.") elif ( re.search(r'timed out after 30 seconds', e.output) or re.search(r'no route to host', e.output) ): logger.warn("Node is unavailable") From 017fedffed0b86f5fe7b7b14d5bb9588679108a3 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 07:28:01 +0300 Subject: [PATCH 14/15] update --- README.md | 1 + .../testsuites/integration/replication.robot | 45 +++++++++++++++++++ robot/testsuites/integration/withdraw.robot | 45 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 robot/testsuites/integration/replication.robot create mode 100644 robot/testsuites/integration/withdraw.robot diff --git a/README.md b/README.md index 1ab6d57..ea5566a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ * object_simple.robot - операции над большим объектом * withdraw.robot - оперция Deposit и Withdraw с счета NeoFS * netmap_simple.robot - проверка Placement policy + * replication.robot - базовый тесткейс проверки репликации объектов ### Запуск тесткейсов в докере diff --git a/robot/testsuites/integration/replication.robot b/robot/testsuites/integration/replication.robot new file mode 100644 index 0000000..9e74500 --- /dev/null +++ b/robot/testsuites/integration/replication.robot @@ -0,0 +1,45 @@ +*** Settings *** +Variables ../../variables/common.py + +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Test cases *** +NeoFS Simple Object Operations + [Documentation] Testcase to validate NeoFS Withdraw operation. + [Tags] Withdraw NeoFS NeoCLI + [Timeout] 10 min + + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + Sleep 1 min + + ${CID} = Create container ${PRIV_KEY} ${EMPTY} REP 2 IN X CBF 1 SELECT 4 FROM * AS X + Container Existing ${PRIV_KEY} ${CID} + + ${FILE} = Generate file of bytes 1024 + ${FILE_HASH} = Get file hash ${FILE} + + ${S_OID} = Put object to NeoFS ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} + @{NODES_OBJ} = Get nodes with object ${PRIV_KEY} ${CID} ${S_OID} + @{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ} + Sleep 1 min + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} + Start nodes @{NODES_OBJ_STOPPED} \ No newline at end of file diff --git a/robot/testsuites/integration/withdraw.robot b/robot/testsuites/integration/withdraw.robot new file mode 100644 index 0000000..359cdc0 --- /dev/null +++ b/robot/testsuites/integration/withdraw.robot @@ -0,0 +1,45 @@ +*** Settings *** +Variables ../../variables/common.py + +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Test cases *** +NeoFS Simple Object Operations + [Documentation] Testcase to validate NeoFS Withdraw operation. + [Tags] Withdraw NeoFS NeoCLI + [Timeout] 10 min + + ${WALLET} = Init wallet + Generate wallet ${WALLET} + ${ADDR} = Dump Address ${WALLET} + ${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR} + + ${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + Sleep 1 min + + Expexted Mainnet Balance ${ADDR} 4.86192020 + ${NEOFS_BALANCE} = Get Balance ${PRIV_KEY} + + ${TX} = Withdraw Mainnet Gas ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + + Sleep 1 min + Get Balance ${PRIV_KEY} + Expected Balance ${PRIV_KEY} ${NEOFS_BALANCE} -50 + Expexted Mainnet Balance ${ADDR} 54.82554860 + + From e0cf6f3a2b74b563fc20371ad5e94c4e673f55e8 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 07:30:45 +0300 Subject: [PATCH 15/15] update --- robot/testsuites/integration/replication.robot | 6 +++--- robot/testsuites/integration/withdraw.robot | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/robot/testsuites/integration/replication.robot b/robot/testsuites/integration/replication.robot index 9e74500..9e300a2 100644 --- a/robot/testsuites/integration/replication.robot +++ b/robot/testsuites/integration/replication.robot @@ -5,9 +5,9 @@ Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py *** Test cases *** -NeoFS Simple Object Operations - [Documentation] Testcase to validate NeoFS Withdraw operation. - [Tags] Withdraw NeoFS NeoCLI +NeoFS Object Replication + [Documentation] Testcase to validate NeoFS object replication. + [Tags] Migration Replication NeoFS NeoCLI [Timeout] 10 min ${WALLET} = Init wallet diff --git a/robot/testsuites/integration/withdraw.robot b/robot/testsuites/integration/withdraw.robot index 359cdc0..7d60ee2 100644 --- a/robot/testsuites/integration/withdraw.robot +++ b/robot/testsuites/integration/withdraw.robot @@ -5,7 +5,7 @@ Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py *** Test cases *** -NeoFS Simple Object Operations +NeoFS Deposit and Withdraw [Documentation] Testcase to validate NeoFS Withdraw operation. [Tags] Withdraw NeoFS NeoCLI [Timeout] 10 min