Waiting for container to appear in network; decrease complex object size

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2021-08-31 18:16:19 +03:00 committed by Anastasia Prasolova
parent fe99c143aa
commit be281428b5
11 changed files with 53 additions and 27 deletions

View file

@ -18,7 +18,7 @@ BearerToken Operations with Filter OID NotEqual
[Setup] Setup [Setup] Setup
Generate eACL Keys Generate Keys
Prepare eACL Role rules Prepare eACL Role rules
Log Check Bearer token with simple object Log Check Bearer token with simple object

View file

@ -2,20 +2,26 @@
Variables ../../../variables/common.py Variables ../../../variables/common.py
Variables ../../../variables/acl.py Variables ../../../variables/acl.py
*** Variables ***
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Keywords *** *** Keywords ***
Create Containers Create Containers
Log Create Private Container Log Create Private Container
${PRIV_CID_GEN} = Create container ${USER_KEY} ${PRIVATE_ACL} ${COMMON_PLACEMENT_RULE} ${PRIV_CID_GEN} = Create container ${USER_KEY} ${PRIVATE_ACL} ${COMMON_PLACEMENT_RULE}
Container Existing ${USER_KEY} ${PRIV_CID_GEN} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PRIV_CID_GEN}
Log Create Public Container Log Create Public Container
${PUBLIC_CID_GEN} = Create container ${USER_KEY} ${PUBLIC_ACL} ${COMMON_PLACEMENT_RULE} ${PUBLIC_CID_GEN} = Create container ${USER_KEY} ${PUBLIC_ACL} ${COMMON_PLACEMENT_RULE}
Container Existing ${USER_KEY} ${PUBLIC_CID_GEN} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PUBLIC_CID_GEN}
Log Create Read-Only Container Log Create Read-Only Container
${READONLY_CID_GEN} = Create container ${USER_KEY} ${READONLY_ACL} ${COMMON_PLACEMENT_RULE} ${READONLY_CID_GEN} = Create container ${USER_KEY} ${READONLY_ACL} ${COMMON_PLACEMENT_RULE}
Container Existing ${USER_KEY} ${READONLY_CID_GEN} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${READONLY_CID_GEN}
Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN} Set Global Variable ${PRIV_CID} ${PRIV_CID_GEN}
Set Global Variable ${PUBLIC_CID} ${PUBLIC_CID_GEN} Set Global Variable ${PUBLIC_CID} ${PUBLIC_CID_GEN}

View file

@ -6,18 +6,21 @@ Variables ../../../variables/acl.py
${FILE_USR_HEADER} = key1=1,key2=abc ${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del ${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth ${FILE_OTH_HEADER} = key1=oth,key2=oth
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Keywords *** *** Keywords ***
Create Container Public Create Container Public
Log Create Public Container
${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x0FFFFFFF ${COMMON_PLACEMENT_RULE} ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x0FFFFFFF ${COMMON_PLACEMENT_RULE}
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PUBLIC_CID_GEN}
[Return] ${PUBLIC_CID_GEN} [Return] ${PUBLIC_CID_GEN}
Create Container Inaccessible Create Container Inaccessible
Log Create Inaccessible Container
${INACCESSIBLE_CID_GEN} = Create container ${USER_KEY} ${INACCESSIBLE_ACL} ${COMMON_PLACEMENT_RULE} ${INACCESSIBLE_CID_GEN} = Create container ${USER_KEY} ${INACCESSIBLE_ACL} ${COMMON_PLACEMENT_RULE}
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${INACCESSIBLE_CID_GEN}
[Return] ${INACCESSIBLE_CID_GEN} [Return] ${INACCESSIBLE_CID_GEN}

View file

@ -5,12 +5,15 @@ Variables ../../../variables/common.py
${FILE_USR_HEADER} = key1=1,key2=abc ${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_DEL} = key1=del,key2=del ${FILE_USR_HEADER_DEL} = key1=del,key2=del
${FILE_OTH_HEADER} = key1=oth,key2=oth ${FILE_OTH_HEADER} = key1=oth,key2=oth
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Keywords *** *** Keywords ***
Create Container Public Create Container Public
Log Create Public Container Log Create Public Container
${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${COMMON_PLACEMENT_RULE} ${PUBLIC_CID_GEN} = Create container ${USER_KEY} 0x4FFFFFFF ${COMMON_PLACEMENT_RULE}
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PUBLIC_CID_GEN}
[Return] ${PUBLIC_CID_GEN} [Return] ${PUBLIC_CID_GEN}
@ -29,7 +32,7 @@ Check eACL Deny and Allow All
${CID} = Create Container Public ${CID} = Create Container Public
${S_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_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} ${FILE_USR_HEADER_DEL} ${D_OID_USER} = Put object ${USER_KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_USR_HEADER_DEL}
@{S_OBJ_H} = Create List ${S_OID_USER} @{S_OBJ_H} = Create List ${S_OID_USER}
Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER} Put object ${KEY} ${FILE_S} ${CID} ${EMPTY} ${FILE_OTH_HEADER}

View file

@ -16,6 +16,7 @@ ${ATTR_TIME} = Timestamp=new
${ATTR_DUPLICATE} = Size=small, Size=big ${ATTR_DUPLICATE} = Size=small, Size=big
${ATTR_NONE} = NoAttribute='' ${ATTR_NONE} = NoAttribute=''
${ATTR_SINGLE} = AttrNum=one ${ATTR_SINGLE} = AttrNum=one
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Test Cases *** *** Test Cases ***
Duplicated Container Attributes Duplicated Container Attributes
@ -48,9 +49,11 @@ Duplicated Container Attributes
# Checking a successful step with a single attribute # Checking a successful step with a single attribute
##################################################### #####################################################
${CID} = Create container ${USER_KEY} ${EMPTY} ${POLICY} ${ATTR_SINGLE} ${CID} = Create container ${USER_KEY} ${EMPTY} ${POLICY} ${ATTR_SINGLE}
${ATTRIBUTES} = Get container attributes ${USER_KEY} ${CID} ${EMPTY} json_output=True Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
${ATTRIBUTES_DICT} = Decode Container Attributes Json ${ATTRIBUTES} ... Container Existing ${USER_KEY} ${CID}
${ATTRIBUTES} = Get container attributes ${USER_KEY} ${CID} ${EMPTY} json_output=True
${ATTRIBUTES_DICT} = Decode Container Attributes Json ${ATTRIBUTES}
Verify Head Attribute ${ATTRIBUTES_DICT} ${ATTR_SINGLE} Verify Head Attribute ${ATTRIBUTES_DICT} ${ATTR_SINGLE}
[Teardown] Teardown container_attributes [Teardown] Teardown container_attributes

View file

@ -9,6 +9,9 @@ Library ${KEYWORDS}/wallet_keywords.py
Resource ../${RESOURCES}/setup_teardown.robot Resource ../${RESOURCES}/setup_teardown.robot
Resource ../${RESOURCES}/payment_operations.robot Resource ../${RESOURCES}/payment_operations.robot
*** Variables ***
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Test Cases *** *** Test Cases ***
Delete Containers Delete Containers
[Documentation] Testcase to check if containers can be deleted. [Documentation] Testcase to check if containers can be deleted.
@ -22,17 +25,17 @@ Delete Containers
${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Init Wallet with Address ${ASSETS_DIR} ${WALLET_OTH} ${ADDR_OTH} ${OTHER_KEY} = Init Wallet with Address ${ASSETS_DIR}
Payment Operations ${ADDR_OTH} ${OTHER_KEY} Payment Operations ${ADDR_OTH} ${OTHER_KEY}
${CID} = Create container ${USER_KEY} ${PUBLIC_ACL} ${COMMON_PLACEMENT_RULE} ${CID} = Create container ${USER_KEY} ${PUBLIC_ACL} ${COMMON_PLACEMENT_RULE}
Container Existing ${USER_KEY} ${CID} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${CID}
Run Keyword And Expect Error * Run Keyword And Expect Error *
... Delete Container ${CID} ${OTHER_KEY} ... Delete Container ${CID} ${OTHER_KEY}
Delete Container ${CID} ${USER_KEY} Delete Container ${CID} ${USER_KEY}
${EXPECTED_ERROR} = Run Keyword And Expect Error * ${EXPECTED_ERROR} = Run Keyword And Expect Error *
... Delete Container ${CID} ${USER_KEY} ... Delete Container ${CID} ${USER_KEY}
Log Container cannot be deleted: ${EXPECTED_ERROR} Log Container cannot be deleted: ${EXPECTED_ERROR}
[Teardown] Teardown container_delete [Teardown] Teardown container_delete

View file

@ -9,6 +9,8 @@ Library ${KEYWORDS}/rpc_call_keywords.py
Resource ../${RESOURCES}/payment_operations.robot Resource ../${RESOURCES}/payment_operations.robot
Resource ../${RESOURCES}/setup_teardown.robot Resource ../${RESOURCES}/setup_teardown.robot
*** Variables ***
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Test cases *** *** Test cases ***
NeoFS Simple Netmap NeoFS Simple Netmap
@ -87,8 +89,9 @@ Validate Policy
Log Container with rule ${POLICY} Log Container with rule ${POLICY}
${CID} = Create container ${PRIV_KEY} ${EMPTY} ${POLICY} ${CID} = Create container ${PRIV_KEY} ${EMPTY} ${POLICY}
Container Existing ${PRIV_KEY} ${CID} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY} ... Container Existing ${PRIV_KEY} ${CID}
Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} ${EXPECTED_LIST} ${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} ${EXPECTED_LIST}
Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read

View file

@ -15,6 +15,7 @@ Resource ../${RESOURCES}/setup_teardown.robot
${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X ${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
${EXPECTED_COPIES} = ${2} ${EXPECTED_COPIES} = ${2}
${CHECK_INTERVAL} = 1 min ${CHECK_INTERVAL} = 1 min
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Test cases *** *** Test cases ***
NeoFS Object Replication NeoFS Object Replication
@ -27,11 +28,12 @@ NeoFS Object Replication
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR} ${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR}
Payment Operations ${ADDR} ${WIF} Payment Operations ${ADDR} ${WIF}
${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE} ${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE}
Container Existing ${WIF} ${CID} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${WIF} ${CID}
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE} ${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
${FILE_HASH} = Get file hash ${FILE} ${FILE_HASH} = Get file hash ${FILE}
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY} ${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID} Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID}

View file

@ -9,6 +9,7 @@ ${FILE_USR_HEADER} = key1=1,key2=abc
${FILE_USR_HEADER_OTH} = key1=2 ${FILE_USR_HEADER_OTH} = key1=2
${UNEXIST_OID} = B2DKvkHnLnPvapbDgfpU1oVUPuXQo5LTfKVxmNDZXQff ${UNEXIST_OID} = B2DKvkHnLnPvapbDgfpU1oVUPuXQo5LTfKVxmNDZXQff
${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 2 FROM * AS X ${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 2 FROM * AS X
${CONTAINER_WAIT_INTERVAL} = 1 min
*** Keywords *** *** Keywords ***
@ -17,7 +18,8 @@ Prepare container
${NEOFS_BALANCE} = Get NeoFS Balance ${WIF} ${NEOFS_BALANCE} = Get NeoFS Balance ${WIF}
${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE} ${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE}
Container Existing ${WIF} ${CID} Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${WIF} ${CID}
${NEW_NEOFS_BALANCE} = Get NeoFS Balance ${WIF} ${NEW_NEOFS_BALANCE} = Get NeoFS Balance ${WIF}
Should Be True ${NEW_NEOFS_BALANCE} < ${NEOFS_BALANCE} Should Be True ${NEW_NEOFS_BALANCE} < ${NEOFS_BALANCE}

View file

@ -3,6 +3,7 @@ Variables ../../../variables/common.py
Library ../${RESOURCES}/neofs.py Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py Library ../${RESOURCES}/payment_neogo.py
Library ${KEYWORDS}/contract_keywords.py
Resource common_steps_object.robot Resource common_steps_object.robot
Resource ../${RESOURCES}/setup_teardown.robot Resource ../${RESOURCES}/setup_teardown.robot

View file

@ -17,7 +17,7 @@ NEOFS_EPOCH_TIMEOUT = (os.getenv("NEOFS_EPOCH_TIMEOUT") if os.getenv("NEOFS_EPOC
else os.getenv("NEOFS_IR_TIMERS_EPOCH", "300s")) else os.getenv("NEOFS_IR_TIMERS_EPOCH", "300s"))
SIMPLE_OBJ_SIZE = os.getenv("SIMPLE_OBJ_SIZE", "1000") SIMPLE_OBJ_SIZE = os.getenv("SIMPLE_OBJ_SIZE", "1000")
COMPLEX_OBJ_SIZE = os.getenv("COMPLEX_OBJ_SIZE", "70000000") COMPLEX_OBJ_SIZE = os.getenv("COMPLEX_OBJ_SIZE", "2000")
MAINNET_BLOCK_TIME = os.getenv('MAINNET_BLOCK_TIME', "15s") MAINNET_BLOCK_TIME = os.getenv('MAINNET_BLOCK_TIME', "15s")
MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min") MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min")