"Neofs Deposit" moved to keywords repo and changed its signature

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2021-06-01 15:07:31 +03:00 committed by Anastasia Prasolova
parent e0b0cbf823
commit 8d50305982
37 changed files with 252 additions and 354 deletions

View file

@ -47,21 +47,6 @@ def withdraw_mainnet_gas(wallet: str, address: str, scripthash: str, amount: int
return tx
@keyword('NeoFS Deposit')
def neofs_deposit(wallet_file: str, address: str, scripthash: str, amount: int, wallet_pass:str=''):
# 1) Get NeoFS contract address.
deposit_addr = converters.contract_hash_to_address(NEOFS_CONTRACT)
logger.info(f"deposit_addr: {deposit_addr}")
# 2) Transfer GAS to the NeoFS contract address.
out = wallet.new_nep17_transfer(address, deposit_addr, amount, 'GAS', wallet_file, '', NEO_MAINNET_ENDPOINT)
if len(out) != 64:
raise Exception("Can not get Tx.")
return out
@keyword('Transaction accepted in block')
def transaction_accepted_in_block(tx_id):
"""

View file

@ -0,0 +1,39 @@
*** Settings ***
Variables ../../variables/common.py
Library wallet_keywords.py
Library rpc_call_keywords.py
*** Variables ***
${TRANSFER_AMOUNT} = ${30}
${DEPOSIT_AMOUNT} = ${25}
*** Keywords ***
Generate Keys
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
Set Global Variable ${USER_KEY} ${USER_KEY_GEN}
Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN}
Set Global Variable ${SYSTEM_KEY_IR} ${NEOFS_IR_WIF}
Set Global Variable ${SYSTEM_KEY_SN} ${NEOFS_SN_WIF}
Payment Operations ${ADDR} ${USER_KEY}
Payment Operations ${ADDR_OTH} ${OTHER_KEY}
Payment Operations
[Arguments] ${ADDR} ${WIF}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX_DEPOSIT}

View file

@ -5,6 +5,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -5,6 +5,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -5,6 +5,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_basic.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***

View file

@ -3,9 +3,10 @@ Variables ../../../variables/common.py
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
BearerToken Operations for Сompound Operations
@ -16,6 +17,7 @@ BearerToken Operations for Сompound Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations with Filter OID Equal
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations with Filter OID NotEqual
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
BearerToken Operations with Filter UserHeader Equal
@ -16,6 +17,7 @@ BearerToken Operations with Filter UserHeader Equal
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
BearerToken Operations Filter UserHeader NotEqual
@ -16,6 +17,7 @@ BearerToken Operations Filter UserHeader NotEqual
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -7,6 +7,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
BearerToken Operations for Inaccessible Container
@ -17,6 +18,7 @@ BearerToken Operations for Inaccessible Container
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
BearerToken Operations
@ -16,6 +17,7 @@ BearerToken Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations with Filter Requst Equal
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library Collections
Resource common_steps_acl_bearer.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ BearerToken Operations with Filter Requst NotEqual
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check Bearer token with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
Extended ACL Operations
@ -16,6 +17,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
Extended ACL Operations
@ -16,6 +17,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
Extended ACL Operations
@ -16,6 +17,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
Extended ACL Operations
@ -16,6 +17,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -17,6 +18,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -6,6 +6,7 @@ Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/utility_keywords.py
Resource common_steps_acl_extended.robot
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
Extended ACL Operations
@ -16,6 +17,7 @@ Extended ACL Operations
[Setup] Create Temporary Directory
Generate Keys
Generate eACL Keys
Prepare eACL Role rules
Log Check extended ACL with simple object

View file

@ -1,52 +1,12 @@
*** Settings ***
Variables ../../../variables/common.py
Library ${KEYWORDS}/wallet_keywords.py
Library ${KEYWORDS}/rpc_call_keywords.py
*** Variables ***
${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
${TRANSFER_AMOUNT} = ${3}
*** Keywords ***
Generate Keys
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
${SYSTEM_KEY_GEN} = Set Variable ${NEOFS_IR_WIF}
${SYSTEM_KEY_GEN_SN} = Set Variable ${NEOFS_SN_WIF}
Set Global Variable ${USER_KEY} ${USER_KEY_GEN}
Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN}
Set Global Variable ${SYSTEM_KEY_IR} ${SYSTEM_KEY_GEN}
Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN}
Payment Operations ${WALLET} ${ADDR} ${USER_KEY}
Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY}
# Basic ACL manual page: https://neospcc.atlassian.net/wiki/spaces/NEOF/pages/362348545/NeoFS+ACL
# TODO: X - Sticky bit validation on public container
Payment Operations
[Arguments] ${WALLET} ${ADDR} ${KEY}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} 3
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 2
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
Create Containers
Log Create Private Container
${PRIV_CID_GEN} = Create container ${USER_KEY} 0x18888888 ${RULE_FOR_ALL}

View file

@ -1,56 +1,19 @@
*** Settings ***
Variables ../../../variables/common.py
Library ${KEYWORDS}/wallet_keywords.py
Library ${KEYWORDS}/rpc_call_keywords.py
*** Variables ***
${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth
${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
${TRANSFER_AMOUNT} = ${3}
*** Keywords ***
Generate Keys
# Generate new wallets
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
# Get pre-defined keys
Generate eACL Keys
${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de
${SYSTEM_KEY_GEN} = Set Variable ${NEOFS_IR_WIF}
${SYSTEM_KEY_GEN_SN} = Set Variable ${NEOFS_SN_WIF}
# Set global variables for keys for each role
Set Global Variable ${USER_KEY} ${USER_KEY_GEN}
Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN}
Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN}
Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN}
Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN}
Payment Operations ${WALLET} ${ADDR} ${USER_KEY}
Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY}
Payment Operations
[Arguments] ${WALLET} ${ADDR} ${KEY}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 2
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
Set Global Variable ${SYSTEM_KEY} ${NEOFS_IR_WIF}
Create Container Public

View file

@ -1,55 +1,19 @@
*** Settings ***
Variables ../../../variables/common.py
Library ${KEYWORDS}/wallet_keywords.py
Library ${KEYWORDS}/rpc_call_keywords.py
*** Variables ***
${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth
${RULE_FOR_ALL} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
${TRANSFER_AMOUNT} = ${3}
*** Keywords ***
Generate Keys
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
Generate eACL Keys
${EACL_KEY_GEN} = Form WIF from String 782676b81a35c5f07325ec523e8521ee4946b6e5d4c6cd652dd0c3ba51ce03de
${SYSTEM_KEY_GEN} = Set Variable ${NEOFS_IR_WIF}
${SYSTEM_KEY_GEN_SN} = Set Variable ${NEOFS_SN_WIF}
Set Global Variable ${USER_KEY} ${USER_KEY_GEN}
Set Global Variable ${OTHER_KEY} ${OTHER_KEY_GEN}
Set Global Variable ${SYSTEM_KEY} ${SYSTEM_KEY_GEN}
Set Global Variable ${SYSTEM_KEY_SN} ${SYSTEM_KEY_GEN_SN}
Set Global Variable ${EACL_KEY} ${EACL_KEY_GEN}
Payment Operations ${WALLET} ${ADDR} ${USER_KEY}
Payment Operations ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY}
Payment Operations
[Arguments] ${WALLET} ${ADDR} ${KEY}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} 3
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 2
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
Set Global Variable ${SYSTEM_KEY} ${NEOFS_IR_WIF}
Create Container Public
Log Create Public Container

View file

@ -7,8 +7,7 @@ Library ../${RESOURCES}/utility_keywords.py
Library ${KEYWORDS}/wallet_keywords.py
Library ${KEYWORDS}/rpc_call_keywords.py
*** Variables ***
${TRANSFER_AMOUNT} = ${11}
Resource ../${RESOURCES}/payment_operations.robot
*** Test cases ***
@ -80,24 +79,8 @@ Generate file
Generate Key and Pre-payment
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
Set Global Variable ${PRIV_KEY} ${USER_KEY_GEN}
Payment Operations ${WALLET} ${ADDR} ${PRIV_KEY}
Payment Operations ${ADDR} ${PRIV_KEY}
Payment Operations
[Arguments] ${WALLET} ${ADDR} ${KEY}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 10
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
Validate Policy
[Arguments] ${POLICY} ${EXPECTED_VAL} @{EXPECTED_LIST}

View file

@ -7,9 +7,10 @@ Library ../${RESOURCES}/utility_keywords.py
Library ${KEYWORDS}/wallet_keywords.py
Library ${KEYWORDS}/rpc_call_keywords.py
Resource ../${RESOURCES}/payment_operations.robot
*** Variables ***
${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
${TRANSFER_AMOUNT} = ${11}
*** Test cases ***
NeoFS Object Replication
@ -19,33 +20,19 @@ NeoFS Object Replication
[Setup] Create Temporary Directory
${WALLET} ${ADDR} ${PRIV_KEY} = Init Wallet with Address ${TEMP_DIR}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 10
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
${CID} = Create container ${PRIV_KEY} ${EMPTY} ${PLACEMENT_RULE}
Container Existing ${PRIV_KEY} ${CID}
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${TEMP_DIR}
Payment Operations ${ADDR} ${WIF}
${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE}
Container Existing ${WIF} ${CID}
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
${FILE_HASH} = Get file hash ${FILE}
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
Validate storage policy for object ${WIF} 2 ${CID} ${S_OID}
@{NODES_OBJ} = Get nodes with object ${PRIV_KEY} ${CID} ${S_OID}
@{NODES_OBJ} = Get nodes with object ${WIF} ${CID} ${S_OID}
${NODES_LOG_TIME} = Get Nodes Log Latest Timestamp
@ -53,19 +40,15 @@ NeoFS Object Replication
${state} ${output}= Run Keyword And Ignore Error
... Wait Until Keyword Succeeds 10 min 2 min
... Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
... Validate storage policy for object ${WIF} 2 ${CID} ${S_OID}
Run Keyword If '${state}'!='PASS' Log Warning: Keyword failed: Validate storage policy for object ${S_OID} {\n}${output} WARN
Find in Nodes Log object successfully replicated ${NODES_LOG_TIME}
Start nodes @{NODES_OBJ_STOPPED}
# We have 2 or 3 copies. Expected behaviour: after one epoch potential 3rd copy should be removed.
Sleep ${NEOFS_EPOCH_TIMEOUT}
Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
Validate storage policy for object ${WIF} 2 ${CID} ${S_OID}
[Teardown] Cleanup

View file

@ -14,25 +14,22 @@ ${DEPOSIT_AMOUNT} = 10
*** Keywords ***
Payment operations
${WALLET} ${ADDR} ${PRIV_KEY} = Init Wallet with Address ${TEMP_DIR}
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${TEMP_DIR}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} ${DEPOSIT_AMOUNT}
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX_DEPOSIT}
${NEOFS_BALANCE} = Get NeoFS Balance ${PRIV_KEY}
${NEOFS_BALANCE} = Get NeoFS Balance ${WIF}
Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT}
Set Global Variable ${PRIV_KEY} ${PRIV_KEY}
Set Global Variable ${PRIV_KEY} ${WIF}
Set Global Variable ${ADDR} ${ADDR}
Prepare container

View file

@ -80,8 +80,3 @@ NeoFS Complex Object Operations
Cleanup
Cleanup Files
Get Docker Logs object_complex

View file

@ -76,8 +76,3 @@ NeoFS Simple Object Operations
Cleanup
Cleanup Files
Get Docker Logs object_simple

View file

@ -20,8 +20,8 @@ NeoFS Deposit and Withdraw
[Setup] Create Temporary Directory
${WALLET} ${ADDR} ${PRIV_KEY} = Init Wallet with Address ${TEMP_DIR}
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${TEMP_DIR}
${SCRIPT_HASH} = Get ScriptHash ${WIF}
##########################################################
# Transferring GAS from initial wallet to our test wallet
@ -35,7 +35,7 @@ NeoFS Deposit and Withdraw
############################
# Making deposit into NeoFS
############################
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} ${DEPOSIT_AMOUNT}
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX_DEPOSIT}
@ -45,7 +45,7 @@ NeoFS Deposit and Withdraw
${DEPOSIT_FEE} = Evaluate ${EXPECTED_BALANCE} - ${MAINNET_BALANCE}
Log Deposit fee is ${DEPOSIT_FEE}
${NEOFS_BALANCE} = Get NeoFS Balance ${PRIV_KEY}
${NEOFS_BALANCE} = Get NeoFS Balance ${WIF}
Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT}
# TODO: try to withdraw more than was deposited
@ -59,7 +59,7 @@ NeoFS Deposit and Withdraw
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
${NEOFS_BALANCE} = Get NeoFS Balance ${PRIV_KEY}
${NEOFS_BALANCE} = Get NeoFS Balance ${WIF}
${EXPECTED_BALANCE} = Evaluate ${DEPOSIT_AMOUNT} - ${WITHDRAW_AMOUNT}
Should Be Equal As Numbers ${NEOFS_BALANCE} ${EXPECTED_BALANCE}

View file

@ -10,7 +10,8 @@ Library ${KEYWORDS}/rpc_call_keywords.py
*** Variables ***
${PLACEMENT_RULE} = "REP 1 IN X CBF 1 SELECT 1 FROM * AS X"
${TRANSFER_AMOUNT} = ${3}
${TRANSFER_AMOUNT} = ${6}
${DEPOSIT_AMOUNT} = ${5}
*** Test cases ***
@ -19,49 +20,46 @@ NeoFS HTTP Gateway
[Timeout] 5 min
[Setup] Create Temporary Directory
${WALLET} ${ADDR} ${PRIV_KEY} = Init Wallet with Address ${TEMP_DIR}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} 6
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${TEMP_DIR}
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX}
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 5
Wait Until Keyword Succeeds 1 min 15 sec
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds ${MAINNET_TIMEOUT} ${MAINNET_BLOCK_TIME}
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
${CID} = Create container ${PRIV_KEY} public ${PLACEMENT_RULE}
${CID} = Create container ${WIF} public ${PLACEMENT_RULE}
Wait Until Keyword Succeeds 2 min 30 sec
... Container Existing ${PRIV_KEY} ${CID}
... Container Existing ${WIF} ${CID}
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
${FILE_L} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_HASH} = Get file hash ${FILE}
${FILE_L_HASH} = Get file hash ${FILE_L}
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
${L_OID} = Put object ${PRIV_KEY} ${FILE_L} ${CID} ${EMPTY} ${EMPTY}
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
${L_OID} = Put object ${WIF} ${FILE_L} ${CID} ${EMPTY} ${EMPTY}
# By request from Service team - try to GET object from the node without object
@{GET_NODE_LIST} = Get nodes without object ${PRIV_KEY} ${CID} ${S_OID}
@{GET_NODE_LIST} = Get nodes without object ${WIF} ${CID} ${S_OID}
${NODE} = Evaluate random.choice($GET_NODE_LIST) random
${GET_OBJ_S} = Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE}
${GET_OBJ_S} = Get object ${WIF} ${CID} ${S_OID} ${EMPTY} s_file_read ${NODE}
${FILEPATH} = Get via HTTP Gate ${CID} ${S_OID}
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}
@{GET_NODE_LIST} = Get nodes without object ${WIF} ${CID} ${L_OID}
${NODE} = Evaluate random.choice($GET_NODE_LIST) random
${GET_OBJ_L} = Get object ${PRIV_KEY} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE}
${GET_OBJ_L} = Get object ${WIF} ${CID} ${L_OID} ${EMPTY} l_file_read ${NODE}
${FILEPATH} = Get via HTTP Gate ${CID} ${L_OID}
Verify file hash ${GET_OBJ_L} ${FILE_L_HASH}

View file

@ -4,9 +4,11 @@ Library Collections
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
Library ../${RESOURCES}/gates.py
Library ${KEYWORDS}/wallet.py
Library ${KEYWORDS}/wallet_keywords.py
Library ../${RESOURCES}/utility_keywords.py
*** Variables ***
${DEPOSIT_AMOUNT} = ${5}
*** Test cases ***
NeoFS S3 Gateway
@ -15,13 +17,11 @@ NeoFS S3 Gateway
[Setup] Create Temporary Directory
${PRIV_KEY} = Form WIF from String 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb
${WALLET} ${ADDR} = Init Wallet from WIF ${TEMP_DIR} ${PRIV_KEY}
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 5
${WIF} = Form WIF from String 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb
${WALLET} ${ADDR} = Init Wallet from WIF ${TEMP_DIR} ${WIF}
${TX_DEPOSIT} = NeoFS Deposit ${WIF} ${DEPOSIT_AMOUNT}
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
${FILE_S3} = Generate file of bytes ${COMPLEX_OBJ_SIZE}
${FILE_S3_HASH} = Get file hash ${FILE_S3}
@ -35,9 +35,9 @@ NeoFS S3 Gateway
... ${BUCKET}
... ${ACCESS_KEY_ID}
... ${SEC_ACCESS_KEY}
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${PRIV_KEY} keys/s3_docker_hcs.pub.key
... ${OWNER_PRIV_KEY} = Init S3 Credentials ${WIF} keys/s3_docker_hcs.pub.key
${CONTEINERS_LIST} = Container List ${PRIV_KEY}
${CONTEINERS_LIST} = Container List ${WIF}
List Should Contain Value ${CONTEINERS_LIST} ${CID}
${S3_CLIENT} = Config S3 client ${ACCESS_KEY_ID} ${SEC_ACCESS_KEY}
@ -48,8 +48,8 @@ NeoFS S3 Gateway
Put object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3}
Head object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME}
${OID_FS} = Put object ${PRIV_KEY} ${FILE_FS} ${CID} ${EMPTY} ${EMPTY}
Head object ${PRIV_KEY} ${CID} ${OID_FS} ${EMPTY}
${OID_FS} = Put object ${WIF} ${FILE_FS} ${CID} ${EMPTY} ${EMPTY}
Head object ${WIF} ${CID} ${OID_FS} ${EMPTY}
${LIST_S3_OBJECTS} = List objects S3 ${S3_CLIENT} ${BUCKET}
List Should Contain Value ${LIST_S3_OBJECTS} ${FILE_S3_NAME}
@ -59,7 +59,7 @@ NeoFS S3 Gateway
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
List Should Contain Value ${LIST_V2_S3_OBJECTS} ${FILE_S3_NAME}
${OID_LIST_S3} = Search object ${PRIV_KEY} ${CID} ${EMPTY} ${EMPTY} FileName=${FILE_S3_NAME}
${OID_LIST_S3} = Search object ${WIF} ${CID} ${EMPTY} ${EMPTY} FileName=${FILE_S3_NAME}
${OID_S3} = Get From List ${OID_LIST_S3} 0
Get object S3 ${S3_CLIENT} ${BUCKET} ${FILE_S3_NAME} s3_obj_get_s3
@ -68,8 +68,8 @@ NeoFS S3 Gateway
Verify file hash s3_obj_get_s3 ${FILE_S3_HASH}
Verify file hash fs_obj_get_s3 ${FILE_FS_HASH}
Get object ${PRIV_KEY} ${CID} ${OID_S3} ${EMPTY} s3_obj_get_fs
Get object ${PRIV_KEY} ${CID} ${OID_FS} ${EMPTY} fs_obj_get_fs
Get object ${WIF} ${CID} ${OID_S3} ${EMPTY} s3_obj_get_fs
Get object ${WIF} ${CID} ${OID_FS} ${EMPTY} fs_obj_get_fs
Verify file hash s3_obj_get_fs ${FILE_S3_HASH}
Verify file hash fs_obj_get_fs ${FILE_FS_HASH}

View file

@ -31,12 +31,8 @@ MAINNET_WALLET_WIF = os.getenv("MAINNET_WALLET_WIF", "KxDgvEKzgSBPPfuVfw67oPQBSj
NEOFS_ENDPOINT = os.getenv("NEOFS_ENDPOINT", "s01.neofs.devenv:8080")
NEOGO_CLI_EXEC = os.getenv("NEOGO_CLI_EXEC", "neo-go")
NEO_MAINNET_ENDPOINT = (os.getenv("NEO_MAINNET_ENDPOINT") if os.getenv("NEO_MAINNET_ENDPOINT")
else os.getenv("NEOFS_IR_MAINNET_ENDPOINT_CLIENT", 'http://main_chain.neofs.devenv:30333'))
NEOFS_NEO_API_ENDPOINT = (os.getenv("NEOFS_NEO_API_ENDPOINT") if os.getenv("NEOFS_NEO_API_ENDPOINT")
else os.getenv("NEOFS_IR_MORPH_ENDPOINT_CLIENT", 'http://morph_chain.neofs.devenv:30333'))
NEO_MAINNET_ENDPOINT = os.getenv("NEO_MAINNET_ENDPOINT", 'http://main_chain.neofs.devenv:30333')
NEOFS_NEO_API_ENDPOINT = os.getenv("NEOFS_NEO_API_ENDPOINT", 'http://morph_chain.neofs.devenv:30333')
HTTP_GATE = os.getenv("HTTP_GATE", 'http://http.neofs.devenv')
S3_GATE = os.getenv("S3_GATE", 'https://s3.neofs.devenv:8080')
NEOFS_NETMAP = os.getenv("NEOFS_NETMAP", ['s01.neofs.devenv:8080', 's02.neofs.devenv:8080','s03.neofs.devenv:8080','s04.neofs.devenv:8080'])