[#115] Sticky Bit with SYSTEM group

Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
Elizaveta Chichindaeva 2021-11-08 12:57:19 +03:00
parent 075ddfbd43
commit dcab3a5745
4 changed files with 29 additions and 14 deletions

View file

@ -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")

View file

@ -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
@ -25,20 +27,30 @@ NeoFS Object Replication
[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}
@ -70,5 +82,4 @@ NeoFS Object Replication
END
Run Keyword Unless ${PASSED} Fail Keyword failed: Validate storage policy for object ${S_OID} in container ${CID}
[Teardown] Teardown replication

View file

@ -2,3 +2,4 @@ PUBLIC_ACL = "0x1FFFFFFF"
PRIVATE_ACL = "0x18888888"
READONLY_ACL = "0x1FFF88FF"
INACCESSIBLE_ACL = "0x40000000"
STICKYBIT_PUB_ACL = "0x3FFFFFFF"

View file

@ -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")