Temporary Directory created

This commit is contained in:
EliChin 2021-03-29 13:18:24 +03:00 committed by GitHub
parent 36e6cde527
commit f70e0852aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 108 additions and 175 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@
# ignore pycache under any path
**/__pycache__
TemporaryDir/*

View file

@ -14,6 +14,7 @@ import base58
import docker
import json
import tarfile
import shutil
import time
from datetime import datetime
@ -21,10 +22,10 @@ from datetime import datetime
if os.getenv('ROBOT_PROFILE') == 'selectel_smoke':
from selectelcdn_smoke_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP)
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR)
else:
from neofs_int_vars import (NEOGO_CLI_PREFIX, NEO_MAINNET_ENDPOINT,
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP)
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, NEOFS_NETMAP, TEMP_DIR)
ROBOT_AUTO_KEYWORDS = False
@ -201,6 +202,7 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_
cid_base64 = base64.b64encode(cid_base58_b).decode("utf-8")
eacl = get_eacl(private_key, cid)
json_eacl = {}
file_path = TEMP_DIR + file_name
if eacl:
res_json = re.split(r'[\s\n]+Signature:', eacl)
@ -228,15 +230,15 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_
for record in json_eacl["records"]:
eacl_result["body"]["eaclTable"]["records"].append(record)
with open(file_name, 'w', encoding='utf-8') as f:
with open(file_path, 'w', encoding='utf-8') as f:
json.dump(eacl_result, f, ensure_ascii=False, indent=4)
logger.info(eacl_result)
# Sign bearer token
Cmd = (
f'{NEOFS_CLI_EXEC} util sign bearer-token --from {file_name} '
f'--to {file_name} --key {private_key} --json'
f'{NEOFS_CLI_EXEC} util sign bearer-token --from {file_path} '
f'--to {file_path} --key {private_key} --json'
)
logger.info("Cmd: %s" % Cmd)
@ -248,7 +250,7 @@ def form_bearertoken_file(private_key: str, cid: str, file_name: str, eacl_oper_
except subprocess.CalledProcessError as e:
raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
return file_name
return file_path
@keyword('Form eACL json common file')
def form_eacl_json_common_file(file_name, eacl_oper_list ):
@ -285,12 +287,12 @@ def get_range(private_key: str, cid: str, oid: str, range_file: str, bearer: str
range_cut: str, options:str=""):
bearer_token = ""
if bearer:
bearer_token = f"--bearer {bearer}"
bearer_token = f"--bearer {TEMP_DIR}{bearer}"
Cmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} '
f'object range --cid {cid} --oid {oid} {bearer_token} --range {range_cut} '
f'--file {range_file} {options}'
f'--file {TEMP_DIR}{range_file} {options}'
)
logger.info("Cmd: %s" % Cmd)
@ -362,7 +364,7 @@ def generate_file_of_bytes(size):
size = int(float(size))
filename = str(uuid.uuid4())
filename = TEMP_DIR + str(uuid.uuid4())
with open('%s'%filename, 'wb') as fout:
fout.write(os.urandom(size))
@ -377,7 +379,7 @@ def search_object(private_key: str, cid: str, keys: str, bearer: str, filters: s
filters_result = ""
if bearer:
bearer_token = f"--bearer {bearer}"
bearer_token = f"--bearer {TEMP_DIR}{bearer}"
if filters:
for filter_item in filters.split(','):
filter_item = re.sub(r'=', ' EQ ', filter_item)
@ -652,7 +654,7 @@ def head_object(private_key: str, cid: str, oid: str, bearer_token: str="",
user_headers:str="", options:str="", endpoint: str="", ignore_failure: bool = False):
if bearer_token:
bearer_token = f"--bearer {bearer_token}"
bearer_token = f"--bearer {TEMP_DIR}{bearer_token}"
if endpoint == "":
endpoint = NEOFS_ENDPOINT
@ -792,7 +794,7 @@ def parse_object_system_header(header: str):
def delete_object(private_key: str, cid: str, oid: str, bearer: str, options: str=""):
bearer_token = ""
if bearer:
bearer_token = f"--bearer {bearer}"
bearer_token = f"--bearer {TEMP_DIR}{bearer}"
ObjectCmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} '
@ -814,7 +816,7 @@ def get_file_name(filepath):
return filename
@keyword('Get file hash')
def get_file_hash(filename):
def get_file_hash(filename : str):
file_hash = _get_file_hash(filename)
return file_hash
@ -827,16 +829,15 @@ def verify_file_hash(filename, expected_hash):
raise Exception("File hash '{}' is not equal to {}".format(file_hash, expected_hash))
@keyword('Cleanup Files')
def cleanup_file(*filename_list):
for filename in filename_list:
if os.path.isfile(filename):
def cleanup_file():
if os.path.isdir(TEMP_DIR):
try:
os.remove(filename)
shutil.rmtree(TEMP_DIR)
except OSError as e:
raise Exception("Error: '%s' - %s." % (e.filename, e.strerror))
raise Exception(f"Error: '{e.TEMP_DIR}' - {e.strerror}.")
else:
logger.warn("Error: '%s' file not found" % filename)
logger.info("File '%s' has been deleted." % filename)
logger.warn(f"Error: '{TEMP_DIR}' file not found")
logger.info(f"File '{TEMP_DIR}' has been deleted.")
@keyword('Put object')
def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers: str,
@ -849,7 +850,7 @@ def put_object(private_key: str, path: str, cid: str, bearer: str, user_headers:
if user_headers:
user_headers = f"--attributes {user_headers}"
if bearer:
bearer = f"--bearer {bearer}"
bearer = f"--bearer {TEMP_DIR}{bearer}"
putObjectCmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --key {private_key} object '
@ -932,7 +933,7 @@ def find_in_nodes_Log(line: str, nodes_logs_time: dict):
def get_range_hash(private_key: str, cid: str, oid: str, bearer_token: str,
range_cut: str, options: str=""):
if bearer_token:
bearer_token = f"--bearer {bearer_token}"
bearer_token = f"--bearer {TEMP_DIR}{bearer_token}"
ObjectCmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {NEOFS_ENDPOINT} --key {private_key} '
@ -951,17 +952,19 @@ def get_range_hash(private_key: str, cid: str, oid: str, bearer_token: str,
def get_object(private_key: str, cid: str, oid: str, bearer_token: str,
write_object: str, endpoint: str="", options: str="" ):
file_path = TEMP_DIR + write_object
logger.info("Going to put the object")
if not endpoint:
endpoint = random.sample(_get_storage_nodes(), 1)[0]
if bearer_token:
bearer_token = f"--bearer {bearer_token}"
bearer_token = f"--bearer {TEMP_DIR}{bearer_token}"
ObjectCmd = (
f'{NEOFS_CLI_EXEC} --rpc-endpoint {endpoint} --key {private_key} '
f'object get --cid {cid} --oid {oid} --file {write_object} {bearer_token} '
f'object get --cid {cid} --oid {oid} --file {file_path} {bearer_token} '
f'{options}'
)
logger.info("Cmd: %s" % ObjectCmd)
@ -971,6 +974,7 @@ def get_object(private_key: str, cid: str, oid: str, bearer_token: str,
logger.info("Output: %s" % complProc.stdout)
except subprocess.CalledProcessError as e:
raise Exception("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
return file_path

View file

@ -11,3 +11,4 @@ NEOFS_NETMAP = ['s01.neofs.devenv:8080', 's02.neofs.devenv:8080','s03.neofs.deve
GAS_HASH = '0x70e2301955bf1e74cbb31d18c2f96972abadb328'
NEOFS_CONTRACT = "005a4906ec233a3b677dad9fd7033ad8653f579d"
TEMP_DIR = "TemporaryDir/"

View file

@ -20,10 +20,10 @@ ROBOT_AUTO_KEYWORDS = False
if os.getenv('ROBOT_PROFILE') == 'selectel_smoke':
from selectelcdn_smoke_vars import (NEO_MAINNET_ENDPOINT,
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT)
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR)
else:
from neofs_int_vars import (NEO_MAINNET_ENDPOINT,
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT)
NEOFS_NEO_API_ENDPOINT, NEOFS_ENDPOINT, GAS_HASH, NEOFS_CONTRACT, TEMP_DIR)
# path to neofs-cli executable
NEOFS_CLI_EXEC = os.getenv('NEOFS_CLI_EXEC', 'neofs-cli')
@ -31,7 +31,9 @@ NEOGO_CLI_EXEC = os.getenv('NEOGO_CLI_EXEC', 'neo-go')
@keyword('Init wallet')
def init_wallet():
filename = os.getcwd() + '/' + str(uuid.uuid4()) + ".json"
if not os.path.exists(TEMP_DIR):
os.makedirs(TEMP_DIR)
filename = os.getcwd() + '/' + TEMP_DIR + str(uuid.uuid4()) + ".json"
cmd = f"{NEOGO_CLI_EXEC} wallet init -w {filename}"
logger.info(f"Executing command: {cmd}")
stdout = _run_sh(cmd)
@ -248,21 +250,18 @@ def _get_balance_request(privkey: str):
f'{NEOFS_CLI_EXEC} --key {privkey} --rpc-endpoint {NEOFS_ENDPOINT}'
f' accounting balance'
)
logger.info("Cmd: %s" % Cmd)
logger.info(f"Cmd: {Cmd}")
complProc = subprocess.run(Cmd, check=True, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=150, shell=True)
output = complProc.stdout
logger.info("Output: %s" % output)
logger.info(f"Output: {output}")
if output is None:
BuiltIn().fatal_error(f'Can not parse balance: "{output}"')
m = re.match(r'(-?[\d.\.?\d*]+)', output )
if m is None:
BuiltIn().fatal_error('Can not parse balance: "%s"' % output)
balance = m.group(1)
logger.info(f"Balance for '{privkey}' is '{output}'" )
logger.info("Balance for '%s' is '%s'" % (privkey, balance) )
return balance
return output
def _run_sh(args):
complProc = subprocess.run(args, check=True, universal_newlines=True,

View file

@ -1,6 +1,5 @@
*** Settings ***
Variables ../../../variables/common.py
Library Collections
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
@ -132,6 +131,4 @@ Check Private Container
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range
Cleanup Files @{CLEANUP_FILES}
Get Docker Logs acl_basic
Cleanup Files

View file

@ -1,6 +1,5 @@
*** Settings ***
Variables ../../../variables/common.py
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
@ -103,6 +102,4 @@ Check Public Container
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range
Cleanup Files @{CLEANUP_FILES}
Get Docker Logs acl_basic
Cleanup Files

View file

@ -1,6 +1,5 @@
*** Settings ***
Variables ../../../variables/common.py
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
@ -113,6 +112,4 @@ Check Read-Only Container
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} s_file_read s_get_range
Cleanup Files @{CLEANUP_FILES}
Get Docker Logs acl_basic
Cleanup Files

View file

@ -21,7 +21,6 @@ BearerToken Operations
Check eACL Deny and Allow All Bearer Simple
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Complex
@ -101,7 +100,4 @@ Check eACL Deny and Allow All Bearer
Delete object ${USER_KEY} ${CID} ${S_OID_USER} bearer_allow_all_user
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Get Docker Logs acl_bearer
Cleanup Files

View file

@ -20,7 +20,7 @@ BearerToken Operations for Сompound Operations
Check Сompound Operations
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check Сompound Operations
@ -122,7 +122,4 @@ Check Bearer Сompound Get Range Hash
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... gen_eacl_deny_all_USER bearer_allow
Cleanup Files @{CLEANUP_FILES}
Get Docker Logs acl_bearer
Cleanup Files

View file

@ -21,7 +21,7 @@ BearerToken Operations with Filter OID Equal
Check eACL Deny and Allow All Bearer Filter OID Equal
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter OID Equal
@ -90,7 +90,5 @@ Check eACL Deny and Allow All Bearer Filter OID Equal
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations with Filter OID NotEqual
Check eACL Deny and Allow All Bearer Filter OID NotEqual
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter OID NotEqual
@ -118,7 +118,5 @@ Check eACL Deny and Allow All Bearer Filter OID NotEqual
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations with Filter UserHeader Equal
Generate file 1024
Check eACL Deny and Allow All Bearer Filter UserHeader Equal
Cleanup Files ${FILE_S}
Log Check Bearer token with complex object
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter UserHeader Equal
@ -124,7 +124,5 @@ Check eACL Deny and Allow All Bearer Filter UserHeader Equal
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations Filter UserHeader NotEqual
Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
@ -107,7 +107,5 @@ Check eACL Deny and Allow All Bearer Filter UserHeader NotEqual
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations for Inaccessible Container
Check Container Inaccessible and Allow All Bearer
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check Container Inaccessible and Allow All Bearer
@ -61,7 +61,5 @@ Check Container Inaccessible and Allow All Bearer
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S}
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -24,7 +24,7 @@ BearerToken Operations
Check eACL Allow All Bearer Filter Requst Equal Deny
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Allow All Bearer Filter Requst Equal Deny
@ -78,7 +78,5 @@ Check eACL Allow All Bearer Filter Requst Equal Deny
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations with Filter Requst Equal
Check eACL Deny and Allow All Bearer Filter Requst Equal
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter Requst Equal
@ -81,7 +81,5 @@ Check eACL Deny and Allow All Bearer Filter Requst Equal
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -21,7 +21,7 @@ BearerToken Operations with Filter Requst NotEqual
Check eACL Deny and Allow All Bearer Filter Requst NotEqual
Log Check Bearer token with complex object
Cleanup Files ${FILE_S}
Generate file 70e+6
Check eACL Deny and Allow All Bearer Filter Requst NotEqual
@ -80,7 +80,5 @@ Check eACL Deny and Allow All Bearer Filter Requst NotEqual
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} local_file_eacl s_get_range
... bearer_allow_all_user gen_eacl_deny_all_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_bearer

View file

@ -20,7 +20,6 @@ Extended ACL Operations
Generate files 1024
Check Actions
Cleanup Files ${FILE_S} ${FILE_S_2}
Log Check extended ACL with complex object
Generate files 70e+6
@ -240,12 +239,5 @@ Check eACL Deny and Allow All
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl s_get_range
... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER
... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS
... gen_eacl_deny_all_OTHERS
... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS
... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER
... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_extended

View file

@ -20,7 +20,7 @@ Extended ACL Operations
Generate files 1024
Check Сompound Operations
Cleanup Files ${FILE_S} ${FILE_S_2}
Log Check extended ACL with complex object
Generate files 70e+6
@ -106,12 +106,5 @@ Check eACL Сompound Get Range Hash
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl s_get_range
... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER
... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS
... gen_eacl_deny_all_OTHERS
... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS
... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER
... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_extended

View file

@ -19,7 +19,6 @@ Extended ACL Operations
Generate files 1024
Check Filters
Cleanup Files ${FILE_S} ${FILE_S_2}
Log Check extended ACL with complex object
Generate files 70e+6
@ -202,12 +201,5 @@ Check eACL MatchType String Not Equal Object
Cleanup
@{CLEANUP_FILES} = Create List ${FILE_S} ${FILE_S_2} local_file_eacl eacl_custom s_get_range
... gen_eacl_allow_all_OTHERS gen_eacl_deny_all_USER gen_eacl_allow_all_USER
... gen_eacl_deny_all_SYSTEM gen_eacl_allow_all_SYSTEM gen_eacl_allow_pubkey_deny_OTHERS
... gen_eacl_deny_all_OTHERS
... gen_eacl_compound_del_SYSTEM gen_eacl_compound_del_USER gen_eacl_compound_del_OTHERS
... gen_eacl_compound_get_hash_OTHERS gen_eacl_compound_get_hash_SYSTEM gen_eacl_compound_get_hash_USER
... gen_eacl_compound_get_OTHERS gen_eacl_compound_get_SYSTEM gen_eacl_compound_get_USER
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs acl_extended

View file

@ -60,7 +60,7 @@ NeoFS Simple Netmap
Run Keyword And Expect Error *
... Validate Policy REP 2 IN X CBF 2 SELECT 6 FROM * AS X 2 @{EMPTY}
[Teardown] Cleanup ${FILE}
[Teardown] Cleanup
*** Keywords ***
@ -109,6 +109,5 @@ Validate Policy
Cleanup
[Arguments] ${FILE}
Cleanup Files ${FILE} s_file_read
Cleanup Files
Get Docker Logs netmap_simple

View file

@ -53,16 +53,13 @@ NeoFS Object Replication
Find in Nodes Log object successfully replicated ${NODES_LOG_TIME}
Start nodes @{NODES_OBJ_STOPPED}
[Teardown] Cleanup ${FILE} @{NODES_OBJ_STOPPED}
Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE} @{NODES_OBJ_STOPPED}
Start nodes @{NODES_OBJ_STOPPED}
Cleanup Files ${FILE}
Cleanup Files
Get Docker Logs replication

View file

@ -57,11 +57,11 @@ NeoFS Complex Object Operations
Search object ${PRIV_KEY} ${CID} --root ${EMPTY} ${EMPTY} ${S_OBJ_ALL}
Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
${GET_OBJ_H} = Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
Verify file hash s_file_read ${FILE_HASH}
Verify file hash h_file_read ${FILE_HASH}
Verify file hash ${GET_OBJ_S} ${FILE_HASH}
Verify file hash ${GET_OBJ_H} ${FILE_HASH}
Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10
@ -88,20 +88,17 @@ NeoFS Complex Object Operations
Sleep 2min
Run Keyword And Expect Error *
... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${GET_OBJ_S}
Run Keyword And Expect Error *
... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
[Teardown] Cleanup ${FILE}
... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${GET_OBJ_H}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE}
@{CLEANUP_FILES} = Create List ${FILE} s_file_read h_file_read s_get_range h_get_range
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs object_complex

View file

@ -54,11 +54,11 @@ NeoFS Simple Object Operations
@{S_OBJ_H} = Create List ${H_OID}
@{S_OBJ_H_OTH} = Create List ${H_OID_OTH}
Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
${GET_OBJ_H} = Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
Verify file hash s_file_read ${FILE_HASH}
Verify file hash h_file_read ${FILE_HASH}
Verify file hash ${GET_OBJ_S} ${FILE_HASH}
Verify file hash ${GET_OBJ_H} ${FILE_HASH}
Get Range Hash ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} 0:10
Get Range Hash ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} 0:10
@ -82,22 +82,19 @@ NeoFS Simple Object Operations
Sleep 2min
Run Keyword And Expect Error *
... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
... Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} ${GET_OBJ_S}
Run Keyword And Expect Error *
... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} h_file_read
... Get object ${PRIV_KEY} ${CID} ${H_OID} ${EMPTY} ${GET_OBJ_H}
[Teardown] Cleanup ${FILE}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE}
@{CLEANUP_FILES} = Create List ${FILE} s_file_read h_file_read s_get_range h_get_range
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs object_simple

View file

@ -76,15 +76,12 @@ NeoFS Complex Storagegroup
Run Keyword And Expect Error *
... Delete Storagegroup ${PRIV_KEY} ${CID} ${UNEXIST_OID}
[Teardown] Cleanup ${FILE_S}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE}
@{CLEANUP_FILES} = Create List ${FILE}
Cleanup Files @{CLEANUP_FILES}
Cleanup Files
Get Docker Logs object_storage_group_complex

View file

@ -73,15 +73,12 @@ NeoFS Simple Storagegroup
Run Keyword And Expect Error *
... Delete Storagegroup ${PRIV_KEY} ${CID} ${UNEXIST_OID}
[Teardown] Cleanup ${FILE_S}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE}
@{CLEANUP_FILES} = Create List ${FILE}
Cleanup Files @{CLEANUP_FILES}
Create List
Get Docker Logs object_storage_group_simple

View file

@ -58,4 +58,5 @@ NeoFS Deposit and Withdraw
*** Keywords ***
Cleanup
Cleanup Files
Get Docker Logs withdraw

View file

@ -48,28 +48,27 @@ NeoFS HTTP Gateway
@{GET_NODE_LIST} = Get nodes without object ${PRIV_KEY} ${CID} ${S_OID}
${NODE} = Evaluate random.choice($GET_NODE_LIST) random
Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE}
${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE}
${FILEPATH} = Get via HTTP Gate ${CID} ${S_OID}
Verify file hash s_file_read ${FILE_HASH}
Verify file hash ${GET_OBJ_S} ${FILE_HASH}
Verify file hash ${FILEPATH} ${FILE_HASH}
@{GET_NODE_LIST} = Get nodes without object ${PRIV_KEY} ${CID} ${L_OID}
${NODE} = Evaluate random.choice($GET_NODE_LIST) random
Get object ${PRIV_KEY} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE}
${GET_OBJ_L} = Get object ${PRIV_KEY} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE}
${FILEPATH} = Get via HTTP Gate ${CID} ${L_OID}
Verify file hash l_file_read ${FILE_L_HASH}
Verify file hash ${GET_OBJ_L} ${FILE_L_HASH}
Verify file hash ${FILEPATH} ${FILE_L_HASH}
[Teardown] Cleanup ${FILEPATH} ${FILE}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILEPATH} ${FILE}
Cleanup Files ${FILEPATH} ${FILE} s_file_read l_file_read
Cleanup Files
Get Docker Logs http_gate

View file

@ -85,12 +85,10 @@ NeoFS S3 Gateway
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${BUCKET}
List Should Not Contain Value ${LIST_S3_OBJECTS} FILE_S3_NAME
[Teardown] Cleanup ${FILE_S3} ${FILE_FS}
[Teardown] Cleanup
*** Keywords ***
Cleanup
[Arguments] ${FILE_S3} ${FILE_FS}
Cleanup Files s3_obj_get_fs fs_obj_get_fs s3_obj_get_s3 fs_obj_get_s3
... ${FILE_S3} ${FILE_FS}
Cleanup Files
Get Docker Logs s3_gate

View file

@ -12,3 +12,4 @@ ABSOLUTE_FILE_PATH="/robot/testsuites/integration"
# Price of the contract Deposit execution: 0.1493182 GAS
NEOFS_CONTRACT_DEPOSIT_GAS_FEE = 0.1493182
NEOFS_CONTRACT_WITHDRAW_GAS_FEE = 0.0331791
TEMP_DIR = "TemporaryDir/"