From dcab3a574538a71e64582cd88dfedb5f19c1b6fb Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Mon, 8 Nov 2021 12:57:19 +0300 Subject: [PATCH] [#115] Sticky Bit with SYSTEM group Signed-off-by: Elizaveta Chichindaeva --- robot/resources/lib/neofs.py | 2 +- .../integration/network/replication.robot | 35 ++++++++++++------- robot/variables/acl.py | 1 + robot/variables/common.py | 5 ++- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/robot/resources/lib/neofs.py b/robot/resources/lib/neofs.py index 63a18343..f2656794 100644 --- a/robot/resources/lib/neofs.py +++ b/robot/resources/lib/neofs.py @@ -722,7 +722,7 @@ def verify_file_hash(filename, 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: str="", endpoint: str="", options: str="" ): logger.info("Going to put the object") diff --git a/robot/testsuites/integration/network/replication.robot b/robot/testsuites/integration/network/replication.robot index 498d43bb..70113505 100644 --- a/robot/testsuites/integration/network/replication.robot +++ b/robot/testsuites/integration/network/replication.robot @@ -1,5 +1,6 @@ *** Settings *** Variables ../../../variables/common.py +Variables ../../../variables/acl.py Library Collections Library ../${RESOURCES}/payment_neogo.py @@ -10,6 +11,7 @@ Library contract_keywords.py Resource ../${RESOURCES}/payment_operations.robot Resource ../${RESOURCES}/setup_teardown.robot +Resource common.robot *** Variables *** ${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X @@ -24,21 +26,31 @@ NeoFS Object Replication [Timeout] 25 min [Setup] Setup + + Log Check replication mechanism + Check Replication ${EMPTY} + Log Check Sticky Bit with SYSTEM Group via replication mechanism + Check Replication ${STICKYBIT_PUB_ACL} + + [Teardown] Teardown replication + +*** Keywords *** +Check Replication + [Arguments] ${ACL} ${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR} Payment Operations ${ADDR} ${WIF} + ${CID} = Create Container ${WIF} ${ACL} ${PLACEMENT_RULE} + Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL} + ... Container Existing ${WIF} ${CID} - ${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE} - Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL} - ... Container Existing ${WIF} ${CID} + ${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE} + ${FILE_HASH} = Get file hash ${FILE} - ${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE} - ${FILE_HASH} = Get file hash ${FILE} + ${S_OID} = Put Object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY} + Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID} - ${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY} - Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID} - - @{NODES_OBJ} = Get nodes with object ${WIF} ${CID} ${S_OID} + @{NODES_OBJ} = Get nodes with Object ${WIF} ${CID} ${S_OID} ${NODES_LOG_TIME} = Get Nodes Log Latest Timestamp @{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ} @@ -49,7 +61,7 @@ NeoFS Object Replication FOR ${i} IN RANGE 2 ${PASSED} = Run Keyword And Return Status ... Validate storage policy for object ${WIF} ${EXPECTED_COPIES} - ... ${CID} ${S_OID} ${EMPTY} ${NETMAP} + ... ${CID} ${S_OID} ${EMPTY} ${NETMAP} Exit For Loop If ${PASSED} Tick Epoch Sleep ${CHECK_INTERVAL} @@ -69,6 +81,5 @@ NeoFS Object Replication Sleep ${CHECK_INTERVAL} END Run Keyword Unless ${PASSED} Fail Keyword failed: Validate storage policy for object ${S_OID} in container ${CID} - - + [Teardown] Teardown replication diff --git a/robot/variables/acl.py b/robot/variables/acl.py index 737ef3b5..92c75791 100644 --- a/robot/variables/acl.py +++ b/robot/variables/acl.py @@ -2,3 +2,4 @@ PUBLIC_ACL = "0x1FFFFFFF" PRIVATE_ACL = "0x18888888" READONLY_ACL = "0x1FFF88FF" INACCESSIBLE_ACL = "0x40000000" +STICKYBIT_PUB_ACL = "0x3FFFFFFF" diff --git a/robot/variables/common.py b/robot/variables/common.py index 7be96565..f3bdce70 100644 --- a/robot/variables/common.py +++ b/robot/variables/common.py @@ -20,6 +20,9 @@ MAINNET_BLOCK_TIME = os.getenv('MAINNET_BLOCK_TIME', "15s") MAINNET_TIMEOUT = os.getenv('MAINNET_TIMEOUT', "1min") MORPH_BLOCK_TIME = os.getenv("MORPH_BLOCK_TIME", '1s') NEOFS_CONTRACT_CACHE_TIMEOUT = os.getenv("NEOFS_CONTRACT_CACHE_TIMEOUT", "30s") + +#TODO: change to NEOFS_STORAGE_DEFAULT_GC_REMOVER_SLEEP_INTERVAL + SHARD_0_GC_SLEEP = os.getenv("NEOFS_STORAGE_SHARD_0_GC_REMOVER_SLEEP_INTERVAL", "1m") NEOFS_IR_WIF = os.getenv("NEOFS_IR_WIF", "KxyjQ8eUa4FHt3Gvioyt1Wz29cTUrE4eTqX3yFSk1YFCsPL8uNsY") @@ -62,4 +65,4 @@ NEOFS_NETMAP_DICT = {'s01': {'rpc': 's01.neofs.devenv:8080', 'wif': 'Kzk1Z3dowAqfNyjqeYKWenZMduFV3NAKgXg9K1sA4jRKYxEc8HEW', 'UN-LOCODE': 'FI HEL'} } -NEOFS_NETMAP = [i['rpc'] for i in NEOFS_NETMAP_DICT.values()] \ No newline at end of file +NEOFS_NETMAP = [i['rpc'] for i in NEOFS_NETMAP_DICT.values()]