Refactored Head object operation: removed placeholders for optional

parameters; JSON output set as a default

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2022-03-15 14:58:59 +03:00 committed by Anastasia Prasolova
parent 0ef41a8495
commit d66ae5b7fc
28 changed files with 710 additions and 722 deletions

View file

@ -11,6 +11,7 @@ import random
import uuid
import docker
import base58
from functools import reduce
from neo3 import wallet
from common import *
@ -24,6 +25,7 @@ ROBOT_AUTO_KEYWORDS = False
NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli')
# TODO: move to neofs-keywords
@keyword('Get ScriptHash')
def get_scripthash(wif: str):
acc = wallet.Account.from_wif(wif, '')
@ -186,7 +188,7 @@ def container_existing(private_key: str, cid: str):
@keyword('Search object')
def search_object(private_key: str, cid: str, keys: str, bearer: str, filters: str,
def search_object(private_key: str, cid: str, keys: str="", bearer: str="", filters: dict={},
expected_objects_list=[], options:str=""):
bearer_token = ""
filters_result = ""
@ -194,9 +196,10 @@ def search_object(private_key: str, cid: str, keys: str, bearer: str, filters: s
if bearer:
bearer_token = f"--bearer {bearer}"
if filters:
for filter_item in filters.split(','):
filter_item = re.sub(r'=', ' EQ ', filter_item)
filters_result += f"--filters '{filter_item}' "
filters_result += "--filters "
logger.info(filters)
for k, v in filters.items():
filters_result += f"'{k} EQ {v}' "
object_cmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --wallet {private_key} '
@ -224,7 +227,8 @@ def get_component_objects(private_key: str, cid: str, oid: str):
split_id = ""
for node in NEOFS_NETMAP:
try:
header_virtual = head_object(private_key, cid, oid, '', '', '--raw --ttl 1', node, True)
header_virtual = head_object(private_key, cid, oid, options=' --ttl 1',
endpoint=node, is_raw=True)
if header_virtual:
parsed_header_virtual = parse_object_virtual_raw_header(header_virtual)
@ -243,8 +247,7 @@ def get_component_objects(private_key: str, cid: str, oid: str):
# Search expected Linking object
for targer_oid in full_obj_list:
header = head_object(private_key, cid, targer_oid, '', '', '--raw')
header_parsed = _get_raw_split_information(header)
header_parsed = head_object(private_key, cid, targer_oid, is_raw=True)
if header_parsed['Split ID'] == split_id and 'Split ChildID' in header_parsed.keys():
logger.info("Linking object has been found in additional check (head of all objects).")
return _collect_split_objects_from_header(private_key, cid, parsed_header_virtual)
@ -252,13 +255,12 @@ def get_component_objects(private_key: str, cid: str, oid: str):
raise Exception("Linking object is not found at all - all existed objects have been headed.")
def _collect_split_objects_from_header(private_key, cid, parsed_header):
header_link = head_object(private_key, cid, parsed_header['Linking object'], '', '', '--raw')
header_link_parsed = _get_raw_split_information(header_link)
header_link_parsed = head_object(private_key, cid, parsed_header['Linking object'], is_raw=True)
return header_link_parsed['Split ChildID']
@keyword('Verify Split Chain')
def verify_split_chain(private_key: str, cid: str, oid: str):
def verify_split_chain(wif: str, cid: str, oid: str):
header_virtual_parsed = dict()
header_last_parsed = dict()
@ -272,24 +274,25 @@ def verify_split_chain(private_key: str, cid: str, oid: str):
logger.info("Collect Split objects information and verify chain of the objects.")
for node in NEOFS_NETMAP:
try:
header_virtual = head_object(private_key, cid, oid, '', '', '--raw --ttl 1', node, True)
header_virtual = head_object(wif, cid, oid, options=' --ttl 1',
endpoint=node, json_output=False, is_raw=True)
parsed_header_virtual = parse_object_virtual_raw_header(header_virtual)
if 'Last object' in parsed_header_virtual.keys():
header_last = head_object(private_key, cid,
header_last = head_object(wif, cid,
parsed_header_virtual['Last object'],
'', '', '--raw')
is_raw=True, json_output=False)
header_last_parsed = _get_raw_split_information(header_last)
marker_last_obj = 1
# Recursive chain validation up to the first object
final_verif_data = _verify_child_link(private_key, cid, oid, header_last_parsed, final_verif_data)
final_verif_data = _verify_child_link(wif, cid, oid, header_last_parsed, final_verif_data)
break
logger.info(f"Found Split Object with header:\n\t{parsed_header_virtual}")
logger.info("Continue to search Last Split Object")
except RuntimeError as e:
logger.info(f"Failed while collectiong Split Objects: {e}")
except Exception as exc:
logger.info(f"Failed while collectiong Split Objects: {exc}")
continue
if marker_last_obj == 0:
@ -297,15 +300,15 @@ def verify_split_chain(private_key: str, cid: str, oid: str):
# Get Linking object
logger.info("Compare Split objects result information with Linking object.")
for node in nodes:
for node in NEOFS_NETMAP:
try:
header_virtual = head_object(private_key, cid, oid, '', '', '--raw --ttl 1', node, True)
header_virtual = head_object(wif, cid, oid, options=' --ttl 1',
endpoint=node, json_output=False, is_raw=True)
parsed_header_virtual = parse_object_virtual_raw_header(header_virtual)
if 'Linking object' in parsed_header_virtual.keys():
header_link = head_object(private_key, cid,
header_link = head_object(wif, cid,
parsed_header_virtual['Linking object'],
'', '', '--raw')
is_raw=True, json_output=False)
header_link_parsed = _get_raw_split_information(header_link)
marker_link_obj = 1
@ -348,7 +351,7 @@ def verify_split_chain(private_key: str, cid: str, oid: str):
logger.info("Compare Split objects result information with Virtual object.")
header_virtual = head_object(private_key, cid, oid, '', '', '')
header_virtual = head_object(wif, cid, oid, json_output=False)
header_virtual_parsed = _get_raw_split_information(header_virtual)
if int(header_virtual_parsed['PayloadLength']) == int(final_verif_data['PayloadLength']):
@ -364,40 +367,6 @@ def verify_split_chain(private_key: str, cid: str, oid: str):
else:
raise Exception("Object Type is not 'regular'.")
return 1
def _verify_child_link(private_key: str, cid: str, oid: str, header_last_parsed: dict, final_verif_data: dict):
if 'PayloadLength' in final_verif_data.keys():
final_verif_data['PayloadLength'] = int(final_verif_data['PayloadLength']) + int(header_last_parsed['PayloadLength'])
else:
final_verif_data['PayloadLength'] = int(header_last_parsed['PayloadLength'])
if header_last_parsed['Type'] != 'regular':
raise Exception("Object Type is not 'regular'.")
if 'Split ID' in final_verif_data.keys():
if final_verif_data['Split ID'] != header_last_parsed['Split ID']:
raise Exception(f"Object Split ID ({header_last_parsed['Split ID']}) is not expected ({final_verif_data['Split ID']}).")
else:
final_verif_data['Split ID'] = header_last_parsed['Split ID']
if 'ID List' in final_verif_data.keys():
final_verif_data['ID List'].append(header_last_parsed['ID'])
else:
final_verif_data['ID List'] = []
final_verif_data['ID List'].append(header_last_parsed['ID'])
if 'Split PreviousID' in header_last_parsed.keys():
header_virtual = head_object(private_key, cid, header_last_parsed['Split PreviousID'], '', '', '--raw')
parsed_header_virtual = _get_raw_split_information(header_virtual)
final_verif_data = _verify_child_link(private_key, cid, oid, parsed_header_virtual, final_verif_data)
else:
logger.info("Chain of the objects has been parsed from the last object ot the first.")
return final_verif_data
def _get_raw_split_information(header):
result_header = dict()
@ -450,6 +419,40 @@ def _get_raw_split_information(header):
return result_header
def _verify_child_link(wif: str, cid: str, oid: str, header_last_parsed: dict, final_verif_data: dict):
if 'PayloadLength' in final_verif_data.keys():
final_verif_data['PayloadLength'] = int(final_verif_data['PayloadLength']) + int(header_last_parsed['PayloadLength'])
else:
final_verif_data['PayloadLength'] = int(header_last_parsed['PayloadLength'])
if header_last_parsed['Type'] != 'regular':
raise Exception("Object Type is not 'regular'.")
if 'Split ID' in final_verif_data.keys():
if final_verif_data['Split ID'] != header_last_parsed['Split ID']:
raise Exception(f"Object Split ID ({header_last_parsed['Split ID']}) is not expected ({final_verif_data['Split ID']}).")
else:
final_verif_data['Split ID'] = header_last_parsed['Split ID']
if 'ID List' in final_verif_data.keys():
final_verif_data['ID List'].append(header_last_parsed['ID'])
else:
final_verif_data['ID List'] = []
final_verif_data['ID List'].append(header_last_parsed['ID'])
if 'Split PreviousID' in header_last_parsed.keys():
header_virtual = head_object(wif, cid, header_last_parsed['Split PreviousID'], is_raw=True, json_output=False)
parsed_header_virtual = _get_raw_split_information(header_virtual)
final_verif_data = _verify_child_link(wif, cid, oid, parsed_header_virtual, final_verif_data)
else:
logger.info("Chain of the objects has been parsed from the last object ot the first.")
return final_verif_data
@keyword('Verify Head Tombstone')
def verify_head_tombstone(private_key: str, cid: str, oid_ts: str, oid: str, addr: str):
object_cmd = (
@ -504,29 +507,62 @@ def _json_cli_decode(data: str):
@keyword('Head object')
def head_object(private_key: str, cid: str, oid: str, bearer_token: str="",
user_headers:str="", options:str="", endpoint: str="", json_output: bool = False):
options:str="", endpoint: str="", json_output: bool = True,
is_raw: bool = False):
if bearer_token:
bearer_token = f"--bearer {bearer_token}"
if endpoint == "":
endpoint = NEOFS_ENDPOINT
object_cmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --wallet {private_key} object '
f'head --cid {cid} --oid {oid} {bearer_token} {options} {"--json" if json_output else ""}'
cmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint if endpoint else NEOFS_ENDPOINT} '
f'--wallet {private_key} '
f'object head --cid {cid} --oid {oid} {options} '
f'{"--bearer " + bearer_token if bearer_token else ""} '
f'{"--json" if json_output else ""} '
f'{"--raw" if is_raw else ""}'
)
logger.info(f"Cmd: {object_cmd}")
output = _cmd_run(object_cmd)
logger.info(f"cmd: {cmd}")
output = _cmd_run(cmd)
if json_output:
decoded = json.loads(output)
output = _decode_json_output(decoded)
if user_headers:
for key in user_headers.split(","):
if re.search(fr'({key})', output):
logger.info(f"User header {key} was parsed from command output")
else:
raise Exception(f"User header {key} was not found in the command output: \t{output}")
return output
def _decode_json_output(data: dict):
'''
We get JSON output as an automatically decoded structure from
protobuf. Some fields are decoded with boilerplates and binary
values are Base64-encoded.
This function rearranges the structure and reencodes binary
data from Base64 to Base58.
Args:
data (dict): a dictionary which neofs-cli returns to reencode.
Returns:
dict: dictionary which contains data in a more organized form.
'''
try:
# reencoding binary IDs
data["objectID"] = _json_cli_decode(data["objectID"]["value"])
data["header"]["containerID"] = _json_cli_decode(data["header"]["containerID"]["value"])
data["header"]["ownerID"] = _json_cli_decode(data["header"]["ownerID"]["value"])
data["header"]["homomorphicHash"] = _json_cli_decode(data["header"]["homomorphicHash"]["sum"])
data["header"]["payloadHash"] = _json_cli_decode(data["header"]["payloadHash"]["sum"])
data["header"]["version"] = f"{data['header']['version']['major']}{data['header']['version']['minor']}"
# object attributes view normalization
ugly_attrs = data["header"]["attributes"]
data["header"]["attributes"] = {}
for attr in ugly_attrs:
data["header"]["attributes"][attr["key"]] = attr["value"]
except Exception as exc:
raise RuntimeError(f"failed to decode JSON output: {exc}") from exc
return data
@keyword('Get container attributes')
def get_container_attributes(private_key: str, cid: str, endpoint: str="", json_output: bool = False):
@ -541,6 +577,8 @@ def get_container_attributes(private_key: str, cid: str, endpoint: str="", json_
output = _cmd_run(container_cmd)
return output
# TODO: replace with JSON parser when https://github.com/nspcc-dev/neofs-node/issues/1233
# is done
@keyword('Parse Object Virtual Raw Header')
def parse_object_virtual_raw_header(header: str):
result_header = dict()
@ -560,99 +598,6 @@ def parse_object_virtual_raw_header(header: str):
result_header['Last object'] = m.group(1)
logger.info(f"Result: {result_header}")
return result_header
@keyword('Decode Object System Header Json')
def decode_object_system_header_json(header):
result_header = dict()
json_header = json.loads(header)
# Header - Constant attributes
# ID
oid = json_header["objectID"]["value"]
if oid is not None:
result_header["ID"] = _json_cli_decode(oid)
else:
raise Exception(f"no ID was parsed from header: \t{header}" )
# CID
cid = json_header["header"]["containerID"]["value"]
if cid is not None:
result_header["CID"] = _json_cli_decode(cid)
else:
raise Exception(f"no CID was parsed from header: \t{header}")
# OwnerID
owner_id = json_header["header"]["ownerID"]["value"]
if owner_id is not None:
result_header["OwnerID"] = _json_cli_decode(owner_id)
else:
raise Exception(f"no OwnerID was parsed from header: \t{header}")
# CreatedAtEpoch
created_at_epoch = json_header["header"]["creationEpoch"]
if created_at_epoch is not None:
result_header["CreatedAtEpoch"] = created_at_epoch
else:
raise Exception(f"no CreatedAtEpoch was parsed from header: \t{header}")
# PayloadLength
payload_length = json_header["header"]["payloadLength"]
if payload_length is not None:
result_header["PayloadLength"] = payload_length
else:
raise Exception(f"no PayloadLength was parsed from header: \t{header}")
# HomoHash
homo_hash = json_header["header"]["homomorphicHash"]["sum"]
if homo_hash is not None:
homo_hash_64_d = base64.b64decode(homo_hash)
homo_hash_bytes = binascii.hexlify(homo_hash_64_d)
result_header["HomoHash"] = bytes.decode(homo_hash_bytes)
else:
raise Exception(f"no HomoHash was parsed from header: \t{header}")
# PayloadHash
payload_hash = json_header["header"]["payloadHash"]["sum"]
if payload_hash is not None:
payload_hash_64_d = base64.b64decode(payload_hash)
payload_hash_bytes = binascii.hexlify(payload_hash_64_d)
result_header["PayloadHash"] = bytes.decode(payload_hash_bytes)
else:
raise Exception(f"no Checksum was parsed from header: \t{header}")
# Type
object_type = json_header["header"]["objectType"]
if object_type is not None:
result_header["Type"] = object_type
else:
raise Exception(f"no Type was parsed from header: \t{header}")
# Version
version = json_header["header"]["version"]
if version is not None:
version_full = f'v{version["major"]}.{version["minor"]}'
result_header["Version"] = version_full
else:
raise Exception(f"no version was parsed from header: \t{header}" )
# Header - Optional attributes
# Attributes
attributes = []
attribute_list = json_header["header"]["attributes"]
if attribute_list is not None:
for e in attribute_list:
values_list = list(e.values())
attribute = values_list[0] + '=' + values_list[1]
attributes.append(attribute)
result_header["Attributes"] = attributes
else:
raise Exception(f"no Attributes were parsed from header: \t{header}")
return result_header
@keyword('Decode Container Attributes Json')
@ -674,17 +619,8 @@ def decode_container_attributes_json(header):
return result_header
@keyword('Verify Head Attribute')
def verify_head_attribute(header, attribute):
attribute_list = header["Attributes"]
if (attribute in attribute_list):
logger.info(f"Attribute {attribute} is found")
else:
raise Exception(f"Attribute {attribute} was not found")
@keyword('Delete object')
def delete_object(private_key: str, cid: str, oid: str, bearer: str, options: str=""):
def delete_object(private_key: str, cid: str, oid: str, bearer: str="", options: str=""):
bearer_token = ""
if bearer:
bearer_token = f"--bearer {bearer}"
@ -718,39 +654,41 @@ def get_file_hash(filename : str):
return file_hash
@keyword('Verify file hash')
def verify_file_hash(filename, expected_hash):
file_hash = _get_file_hash(filename)
if file_hash == expected_hash:
logger.info(f"Hash is equal to expected: {file_hash}")
else:
raise Exception(f"File hash '{file_hash}' is not equal to {expected_hash}")
@keyword('Put object')
def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers: str="",
def put_object(private_key: str, path: str, cid: str, bearer: str="", user_headers: dict={},
endpoint: str="", options: str="" ):
logger.info("Going to put the object")
if not endpoint:
endpoint = random.sample(NEOFS_NETMAP, 1)[0]
if user_headers:
user_headers = f"--attributes {user_headers}"
if bearer:
bearer = f"--bearer {bearer}"
putobject_cmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --wallet {private_key} object '
f'put --no-progress --file {path} --cid {cid} {bearer} {user_headers} {options}'
f'put --no-progress --file {path} --cid {cid} {bearer} {options} '
f'{"--attributes " + _dict_to_attrs(user_headers) if user_headers else ""}'
)
logger.info(f"Cmd: {putobject_cmd}")
logger.info(f"cmd: {putobject_cmd}")
output = _cmd_run(putobject_cmd)
oid = _parse_oid(output)
return oid
def _dict_to_attrs(attrs: dict):
'''
This function takes dictionary of object attributes and converts them
into the string. The string is passed to `--attibutes` key of the
neofs-cli.
Args:
attrs (dict): object attirbutes in {"a": "b", "c": "d"} format.
Returns:
(str): string in "a=b,c=d" format.
'''
return reduce(lambda a,b: f"{a},{b}", map(lambda i: f"{i}={attrs[i]}", attrs))
@keyword('Get control endpoint with wif')
def get_control_endpoint_with_wif(endpoint_number: str = ''):
if endpoint_number == '':
@ -853,9 +791,11 @@ def get_range_hash(private_key: str, cid: str, oid: str, bearer_token: str,
@keyword('Get object')
def get_object(private_key: str, cid: str, oid: str, bearer_token: str,
write_object: str, endpoint: str="", options: str="" ):
def get_object(private_key: str, cid: str, oid: str, bearer_token: str="",
write_object: str="", endpoint: str="", options: str="" ):
if not write_object:
write_object = str(uuid.uuid4())
file_path = f"{ASSETS_DIR}/{write_object}"
logger.info("Going to get the object")

View file

@ -2,11 +2,6 @@
Variables common.py
Variables wellknown_acl.py
*** Variables ***
${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth
*** Keywords ***
Create Container Public
[Arguments] ${USER_KEY}

View file

@ -10,9 +10,9 @@ Resource common_steps_acl_basic.robot
Resource payment_operations.robot
*** Variables ***
${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
${OBJECT_PATH} = testfile
${EACL_ERR_MSG} = *
@ -40,20 +40,20 @@ Generate files
Check eACL Deny and Allow All
[Arguments] ${KEY} ${DENY_EACL} ${ALLOW_EACL} ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${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}
Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${KEY} ${CID} ${S_OID_USER}
Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
@ -61,37 +61,37 @@ Check eACL Deny and Allow All
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Run Keyword And Expect Error *
... Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Run Keyword And Expect Error *
... Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Run Keyword And Expect Error *
... Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Delete object ${KEY} ${CID} ${S_OID_USER}
Set eACL ${USER_KEY} ${CID} ${ALLOW_EACL}
# The current ACL cache lifetime is 30 sec
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Get object ${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
Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search object ${KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${KEY} ${CID} ${S_OID_USER}
Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${KEY} ${CID} ${S_OID_USER}
Compose eACL Custom
[Arguments] ${HEADER_DICT} ${MATCH_TYPE} ${FILTER} ${ACCESS} ${ROLE}
${filter_value} = Get From dictionary ${HEADER_DICT} ${EACL_OBJ_FILTERS}[${FILTER}]
${filter_value} = Get From dictionary ${HEADER_DICT}[header] ${EACL_OBJ_FILTERS}[${FILTER}]
${filters} = Create Dictionary headerType=OBJECT matchType=${MATCH_TYPE} key=${FILTER} value=${filter_value}
${rule_get}= Create Dictionary Operation=GET Access=${ACCESS} Role=${ROLE} Filters=${filters}
@ -102,59 +102,58 @@ Compose eACL Custom
${rule_range}= Create Dictionary Operation=GETRANGE Access=${ACCESS} Role=${ROLE} Filters=${filters}
${rule_rangehash}= Create Dictionary Operation=GETRANGEHASH Access=${ACCESS} Role=${ROLE} Filters=${filters}
${eACL_gen}= Create List ${rule_get} ${rule_head} ${rule_put} ${rule_del}
${eACL_gen}= Create List ${rule_get} ${rule_head} ${rule_put} ${rule_del}
... ${rule_search} ${rule_range} ${rule_rangehash}
${EACL_CUSTOM} = Form eACL JSON Common File ${eACL_gen}
[Return] ${EACL_CUSTOM}
Object Header Decoded
[Arguments] ${USER_KEY} ${CID} ${S_OID_USER}
[Arguments] ${USER_KEY} ${CID} ${OID}
${HEADER} = Head Object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} json_output=True
&{HEADER_DICT} = Decode Object System Header Json ${HEADER}
&{HEADER} = Head Object ${USER_KEY} ${CID} ${OID}
[Return] &{HEADER_DICT}
[Return] &{HEADER}
Check eACL Filters with MatchType String Equal
[Arguments] ${FILTER}
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
${CID} = Create Container Public ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID}
@{S_OBJ_H} = Create List ${S_OID_USER}
Get Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search Object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Head Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
Search Object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head Object ${OTHER_KEY} ${CID} ${S_OID_USER}
Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete Object ${OTHER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete Object ${OTHER_KEY} ${CID} ${D_OID_USER}
&{HEADER_DICT} = Object Header Decoded ${USER_KEY} ${CID} ${S_OID_USER}
${EACL_CUSTOM} = Compose eACL Custom ${HEADER_DICT} STRING_EQUAL ${FILTER} DENY OTHERS
Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM}
IF 'GET' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
IF 'GET' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${OBJECT_PATH}
END
IF 'HEAD' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER}
END
IF 'RANGE' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
END
IF 'SEARCH' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Search Object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
IF 'SEARCH' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Search Object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
END
IF 'RANGEHASH' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
@ -162,26 +161,26 @@ Check eACL Filters with MatchType String Equal
END
IF 'DELETE' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Delete Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Delete Object ${OTHER_KEY} ${CID} ${S_OID_USER}
END
Check eACL Filters with MatchType String Not Equal
[Arguments] ${FILTER}
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
${CID} = Create Container Public ${USER_KEY}
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
${S_OID_OTH} = Put Object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_OTH} = Put Object ${OTHER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID}
@{S_OBJ_H} = Create List ${S_OID_USER}
Get Object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Head Object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
Search Object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Head Object ${USER_KEY} ${CID} ${S_OID_USER}
Search Object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
@ -189,25 +188,25 @@ Check eACL Filters with MatchType String Not Equal
${EACL_CUSTOM} = Compose eACL Custom ${HEADER_DICT} STRING_NOT_EQUAL ${FILTER} DENY OTHERS
Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM}
IF 'GET' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
IF 'GET' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Get object ${OTHER_KEY} ${CID} ${S_OID_OTH} ${EMPTY} ${OBJECT_PATH}
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${OBJECT_PATH}
END
IF 'HEAD' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Head object ${OTHER_KEY} ${CID} ${S_OID_OTH} ${EMPTY}
Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID_OTH}
Head object ${OTHER_KEY} ${CID} ${S_OID_USER}
END
IF 'SEARCH' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_OTH_HEADER} ${S_OBJ_H}
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${ANOTHER_HEADER} ${S_OBJ_H}
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
END
IF 'RANGE' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Get Range ${OTHER_KEY} ${CID} ${S_OID_OTH} s_get_range ${EMPTY} 0:256
Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
END
IF 'RANGEHASH' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
@ -216,6 +215,6 @@ Check eACL Filters with MatchType String Not Equal
END
IF 'DELETE' in ${VERB_FILTER_DEP}[${FILTER}]
Run Keyword And Expect error ${EACL_ERR_MSG}
... Delete Object ${OTHER_KEY} ${CID} ${S_OID_OTH} ${EMPTY}
Delete Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Delete Object ${OTHER_KEY} ${CID} ${S_OID_OTH}
Delete Object ${OTHER_KEY} ${CID} ${S_OID_USER}
END

View file

@ -5,9 +5,6 @@ Library wallet_keywords.py
Library rpc_call_keywords.py
*** Variables ***
${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_OTH} = key1=2
${UNEXIST_OID} = B2DKvkHnLnPvapbDgfpU1oVUPuXQo5LTfKVxmNDZXQff
${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 2 FROM * AS X
${CONTAINER_WAIT_INTERVAL} = 1 min

View file

@ -12,20 +12,20 @@ Resource setup_teardown.robot
*** Test cases ***
Basic ACL Operations for Private Container
[Documentation] Testcase to validate NeoFS operations with ACL for Private Container.
[Tags] ACL NeoFS NeoCLI
[Tags] ACL
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
${PRIV_CID} = Create Private Container ${USER_KEY}
${FILE_S} ${FILE_S_HASH} = Generate file ${SIMPLE_OBJ_SIZE}
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
Check Private Container ${USER_KEY} ${FILE_S} ${PRIV_CID} ${OTHER_KEY}
${PRIV_CID} = Create Private Container ${USER_KEY}
${FILE_S} ${FILE_S_HASH} = Generate file ${COMPLEX_OBJ_SIZE}
${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE}
Check Private Container ${USER_KEY} ${FILE_S} ${PRIV_CID} ${OTHER_KEY}
[Teardown] Teardown acl_basic_private_container
@ -37,15 +37,17 @@ Check Private Container
[Arguments] ${USER_KEY} ${FILE_S} ${PRIV_CID} ${OTHER_KEY}
# Put
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY}
Run Keyword And Expect Error *
... Put object ${OTHER_KEY} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY}
${S_OID_SYS_IR} = Put Object ${NEOFS_IR_WIF} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY}
${S_OID_SYS_SN} = Put Object ${NEOFS_SN_WIF} ${FILE_S} ${PRIV_CID} ${EMPTY} ${EMPTY}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${PRIV_CID}
Run Keyword And Expect Error *
... Put object ${OTHER_KEY} ${FILE_S} ${PRIV_CID}
${S_OID_SYS_IR} = Put Object ${NEOFS_IR_WIF} ${FILE_S} ${PRIV_CID}
${S_OID_SYS_SN} = Put Object ${NEOFS_SN_WIF} ${FILE_S} ${PRIV_CID}
Sleep 5s
# Get
Get Object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read
Run Keyword And Expect Error *
Run Keyword And Expect Error *
... Get object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read
Get Object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read
Get Object ${NEOFS_SN_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY} s_file_read
@ -68,26 +70,26 @@ Check Private Container
# Search
@{S_OBJ_PRIV} = Create List ${S_OID_USER} ${S_OID_SYS_SN} ${S_OID_SYS_IR}
Search Object ${USER_KEY} ${PRIV_CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_PRIV}
Search Object ${USER_KEY} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}
Run Keyword And Expect Error *
... Search object ${OTHER_KEY} ${PRIV_CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_PRIV}
Search Object ${NEOFS_IR_WIF} ${PRIV_CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_PRIV}
Search Object ${NEOFS_SN_WIF} ${PRIV_CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_PRIV}
... Search object ${OTHER_KEY} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}
Search Object ${NEOFS_IR_WIF} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}
Search Object ${NEOFS_SN_WIF} ${PRIV_CID} keys=--root expected_objects_list=${S_OBJ_PRIV}
# Head
Head Object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY}
Head Object ${USER_KEY} ${PRIV_CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY}
Head Object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY}
Head Object ${NEOFS_SN_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY} ${EMPTY}
... Head object ${OTHER_KEY} ${PRIV_CID} ${S_OID_USER}
Head Object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID_USER}
Head Object ${NEOFS_SN_WIF} ${PRIV_CID} ${S_OID_USER}
# 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}
Run Keyword And Expect Error *
... Delete object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY}
... Delete object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Delete object ${NEOFS_SN_WIF} ${PRIV_CID} ${S_OID_USER} ${EMPTY}
Delete Object ${USER_KEY} ${PRIV_CID} ${S_OID_USER} ${EMPTY}
... Delete object ${NEOFS_SN_WIF} ${PRIV_CID} ${S_OID_USER}
Delete Object ${USER_KEY} ${PRIV_CID} ${S_OID_USER}

View file

@ -11,16 +11,20 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations
[Documentation] Testcase to validate NeoFS operations with BearerToken.
[Tags] ACL NeoFS NeoCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -42,16 +46,16 @@ Check eACL Deny and Allow All Bearer
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -71,23 +75,22 @@ Check eACL Deny and Allow All Bearer
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
# All operations on object should be passed with bearer token
Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN}
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}

View file

@ -13,17 +13,19 @@ Resource setup_teardown.robot
*** Variables ***
${SYSTEM_KEY} = ${NEOFS_IR_WIF}
&{USER_HEADER} = key1=1 key2=abc
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations for Сompound Operations
[Documentation] Testcase to validate NeoFS operations with BearerToken for Сompound Operations.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -41,26 +43,26 @@ BearerToken Operations for Сompound Operations
Check Сompound Operations
[Arguments] ${USER_KEY} ${OTHER_KEY} ${FILE_S}
Check Bearer Сompound Get ${OTHER_KEY} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get ${OTHER_KEY} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get ${USER_KEY} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get ${SYSTEM_KEY} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Delete ${OTHER_KEY} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Delete ${USER_KEY} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Delete ${SYSTEM_KEY} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Delete ${SYSTEM_KEY} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get Range Hash ${OTHER_KEY} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get Range Hash ${OTHER_KEY} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get Range Hash ${USER_KEY} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get Range Hash ${SYSTEM_KEY} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_KEY}
Check Bearer Сompound Get
[Arguments] ${KEY} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
@ -74,30 +76,30 @@ Check Bearer Сompound Get
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Head object ${KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
... Head object ${KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Get object ${KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
IF "${KEY}" == "${NEOFS_IR_WIF}"
Run Keyword And Expect Error *
... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
ELSE
ELSE
Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
END
Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256
Check Bearer Сompound Delete
[Arguments] ${KEY} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_KEY}
[Arguments] ${KEY} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
IF "${KEY}" == "${NEOFS_IR_WIF}"
Run Keyword And Expect Error *
... Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY}
... Delete object ${KEY} ${CID} ${D_OID_USER}
ELSE
Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${KEY} ${CID} ${D_OID_USER}
END
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
@ -112,11 +114,11 @@ Check Bearer Сompound Delete
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Head object ${KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
... Head object ${KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Run Keyword And Expect Error *
... Put object ${KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
... Put object ${KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${ANOTHER_HEADER}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
@ -125,9 +127,9 @@ Check Bearer Сompound Get Range Hash
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
# The current ACL cache lifetime is 30 sec

View file

@ -11,17 +11,21 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations with Filter OID Equal
[Documentation] Testcase to validate NeoFS operations with BearerToken with Filter OID Equal.
[Tags] ACL NeoFS NeoCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
${FILE_S} = Generate file ${SIMPLE_OBJ_SIZE}
@ -42,17 +46,17 @@ Check eACL Deny and Allow All Bearer Filter OID Equal
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -74,28 +78,28 @@ Check eACL Deny and Allow All Bearer Filter OID Equal
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${ANOTHER_HEADER}
Run Keyword And Expect Error *
... Get object ${USER_KEY} ${CID} ${S_OID_USER_2} ${EACL_TOKEN} local_file_eacl
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EACL_TOKEN}
... Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer=${EACL_TOKEN}

View file

@ -12,15 +12,18 @@ Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
*** Test cases ***
BearerToken Operations with Filter OID NotEqual
[Documentation] Testcase to validate NeoFS operations with BearerToken with Filter OID NotEqual.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -41,17 +44,17 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -73,19 +76,19 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN}
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
Run Keyword And Expect Error *
@ -95,14 +98,14 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual
Run Keyword And Expect Error *
... Get Range ${USER_KEY} ${CID} ${S_OID_USER_2} s_get_range ${EACL_TOKEN} 0:256
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER_2} ${EACL_TOKEN}
... Head object ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_token=${EACL_TOKEN}
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${D_OID_USER_2} ${EACL_TOKEN}
... Delete object ${USER_KEY} ${CID} ${D_OID_USER_2} bearer=${EACL_TOKEN}

View file

@ -11,15 +11,20 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations with Filter UserHeader Equal
[Documentation] Testcase to validate NeoFS operations with BearerToken with Filter UserHeader Equal.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -36,18 +41,18 @@ BearerToken Operations with Filter UserHeader Equal
*** Keywords ***
Check eACL Deny and Allow All Bearer Filter UserHeader Equal
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -69,22 +74,22 @@ Check eACL Deny and Allow All Bearer Filter UserHeader Equal
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${ANOTHER_HEADER}
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
Run Keyword And Expect Error *
@ -96,12 +101,12 @@ Check eACL Deny and Allow All Bearer Filter UserHeader Equal
Run Keyword And Expect Error *
... Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER_2} ${EACL_TOKEN}
... Head object ${USER_KEY} ${CID} ${S_OID_USER_2} bearer_token=${EACL_TOKEN}
# Delete can not be filtered by UserHeader.
Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER_2} ${EACL_TOKEN}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER_2} bearer=${EACL_TOKEN}

View file

@ -11,15 +11,20 @@ Resource eacl_tables.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations Filter UserHeader NotEqual
[Documentation] Testcase to validate NeoFS operations with BearerToken Filter UserHeader NotEqual.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -38,17 +43,17 @@ Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER_2}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -70,13 +75,13 @@ Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Run Keyword And Expect Error *
@ -84,10 +89,10 @@ Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
# Search can not use filter by headers
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
# Different behaviour for big and small objects!
# Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER}
# Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${ANOTHER_HEADER}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${EMPTY}

View file

@ -14,12 +14,12 @@ Resource setup_teardown.robot
*** Test cases ***
BearerToken Operations for Inaccessible Container
[Documentation] Testcase to validate NeoFS operations with BearerToken for Inaccessible Container.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -40,17 +40,17 @@ Check Container Inaccessible and Allow All Bearer
${CID} = Create Container Inaccessible ${USER_KEY}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${FILE_USR_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
${rule1} = Create Dictionary Operation=PUT Access=ALLOW Role=USER
${rule2} = Create Dictionary Operation=SEARCH Access=ALLOW Role=USER
@ -59,6 +59,6 @@ Check Container Inaccessible and Allow All Bearer
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${FILE_USR_HEADER}
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER}

View file

@ -11,15 +11,20 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations
[Documentation] Testcase to validate NeoFS operations with BearerToken.
[Tags] ACL NeoFS NeoCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -40,9 +45,9 @@ Check eACL Allow All Bearer Filter Requst Equal Deny
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
@ -56,27 +61,27 @@ Check eACL Allow All Bearer Filter Requst Equal Deny
${rule7}= Create Dictionary Operation=GETRANGEHASH Access=DENY Role=USER Filters=${filters}
${eACL_gen}= Create List ${rule1} ${rule2} ${rule3} ${rule4} ${rule5} ${rule6} ${rule7}
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_OTH_HEADER} ${EMPTY} --xhdr a=2
Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${ANOTHER_HEADER} options=--xhdr a=2
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl ${EMPTY} --xhdr a=2
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${S_OBJ_H} --xhdr a=2
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} ${EMPTY} --xhdr a=2
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H} --xhdr a=2
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} options=--xhdr a=2
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256 --xhdr a=2
Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256 --xhdr a=2
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EACL_TOKEN} --xhdr a=2
Delete object ${USER_KEY} ${CID} ${D_OID_USER} bearer=${EACL_TOKEN} options=--xhdr a=2
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=256
... Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${USER_HEADER} options=--xhdr a=256
Run Keyword And Expect Error *
... Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl ${EMPTY} --xhdr a=256
Run Keyword And Expect Error *
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=256
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${EMPTY} --xhdr a=256
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} ${EMPTY} --xhdr a=256
... Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} options=--xhdr a=256
Run Keyword And Expect Error *
... Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256 --xhdr a=256
Run Keyword And Expect Error *
... Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256 --xhdr a=256
Run Keyword And Expect Error *
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} --xhdr a=256
... Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN} options=--xhdr a=256

View file

@ -11,16 +11,20 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
${EACL_ERROR_MSG} = *
*** Test cases ***
BearerToken Operations with Filter Requst Equal
[Documentation] Testcase to validate NeoFS operations with BearerToken with Filter Requst Equal.
[Tags] ACL NeoFSCLI BearerToken
[Tags] ACL BearerToken
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
Prepare eACL Role rules
Log Check Bearer token with simple object
@ -41,17 +45,17 @@ Check eACL Deny and Allow All Bearer Filter Requst Equal
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -69,23 +73,23 @@ Check eACL Deny and Allow All Bearer Filter Requst Equal
${eACL_gen}= Create List ${rule1} ${rule2} ${rule3} ${rule4} ${rule5} ${rule6} ${rule7}
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
Run Keyword And Expect Error *
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... Get object ${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 *
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... 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}
Run Keyword And Expect Error ${EACL_ERROR_MSG}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=256
Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${USER_HEADER} options=--xhdr a=256
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl ${EMPTY} --xhdr a=256
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=256
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} ${EMPTY} --xhdr a=256
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${EMPTY} --xhdr a=256
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} options=--xhdr a=256
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256 --xhdr a=256
Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256 --xhdr a=256
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} --xhdr a=256

View file

@ -11,6 +11,10 @@ Resource common_steps_acl_bearer.robot
Resource payment_operations.robot
Resource setup_teardown.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_USER_HEADER} = key1=oth key2=oth
*** Test cases ***
BearerToken Operations with Filter Requst NotEqual
@ -40,17 +44,17 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_USER_2} = Put object ${USER_KEY} ${FILE_S} ${CID}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Get object ${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}
Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${USER_KEY} ${CID} ${S_OID_USER}
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Delete object ${USER_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_USER}
@ -69,22 +73,22 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual
${EACL_TOKEN} = Form BearerToken File ${USER_KEY} ${CID} ${eACL_gen}
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
#... Search object ${USER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${USER_KEY} ${CID} ${S_OID_USER}
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}
... Delete object ${USER_KEY} ${CID} ${S_OID_USER}
Put object ${USER_KEY} ${FILE_S} ${CID} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=2
Put object ${USER_KEY} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${USER_HEADER} options=--xhdr a=2
Get object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl ${EMPTY} --xhdr a=2
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=2
Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} ${EMPTY} --xhdr a=2
Search object ${USER_KEY} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${EMPTY} --xhdr a=2
Head object ${USER_KEY} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN} options=--xhdr a=2
Get Range ${USER_KEY} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256 --xhdr a=2
Get Range Hash ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256 --xhdr a=2
Delete object ${USER_KEY} ${CID} ${S_OID_USER} ${EACL_TOKEN} --xhdr a=2
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN} options=--xhdr a=2

View file

@ -13,18 +13,21 @@ Resource eacl_tables.robot
*** Variables ***
${EACL_KEY} = L1FGTLE6shum3EC7mNTPArUqSCKnmtEweRzyuawtYRZwGjpeRuw1
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
Extended ACL Operations
[Documentation] Testcase to validate NeoFS operations with extended ACL.
[Tags] ACL eACL NeoFS NeoCLI
[Tags] ACL eACL
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
Log Check extended ACL with simple object
Generate files ${SIMPLE_OBJ_SIZE}
@ -43,20 +46,20 @@ Extended ACL Operations
Check eACL Deny All Other and Allow All Pubkey
[Arguments] ${USER_KEY} ${FILE_S} ${OTHER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Get object ${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
Get Range Hash ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${D_OID_USER} ${EMPTY}
Put object ${EACL_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${EACL_KEY} ${CID} ${S_OID_USER}
Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${D_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_Pubkey}
# The current ACL cache lifetime is 30 sec
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
@ -64,24 +67,24 @@ Check eACL Deny All Other and Allow All Pubkey
Get eACL ${USER_KEY} ${CID}
Run Keyword And Expect Error *
... Put object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
... Put object ${OTHER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Run Keyword And Expect Error *
... Get object ${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}
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Run Keyword And Expect Error *
... Get Range Hash ${OTHER_KEY} ${CID} ${S_OID_USER} ${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}
Put object ${EACL_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Get object ${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
Get Range Hash ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY}
Put object ${EACL_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search object ${EACL_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${EACL_KEY} ${CID} ${S_OID_USER}
Get Range ${EACL_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range Hash ${EACL_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Delete object ${EACL_KEY} ${CID} ${S_OID_USER}

View file

@ -11,6 +11,10 @@ Resource payment_operations.robot
Resource setup_teardown.robot
Resource eacl_tables.robot
*** Variables ***
&{USER_HEADER} = key1=1 key2=abc
&{USER_HEADER_DEL} = key1=del key2=del
&{ANOTHER_USER_HEADER} = key1=oth key2=oth
*** Test cases ***
Extended ACL Operations
@ -38,26 +42,26 @@ Extended ACL Operations
Check eACL Deny and Allow All System
[Arguments] ${USER_KEY} ${FILE_S}
${CID} = Create Container Public ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER_S} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${D_OID_USER_SN} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER_S} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
${D_OID_USER_SN} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER}
@{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Get object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Get object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER}
Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER}
Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY}
Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY}
Run Keyword And Expect Error *
... Get Range ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Run Keyword And Expect Error *
@ -67,9 +71,9 @@ Check eACL Deny and Allow All System
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Run Keyword And Expect Error *
... Delete object ${NEOFS_IR_WIF} ${CID} ${D_OID_USER_S} ${EMPTY}
... Delete object ${NEOFS_IR_WIF} ${CID} ${D_OID_USER_S}
Run Keyword And Expect Error *
... Delete object ${NEOFS_SN_WIF} ${CID} ${D_OID_USER_SN} ${EMPTY}
... Delete object ${NEOFS_SN_WIF} ${CID} ${D_OID_USER_SN}
Set eACL ${USER_KEY} ${CID} ${EACL_DENY_ALL_SYSTEM}
@ -77,9 +81,9 @@ Check eACL Deny and Allow All System
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Run Keyword And Expect Error *
... Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
... Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Run Keyword And Expect Error *
... Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
... Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Run Keyword And Expect Error *
... Get object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
@ -87,15 +91,15 @@ Check eACL Deny and Allow All System
... Get object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Run Keyword And Expect Error *
... Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
... Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Run Keyword And Expect Error *
... Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
@ -110,9 +114,9 @@ Check eACL Deny and Allow All System
Run Keyword And Expect Error *
... Delete object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY}
... Delete object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Delete object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY}
... Delete object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER}
Set eACL ${USER_KEY} ${CID} ${EACL_ALLOW_ALL_SYSTEM}
@ -120,23 +124,23 @@ Check eACL Deny and Allow All System
# The current ACL cache lifetime is 30 sec
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Delete object ${USER_KEY} ${CID} ${D_OID_USER_S} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER_SN} ${EMPTY}
Delete object ${USER_KEY} ${CID} ${D_OID_USER_S}
Delete object ${USER_KEY} ${CID} ${D_OID_USER_SN}
${D_OID_USER_S} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${D_OID_USER_SN} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
${D_OID_USER_S} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
${D_OID_USER_SN} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Put object ${NEOFS_IR_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Put object ${NEOFS_SN_WIF} ${FILE_S} ${CID} user_headers=${ANOTHER_USER_HEADER}
Get object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Get object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${NEOFS_IR_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Search object ${NEOFS_SN_WIF} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} ${EMPTY}
Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY}
Head object ${NEOFS_IR_WIF} ${CID} ${S_OID_USER}
Head object ${NEOFS_SN_WIF} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${NEOFS_IR_WIF} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
@ -147,6 +151,6 @@ Check eACL Deny and Allow All System
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Run Keyword And Expect Error *
... Delete object ${NEOFS_IR_WIF} ${CID} ${D_OID_USER_S} ${EMPTY}
... Delete object ${NEOFS_IR_WIF} ${CID} ${D_OID_USER_S}
Run Keyword And Expect Error *
... Delete object ${NEOFS_SN_WIF} ${CID} ${D_OID_USER_SN} ${EMPTY}
... Delete object ${NEOFS_SN_WIF} ${CID} ${D_OID_USER_SN}

View file

@ -13,28 +13,30 @@ Resource eacl_tables.robot
*** Variables ***
${SYSTEM_KEY} = ${NEOFS_IR_WIF}
&{USER_HEADER} = key1=1 key2=abc
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
Extended ACL Operations
[Documentation] Testcase to validate NeoFS operations with extended ACL.
[Tags] ACL eACL NeoFS NeoCLI
[Tags] ACL eACL
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
Log Check extended ACL with simple object
Generate files ${SIMPLE_OBJ_SIZE}
Check Сompound Operations ${USER_KEY} ${OTHER_KEY}
Log Check extended ACL with simple object
Generate files ${SIMPLE_OBJ_SIZE}
Check Сompound Operations ${USER_KEY} ${OTHER_KEY}
Log Check extended ACL with complex object
Generate files ${COMPLEX_OBJ_SIZE}
Check Сompound Operations ${USER_KEY} ${OTHER_KEY}
Log Check extended ACL with complex object
Generate files ${COMPLEX_OBJ_SIZE}
Check Сompound Operations ${USER_KEY} ${OTHER_KEY}
[Teardown] Teardown acl_extended_compound
[Teardown] Teardown acl_extended_compound
*** Keywords ***
@ -48,7 +50,7 @@ Check Сompound Operations
Check eACL Сompound Get ${SYSTEM_KEY} ${EACL_COMPOUND_GET_SYSTEM} ${USER_KEY}
Check eACL Сompound Delete ${OTHER_KEY} ${EACL_COMPOUND_DELETE_OTHERS} ${USER_KEY}
Check eACL Сompound Delete ${USER_KEY} ${EACL_COMPOUND_DELETE_USER} ${USER_KEY}
Check eACL Сompound Delete ${USER_KEY} ${EACL_COMPOUND_DELETE_USER} ${USER_KEY}
Check eACL Сompound Delete ${SYSTEM_KEY} ${EACL_COMPOUND_DELETE_SYSTEM} ${USER_KEY}
Check eACL Сompound Get Range Hash ${OTHER_KEY} ${EACL_COMPOUND_GET_HASH_OTHERS} ${USER_KEY}
@ -56,12 +58,12 @@ Check Сompound Operations
Check eACL Сompound Get Range Hash ${SYSTEM_KEY} ${EACL_COMPOUND_GET_HASH_SYSTEM} ${USER_KEY}
Check eACL Сompound Get
[Arguments] ${KEY} ${DENY_EACL} ${USER_KEY}
[Arguments] ${KEY} ${DENY_EACL} ${USER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
@ -69,14 +71,14 @@ Check eACL Сompound Get
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Run Keyword And Expect Error *
... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${KEY} ${CID} ${S_OID_USER}
Get object ${KEY} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
IF "${KEY}" == "${NEOFS_IR_WIF}"
Run Keyword And Expect Error *
... Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
ELSE
Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Get Range ${KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
END
Get Range Hash ${KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256
@ -86,14 +88,14 @@ Check eACL Сompound Delete
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${EMPTY}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
IF "${KEY}" == "${NEOFS_IR_WIF}"
Run Keyword And Expect Error *
... Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY}
... Delete object ${KEY} ${CID} ${D_OID_USER}
ELSE
Delete object ${KEY} ${CID} ${D_OID_USER} ${EMPTY}
Delete object ${KEY} ${CID} ${D_OID_USER}
END
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
@ -102,14 +104,14 @@ Check eACL Сompound Delete
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
Run Keyword And Expect Error *
... Head object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Head object ${KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
... Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
IF "${KEY}" == "${NEOFS_IR_WIF}"
Run Keyword And Expect Error *
... Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
... Delete object ${KEY} ${CID} ${S_OID_USER}
ELSE
Delete object ${KEY} ${CID} ${S_OID_USER} ${EMPTY}
Delete object ${KEY} ${CID} ${S_OID_USER}
END
@ -119,11 +121,11 @@ Check eACL Сompound Get Range Hash
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Put object ${KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
Get Range Hash ${NEOFS_SN_WIF} ${CID} ${S_OID_USER} ${EMPTY} 0:256
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
Set eACL ${USER_KEY} ${CID} ${DENY_EACL}
# The current ACL cache lifetime is 30 sec
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}

View file

@ -5,7 +5,7 @@ Library acl.py
Library neofs.py
Library payment_neogo.py
Library Collections
Library contract_keywords.py
Library contract_keywords.py
Resource common_steps_acl_extended.robot
Resource payment_operations.robot
@ -14,17 +14,19 @@ Resource eacl_tables.robot
*** Variables ***
${PATH} = testfile
&{USER_HEADER} = key1=1 key2=abc
&{ANOTHER_HEADER} = key1=oth key2=oth
*** Test cases ***
Extended ACL Operations
[Documentation] Testcase to validate NeoFS operations with extended ACL.
[Tags] ACL eACL NeoFS NeoCLI
[Tags] ACL eACL
[Timeout] 20 min
[Setup] Setup
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
Log Check extended ACL with simple object
Generate files ${SIMPLE_OBJ_SIZE}
@ -41,7 +43,7 @@ Extended ACL Operations
Check Filters
[Arguments] ${USER_KEY} ${OTHER_KEY}
Check eACL MatchType String Equal Object ${USER_KEY} ${OTHER_KEY}
Check eACL MatchType String Not Equal Object ${USER_KEY} ${OTHER_KEY}
Check eACL MatchType String Equal Request Deny ${USER_KEY} ${OTHER_KEY}
@ -49,16 +51,10 @@ Check Filters
Check eACL MatchType String Equal Request Deny
[Arguments] ${USER_KEY} ${OTHER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} json_output=True
&{HEADER_DICT} = Decode Object System Header Json ${HEADER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH}
${ID_value} = Get From Dictionary ${HEADER_DICT} ID
Set eACL ${USER_KEY} ${CID} ${EACL_XHEADER_DENY_ALL}
# The current ACL cache lifetime is 30 sec
@ -69,13 +65,13 @@ Check eACL MatchType String Equal Request Deny
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY} --xhdr a=256
Run Keyword And Expect Error *
... Put object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} ${EMPTY} --xhdr a=2
... Put object ${OTHER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} options=--xhdr a=2
Run Keyword And Expect Error *
... Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY} --xhdr a=2
Run Keyword And Expect Error *
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=2
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${EMPTY} --xhdr a=2
Run Keyword And Expect Error *
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${EMPTY} --xhdr a=2
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} options=--xhdr a=2
Run Keyword And Expect Error *
... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 --xhdr a="2"
Run Keyword And Expect Error *
@ -83,28 +79,22 @@ Check eACL MatchType String Equal Request Deny
Run Keyword And Expect Error *
... Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} --xhdr a=2
Put object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} ${EMPTY} --xhdr a=256
Put object ${OTHER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER} options=--xhdr a=256
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY} --xhdr a=*
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=
Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${EMPTY} --xhdr a=.*
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${EMPTY} --xhdr a=
Head object ${OTHER_KEY} ${CID} ${S_OID_USER} options=--xhdr a=.*
Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 --xhdr a="2 2"
Get Range Hash ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 --xhdr a=256
Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} --xhdr a=22
Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} options=--xhdr a=22
Check eACL MatchType String Equal Request Allow
[Arguments] ${USER_KEY} ${OTHER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${HEADER} = Head Object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} json_output=True
&{HEADER_DICT} = Decode Object System Header Json ${HEADER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID}
Get Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH}
${ID_value} = Get From Dictionary ${HEADER_DICT} ID
Set eACL ${USER_KEY} ${CID} ${EACL_XHEADER_ALLOW_ALL}
# The current ACL cache lifetime is 30 sec
@ -115,42 +105,39 @@ Check eACL MatchType String Equal Request Allow
Run Keyword And Expect Error *
... Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY}
Run Keyword And Expect Error *
... Put object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} ${EMPTY}
... Put object ${OTHER_KEY} ${FILE_S} ${CID}
Run Keyword And Expect Error *
... Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY}
Run Keyword And Expect Error *
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${EMPTY}
... Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${EMPTY}
Run Keyword And Expect Error *
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID_USER}
Run Keyword And Expect Error *
... Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256
Run Keyword And Expect Error *
... Get Range Hash ${OTHER_KEY} ${CID} ${S_OID_USER} ${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}
Put object ${OTHER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} ${EMPTY} --xhdr a=2
Put object ${OTHER_KEY} ${FILE_S} ${CID} options=--xhdr a=2
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH} ${EMPTY} --xhdr a=2
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${EMPTY} --xhdr a=2
Head object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${EMPTY} --xhdr a=2
Search object ${OTHER_KEY} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${EMPTY} --xhdr a=2
Head object ${OTHER_KEY} ${CID} ${S_OID_USER} options=--xhdr a=2
Get Range ${OTHER_KEY} ${CID} ${S_OID_USER} s_get_range ${EMPTY} 0:256 --xhdr a=2
Get Range Hash ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} 0:256 --xhdr a=2
Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} --xhdr a=2
Delete object ${OTHER_KEY} ${CID} ${S_OID_USER} options=--xhdr a=2
Check eACL MatchType String Equal Object
[Arguments] ${USER_KEY} ${OTHER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${HEADER} = Head Object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} json_output=True
&{HEADER_DICT} = Decode Object System Header Json ${HEADER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put Object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
Get Object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH}
Log Set eACL for Deny GET operation with StringEqual Object ID
${ID_value} = Get From dictionary ${HEADER_DICT} ID
&{HEADER_DICT} = Head Object ${USER_KEY} ${CID} ${S_OID_USER}
${ID_value} = Get From dictionary ${HEADER_DICT} objectID
${filters} = Create Dictionary headerType=OBJECT matchType=STRING_EQUAL key=$Object:objectID value=${ID_value}
${rule1} = Create Dictionary Operation=GET Access=DENY Role=OTHERS Filters=${filters}
@ -163,7 +150,7 @@ Check eACL MatchType String Equal Object
Log Set eACL for Deny GET operation with StringEqual Object Extended User Header
${S_OID_USER_OTH} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER_OTH} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
${filters} = Create Dictionary headerType=OBJECT matchType=STRING_EQUAL key=key1 value=1
${rule1} = Create Dictionary Operation=GET Access=DENY Role=OTHERS Filters=${filters}
@ -181,21 +168,16 @@ Check eACL MatchType String Equal Object
Check eACL MatchType String Not Equal Object
[Arguments] ${USER_KEY} ${OTHER_KEY}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${S_OID_OTHER} = Put object ${OTHER_KEY} ${FILE_S_2} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${HEADER} = Head object ${USER_KEY} ${CID} ${S_OID_USER} ${EMPTY} json_output=True
Head object ${USER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} json_output=True
&{HEADER_DICT} = Decode Object System Header Json ${HEADER}
${CID} = Create Container Public ${USER_KEY}
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${USER_HEADER}
${S_OID_OTHER} = Put object ${OTHER_KEY} ${FILE_S_2} ${CID} user_headers=${ANOTHER_HEADER}
Get object ${OTHER_KEY} ${CID} ${S_OID_USER} ${EMPTY} ${PATH}
Get object ${OTHER_KEY} ${CID} ${S_OID_OTHER} ${EMPTY} ${PATH}
Log Set eACL for Deny GET operation with StringNotEqual Object ID
${ID_value} = Get From Dictionary ${HEADER_DICT} ID
&{HEADER_DICT} = Head object ${USER_KEY} ${CID} ${S_OID_USER}
${ID_value} = Get From Dictionary ${HEADER_DICT} objectID
${filters} = Create Dictionary headerType=OBJECT matchType=STRING_NOT_EQUAL key=$Object:objectID value=${ID_value}
${rule1} = Create Dictionary Operation=GET Access=DENY Role=OTHERS Filters=${filters}
@ -209,7 +191,7 @@ Check eACL MatchType String Not Equal Object
Log Set eACL for Deny GET operation with StringEqual Object Extended User Header
${S_OID_USER_OTH} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}
${S_OID_USER_OTH} = Put object ${USER_KEY} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
${filters} = Create Dictionary headerType=OBJECT matchType=STRING_NOT_EQUAL key=key1 value=1
${rule1} = Create Dictionary Operation=GET Access=DENY Role=OTHERS Filters=${filters}

View file

@ -19,7 +19,7 @@ ${EACL_ERR_MSG} = *
*** Test cases ***
Creation Epoch Object Filter for Extended ACL
[Documentation] Testcase to validate if $Object:creationEpoch eACL filter is correctly handled.
[Tags] ACL eACL NeoFS NeoCLI
[Tags] ACL eACL
[Timeout] 20 min
[Setup] Setup
@ -34,28 +34,27 @@ Creation Epoch Object Filter for Extended ACL
Check $Object:creationEpoch Filter with MatchType String Not Equal
[Arguments] ${FILTER}
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
${CID} = Create Container Public ${USER_KEY}
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
${S_OID} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY}
Tick Epoch
${S_OID_NEW} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY}
${S_OID} = Put Object ${USER_KEY} ${FILE_S} ${CID}
Tick Epoch
${S_OID_NEW} = Put Object ${USER_KEY} ${FILE_S} ${CID}
Get Object ${USER_KEY} ${CID} ${S_OID_NEW} ${EMPTY} local_file_eacl
Head Object ${USER_KEY} ${CID} ${S_OID_NEW} ${EMPTY}
&{HEADER_DICT} = Object Header Decoded ${USER_KEY} ${CID} ${S_OID_NEW}
&{HEADER_DICT} = Head Object ${USER_KEY} ${CID} ${S_OID_NEW}
${EACL_CUSTOM} = Compose eACL Custom ${HEADER_DICT} STRING_NOT_EQUAL ${FILTER} DENY OTHERS
Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM}
Run Keyword And Expect Error ${EACL_ERR_MSG}
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Get object ${OTHER_KEY} ${CID} ${S_OID} ${EMPTY} ${OBJECT_PATH}
Get object ${OTHER_KEY} ${CID} ${S_OID_NEW} ${EMPTY} ${OBJECT_PATH}
Run Keyword And Expect error ${EACL_ERR_MSG}
... Head object ${OTHER_KEY} ${CID} ${S_OID} ${EMPTY}
Head object ${OTHER_KEY} ${CID} ${S_OID_NEW} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID}
Head object ${OTHER_KEY} ${CID} ${S_OID_NEW}
[Teardown] Teardown creation_epoch_filter

View file

@ -18,7 +18,7 @@ ${EACL_ERR_MSG} = *
*** Test cases ***
Payload Length Object Filter for Extended ACL
[Documentation] Testcase to validate if $Object:payloadLength eACL filter is correctly handled.
[Tags] ACL eACL NeoFS NeoCLI
[Tags] ACL eACL
[Timeout] 20 min
[Setup] Setup
@ -33,29 +33,29 @@ Payload Length Object Filter for Extended ACL
Check $Object:payloadLength Filter with MatchType String Not Equal
[Arguments] ${FILTER}
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${OTHER_KEY} = Prepare Wallet And Deposit
${CID} = Create Container Public ${USER_KEY}
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
${FILE_0} ${_} = Generate file ${0}
${S_OID_0} = Put Object ${USER_KEY} ${FILE_0} ${CID} ${EMPTY}
${S_OID} = Put Object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY}
${S_OID_0} = Put Object ${USER_KEY} ${FILE_0} ${CID}
${S_OID} = Put Object ${USER_KEY} ${FILE_S} ${CID}
Get Object ${USER_KEY} ${CID} ${S_OID} ${EMPTY} local_file_eacl
Head Object ${USER_KEY} ${CID} ${S_OID} ${EMPTY}
Head Object ${USER_KEY} ${CID} ${S_OID}
&{HEADER_DICT} = Object Header Decoded ${USER_KEY} ${CID} ${S_OID}
${EACL_CUSTOM} = Compose eACL Custom ${HEADER_DICT} STRING_NOT_EQUAL ${FILTER} DENY OTHERS
Set eACL ${USER_KEY} ${CID} ${EACL_CUSTOM}
Run Keyword And Expect Error ${EACL_ERR_MSG}
Run Keyword And Expect Error ${EACL_ERR_MSG}
... Get object ${OTHER_KEY} ${CID} ${S_OID_0} ${EMPTY} ${OBJECT_PATH}
Get object ${OTHER_KEY} ${CID} ${S_OID} ${EMPTY} ${OBJECT_PATH}
Run Keyword And Expect error ${EACL_ERR_MSG}
... Head object ${OTHER_KEY} ${CID} ${S_OID_0} ${EMPTY}
Head object ${OTHER_KEY} ${CID} ${S_OID} ${EMPTY}
... Head object ${OTHER_KEY} ${CID} ${S_OID_0}
Head object ${OTHER_KEY} ${CID} ${S_OID}
[Teardown] Teardown payload_length_filter

View file

@ -24,13 +24,13 @@ Drop command in control group
[Setup] Setup
${NODE_NUM} ${NODE} ${WIF} = Get control endpoint with wif
${_} ${NODE} ${WIF} = Get control endpoint with wif
${LOCODE} = Get Locode
${FILE_SIMPLE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
${FILE_COMPLEX} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${WALLET} ${ADDR} ${USER_KEY} = Prepare Wallet And Deposit
${_} ${_} ${USER_KEY} = Prepare Wallet And Deposit
${PRIV_CID} = Create container ${USER_KEY} ${PRIVATE_ACL_F} REP 1 CBF 1 SELECT 1 FROM * FILTER 'UN-LOCODE' EQ '${LOCODE}' AS LOC
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
@ -40,18 +40,18 @@ Drop command in control group
# Dropping simple object
#########################
${S_OID} = Put object ${USER_KEY} ${FILE_SIMPLE} ${PRIV_CID} ${EMPTY} ${EMPTY}
${S_OID} = Put object ${USER_KEY} ${FILE_SIMPLE} ${PRIV_CID}
Get object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} s_file_read
Head object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} ${EMPTY}
Head object ${USER_KEY} ${PRIV_CID} ${S_OID}
Drop object ${NODE} ${WIF} ${PRIV_CID} ${S_OID}
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Get object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} s_file_read options=--ttl 1
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Head object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} ${EMPTY} options=--ttl 1
... Head object ${USER_KEY} ${PRIV_CID} ${S_OID} options=--ttl 1
Drop object ${NODE} ${WIF} ${PRIV_CID} ${S_OID}
@ -59,27 +59,27 @@ Drop command in control group
# Dropping complex object
##########################
${C_OID} = Put object ${USER_KEY} ${FILE_COMPLEX} ${PRIV_CID} ${EMPTY} ${EMPTY}
${C_OID} = Put object ${USER_KEY} ${FILE_COMPLEX} ${PRIV_CID}
Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read
Head object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY}
Head object ${USER_KEY} ${PRIV_CID} ${C_OID}
Drop object ${NODE} ${WIF} ${PRIV_CID} ${C_OID}
Drop object ${NODE} ${WIF} ${PRIV_CID} ${C_OID}
Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read
Head object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY}
Head object ${USER_KEY} ${PRIV_CID} ${C_OID}
@{SPLIT_OIDS} = Get Split objects ${USER_KEY} ${PRIV_CID} ${C_OID}
@{SPLIT_OIDS} = Get Split objects ${USER_KEY} ${PRIV_CID} ${C_OID}
FOR ${CHILD_OID} IN @{SPLIT_OIDS}
Drop object ${NODE} ${WIF} ${PRIV_CID} ${CHILD_OID}
END
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read options=--ttl 1
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Head object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY} options=--ttl 1
... Head object ${USER_KEY} ${PRIV_CID} ${C_OID} options=--ttl 1
[Teardown] Teardown netmap_control_drop

View file

@ -12,10 +12,10 @@ Resource payment_operations.robot
*** Variables ***
${POLICY} = REP 2 IN X CBF 1 SELECT 2 FROM * AS X
${ATTR_FILENAME} = FileName=new
${ATTR_DUPLICATE} = FileType=jpg, FileType=png
${ATTR_NONE} = NoAttribute=''
${ATTR_SINGLE} = AttrNum=one
&{ATTR_FILENAME} = FileName=new
${ATTR_DUPLICATE} = FileType=jpg,FileType=png
&{ATTR_NONE} = NoAttribute=''
&{ATTR_SINGLE} = AttrNum=one
*** Test Cases ***
@ -29,7 +29,7 @@ Duplicated Object Attributes
${WALLET} ${ADDR} ${USER_KEY} = Init Wallet with Address ${ASSETS_DIR}
Payment Operations ${ADDR} ${USER_KEY}
${PUBLIC_CID} = Create container ${USER_KEY} ${PUBLIC_ACL_F} ${POLICY} ${EMPTY}
${PUBLIC_CID} = Create container ${USER_KEY} ${PUBLIC_ACL_F} ${POLICY} ${EMPTY}
${FILE_S} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
@ -38,24 +38,27 @@ Duplicated Object Attributes
###################################################
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${ATTR_FILENAME}
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} user_headers=${ATTR_FILENAME}
# Robot doesn't allow to create a dictionary with the same keys, so using plain text option here
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${ATTR_DUPLICATE}
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} options=--attributes ${ATTR_DUPLICATE}
##################################################
# Checking that object cannot have empty attibute
##################################################
Run Keyword And Expect Error *
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${ATTR_NONE}
... Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} user_headers=${ATTR_NONE}
#####################################################
# Checking a successful step with a single attribute
#####################################################
${OID} = Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} ${EMPTY} ${ATTR_SINGLE}
${HEAD} = Head object ${USER_KEY} ${PUBLIC_CID} ${OID} json_output=True
${HEADER_58} = Decode Object System Header Json ${HEAD}
Verify Head Attribute ${HEADER_58} ${ATTR_SINGLE}
${OID} = Put object ${USER_KEY} ${FILE_S} ${PUBLIC_CID} user_headers=${ATTR_SINGLE}
${HEADER} = Head object ${USER_KEY} ${PUBLIC_CID} ${OID}
Dictionary Should Contain Sub Dictionary
... ${HEADER}[header][attributes]
... ${ATTR_SINGLE}
... msg="No expected User Attribute in HEAD response"
[Teardown] Teardown object_attributes

View file

@ -4,6 +4,7 @@ Variables common.py
Library neofs.py
Library payment_neogo.py
Library contract_keywords.py
Library Collections
Resource common_steps_object.robot
Resource setup_teardown.robot
@ -11,11 +12,14 @@ Resource payment_operations.robot
*** Variables ***
${CLEANUP_TIMEOUT} = 10s
&{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 simple object.
[Tags] Object NeoFS NeoCLI
[Documentation] Testcase to validate NeoFS operations with complex object.
[Tags] Object
[Timeout] 20 min
[Setup] Setup
@ -26,9 +30,9 @@ NeoFS Complex Object Operations
${FILE} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_HASH} = Get file hash ${FILE}
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
${H_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${H_OID_OTH} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH}
${S_OID} = Put object ${WIF} ${FILE} ${CID}
${H_OID} = Put object ${WIF} ${FILE} ${CID} user_headers=${FILE_USR_HEADER}
${H_OID_OTH} = Put object ${WIF} ${FILE} ${CID} user_headers=${FILE_USR_HEADER_OTH}
Should Be True '${S_OID}'!='${H_OID}' and '${H_OID}'!='${H_OID_OTH}'
@ -40,43 +44,50 @@ NeoFS Complex Object Operations
@{S_OBJ_H} = Create List ${H_OID}
@{S_OBJ_H_OTH} = Create List ${H_OID_OTH}
Search Object ${WIF} ${CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_ALL}
Search Object ${WIF} ${CID} --root expected_objects_list=${S_OBJ_ALL}
${GET_OBJ_S} = Get object ${WIF} ${CID} ${S_OID} ${EMPTY} s_file_read
${GET_OBJ_H} = Get object ${WIF} ${CID} ${H_OID} ${EMPTY} h_file_read
${GET_OBJ_S} = Get object ${WIF} ${CID} ${S_OID}
${GET_OBJ_H} = Get object ${WIF} ${CID} ${H_OID}
Verify file hash ${GET_OBJ_S} ${FILE_HASH}
Verify file hash ${GET_OBJ_H} ${FILE_HASH}
${FILE_HASH_S} = Get file hash ${GET_OBJ_S}
${FILE_HASH_H} = Get file hash ${GET_OBJ_H}
Get Range Hash ${WIF} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${H_OID} ${EMPTY} 0:10
Should Be Equal ${FILE_HASH_S} ${FILE_HASH}
Should Be Equal ${FILE_HASH_H} ${FILE_HASH}
Get Range ${WIF} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10
Get Range ${WIF} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${H_OID} ${EMPTY} 0:10
Search object ${WIF} ${CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_ALL}
Search object ${WIF} ${CID} --root ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${WIF} ${CID} --root ${EMPTY} ${FILE_USR_HEADER_OTH} ${S_OBJ_H_OTH}
Get Range ${WIF} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10
Get Range ${WIF} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10
Head object ${WIF} ${CID} ${S_OID} ${EMPTY}
Head object ${WIF} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER}
Search object ${WIF} ${CID} --root expected_objects_list=${S_OBJ_ALL}
Search object ${WIF} ${CID} --root filters=${FILE_USR_HEADER} expected_objects_list=${S_OBJ_H}
Search object ${WIF} ${CID} --root filters=${FILE_USR_HEADER_OTH} expected_objects_list=${S_OBJ_H_OTH}
Verify Split Chain ${WIF} ${CID} ${S_OID}
Verify Split Chain ${WIF} ${CID} ${H_OID}
Head object ${WIF} ${CID} ${S_OID}
&{RESPONSE} = Head object ${WIF} ${CID} ${H_OID}
Dictionary Should Contain Sub Dictionary
... ${RESPONSE}[header][attributes]
... ${FILE_USR_HEADER}
... msg="There are no User Headers in HEAD response"
${TOMBSTONE_S} = Delete object ${WIF} ${CID} ${S_OID} ${EMPTY}
${TOMBSTONE_H} = Delete object ${WIF} ${CID} ${H_OID} ${EMPTY}
Verify Split Chain ${WIF} ${CID} ${S_OID}
Verify Split Chain ${WIF} ${CID} ${H_OID}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_S} ${S_OID} ${ADDR}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_H} ${H_OID} ${ADDR}
${TOMBSTONE_S} = Delete object ${WIF} ${CID} ${S_OID}
${TOMBSTONE_H} = Delete object ${WIF} ${CID} ${H_OID}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_S} ${S_OID} ${ADDR}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_H} ${H_OID} ${ADDR}
Tick Epoch
# we assume that during this time objects must be deleted
Sleep ${CLEANUP_TIMEOUT}
Run Keyword And Expect Error *
Run Keyword And Expect Error "rpc error: status: code = 1024 message = object already removed"
... Get object ${WIF} ${CID} ${S_OID} ${EMPTY} ${GET_OBJ_S}
Run Keyword And Expect Error *
Run Keyword And Expect Error "rpc error: status: code = 1024 message = object already removed"
... Get object ${WIF} ${CID} ${H_OID} ${EMPTY} ${GET_OBJ_H}
[Teardown] Teardown object_complex

View file

@ -4,6 +4,7 @@ Variables common.py
Library neofs.py
Library payment_neogo.py
Library contract_keywords.py
Library Collections
Resource common_steps_object.robot
Resource payment_operations.robot
@ -11,11 +12,14 @@ Resource setup_teardown.robot
*** Variables ***
${CLEANUP_TIMEOUT} = 10s
&{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
[Tags] Object
[Timeout] 10 min
[Setup] Setup
@ -28,39 +32,46 @@ NeoFS Simple Object Operations
${FILE_HASH} = Get file hash ${FILE}
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
${H_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER}
${H_OID_OTH} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${FILE_USR_HEADER_OTH}
${S_OID} = Put object ${WIF} ${FILE} ${CID}
${H_OID} = Put object ${WIF} ${FILE} ${CID} user_headers=${FILE_USR_HEADER}
${H_OID_OTH} = Put object ${WIF} ${FILE} ${CID} user_headers=${FILE_USR_HEADER_OTH}
Validate storage policy for object ${WIF} 2 ${CID} ${S_OID}
Validate storage policy for object ${WIF} 2 ${CID} ${H_OID}
Validate storage policy for object ${WIF} 2 ${CID} ${H_OID_OTH}
Validate storage policy for object ${WIF} 2 ${CID} ${S_OID}
Validate storage policy for object ${WIF} 2 ${CID} ${H_OID}
Validate storage policy for object ${WIF} 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_OBJ_S} = Get object ${WIF} ${CID} ${S_OID} ${EMPTY} s_file_read
${GET_OBJ_H} = Get object ${WIF} ${CID} ${H_OID} ${EMPTY} h_file_read
${GET_OBJ_S} = Get object ${WIF} ${CID} ${S_OID}
${GET_OBJ_H} = Get object ${WIF} ${CID} ${H_OID}
Verify file hash ${GET_OBJ_S} ${FILE_HASH}
Verify file hash ${GET_OBJ_H} ${FILE_HASH}
${FILE_HASH_S} = Get file hash ${GET_OBJ_S}
${FILE_HASH_H} = Get file hash ${GET_OBJ_H}
Get Range Hash ${WIF} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${H_OID} ${EMPTY} 0:10
Should Be Equal ${FILE_HASH_S} ${FILE_HASH}
Should Be Equal ${FILE_HASH_H} ${FILE_HASH}
Get Range ${WIF} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10
Get Range ${WIF} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${WIF} ${CID} ${H_OID} ${EMPTY} 0:10
Search object ${WIF} ${CID} ${EMPTY} ${EMPTY} ${EMPTY} ${S_OBJ_ALL}
Search object ${WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER} ${S_OBJ_H}
Search object ${WIF} ${CID} ${EMPTY} ${EMPTY} ${FILE_USR_HEADER_OTH} ${S_OBJ_H_OTH}
Get Range ${WIF} ${CID} ${S_OID} s_get_range ${EMPTY} 0:10
Get Range ${WIF} ${CID} ${H_OID} h_get_range ${EMPTY} 0:10
Head object ${WIF} ${CID} ${S_OID} ${EMPTY}
Head object ${WIF} ${CID} ${H_OID} ${EMPTY} ${FILE_USR_HEADER}
Search object ${WIF} ${CID} expected_objects_list=${S_OBJ_ALL}
Search object ${WIF} ${CID} filters=${FILE_USR_HEADER} expected_objects_list=${S_OBJ_H}
Search object ${WIF} ${CID} filters=${FILE_USR_HEADER_OTH} expected_objects_list=${S_OBJ_H_OTH}
${TOMBSTONE_S} = Delete object ${WIF} ${CID} ${S_OID} ${EMPTY}
${TOMBSTONE_H} = Delete object ${WIF} ${CID} ${H_OID} ${EMPTY}
Head object ${WIF} ${CID} ${S_OID}
&{RESPONSE} = Head object ${WIF} ${CID} ${H_OID}
Dictionary Should Contain Sub Dictionary
... ${RESPONSE}[header][attributes]
... ${FILE_USR_HEADER}
... msg="There are no User Headers in HEAD response"
${TOMBSTONE_S} = Delete object ${WIF} ${CID} ${S_OID}
${TOMBSTONE_H} = Delete object ${WIF} ${CID} ${H_OID}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_S} ${S_OID} ${ADDR}
Verify Head tombstone ${WIF} ${CID} ${TOMBSTONE_H} ${H_OID} ${ADDR}

View file

@ -9,6 +9,9 @@ Resource common_steps_object.robot
Resource setup_teardown.robot
Resource payment_operations.robot
*** Variables ***
${UNEXIST_OID} = B2DKvkHnLnPvapbDgfpU1oVUPuXQo5LTfKVxmNDZXQff
*** Test cases ***
NeoFS Complex Storagegroup
[Documentation] Testcase to validate NeoFS operations with Storagegroup.

View file

@ -8,6 +8,8 @@ Resource common_steps_object.robot
Resource setup_teardown.robot
Resource payment_operations.robot
*** Variables ***
${UNEXIST_OID} = B2DKvkHnLnPvapbDgfpU1oVUPuXQo5LTfKVxmNDZXQff
*** Test cases ***
NeoFS Simple Storagegroup

View file

@ -1,21 +1,21 @@
EACL_OBJ_FILTERS = {'$Object:objectID': 'ID',
'$Object:containerID': 'CID',
'$Object:ownerID': 'OwnerID',
'$Object:creationEpoch': 'CreatedAtEpoch',
'$Object:payloadLength': 'PayloadLength',
'$Object:payloadHash': 'PayloadHash',
'$Object:objectType': 'Type',
'$Object:homomorphicHash': 'HomoHash',
'$Object:version': 'Version'}
EACL_OBJ_FILTERS = {'$Object:objectID': 'ID',
'$Object:containerID': 'CID',
'$Object:ownerID': 'OwnerID',
'$Object:creationEpoch': 'creationEpoch',
'$Object:payloadLength': 'payloadLength',
'$Object:payloadHash': 'payloadHash',
'$Object:objectType': 'objectType',
'$Object:homomorphicHash': 'homomorphicHash',
'$Object:version': 'version'}
VERB_FILTER_DEP = {
'$Object:objectID': ['GET', 'HEAD', 'DELETE', 'RANGE', 'RANGEHASH'],
'$Object:containerID': ['GET', 'PUT', 'HEAD', 'DELETE', 'SEARCH', 'RANGE', 'RANGEHASH'],
'$Object:ownerID': ['GET', 'HEAD'],
'$Object:creationEpoch': ['GET', 'PUT', 'HEAD'],
'$Object:payloadLength': ['GET', 'PUT', 'HEAD'],
'$Object:payloadHash': ['GET', 'PUT', 'HEAD'],
'$Object:objectType': ['GET', 'PUT', 'HEAD'],
'$Object:homomorphicHash': ['GET', 'PUT', 'HEAD'],
'$Object:objectID': ['GET', 'HEAD', 'DELETE', 'RANGE', 'RANGEHASH'],
'$Object:containerID': ['GET', 'PUT', 'HEAD', 'DELETE', 'SEARCH', 'RANGE', 'RANGEHASH'],
'$Object:ownerID': ['GET', 'HEAD'],
'$Object:creationEpoch': ['GET', 'PUT', 'HEAD'],
'$Object:payloadLength': ['GET', 'PUT', 'HEAD'],
'$Object:payloadHash': ['GET', 'PUT', 'HEAD'],
'$Object:objectType': ['GET', 'PUT', 'HEAD'],
'$Object:homomorphicHash': ['GET', 'PUT', 'HEAD'],
'$Object:version': ['GET', 'PUT', 'HEAD']
}