Skip to content

Commit

Permalink
(#122) neofs-cli control drop-objects test case
Browse files Browse the repository at this point in the history
Signed-off-by: Elizaveta Chichindaeva <[email protected]>
  • Loading branch information
EliChin committed Oct 11, 2021
1 parent 1fe540f commit 42ba6ac
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 5 deletions.
9 changes: 9 additions & 0 deletions robot/resources/lib/neofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,15 @@ def get_control_endpoint_with_wif(endpoint_number: str = ''):
return endpoint_num, endpoint_control, wif


@keyword('Get Locode')
def get_locode():
endpoint_values = random.choice(list(NEOFS_NETMAP_DICT.values()))
locode = endpoint_values['UN-LOCODE']
logger.info(f'Random locode chosen: {locode}')

return locode


@keyword('Get Nodes Log Latest Timestamp')
def get_logs_latest_timestamp():
"""
Expand Down
84 changes: 84 additions & 0 deletions robot/testsuites/integration/network/netmap_control_drop.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
*** Settings ***
Variables ../../../variables/common.py
Variables ../../../variables/acl.py

Library Process
Library contract_keywords.py
Library neofs.py
Library String

Library payment_neogo.py

Resource setup_teardown.robot
Resource payment_operations.robot
Resource storage.robot

*** Variables ***
${CONTAINER_WAIT_INTERVAL} = 1 min

*** Test Cases ***
Drop command in control group
[Documentation] Testcase to check drop-objects command from control group.
[Tags] NeoFSCLI
[Timeout] 10 min

[Setup] Setup

${NODE_NUM} ${NODE} ${WIF} = Get control endpoint with wif
${LOCODE} = Get Locode

${FILE_SIMPLE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
${FILE_COMPLEX} = Generate file of bytes ${COMPLEX_OBJ_SIZE}

${WALLET} ${ADDR} ${USER_KEY} = Init Wallet with Address ${ASSETS_DIR}
Payment Operations ${ADDR} ${USER_KEY}

${PRIV_CID} = Create container ${USER_KEY} ${PRIVATE_ACL} REP 1 CBF 1 SELECT 1 FROM * FILTER 'UN-LOCODE' EQ '${LOCODE}' AS LOC
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
... Container Existing ${USER_KEY} ${PRIV_CID}

#########################
# Dropping simple object
#########################

${S_OID} = Put object ${USER_KEY} ${FILE_SIMPLE} ${PRIV_CID} ${EMPTY} ${EMPTY}
Get object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} s_file_read
Head object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID} ${EMPTY} ${EMPTY}

Drop object ${NODE} ${WIF} ${PRIV_CID} ${S_OID}

Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Get object ${USER_KEY} ${PRIV_CID} ${S_OID} ${EMPTY} s_file_read options='--ttl 1'
Run Keyword And Expect Error Error:*
... Head object ${NEOFS_IR_WIF} ${PRIV_CID} ${S_OID} ${EMPTY} ${EMPTY}

Drop object ${NODE} ${WIF} ${PRIV_CID} ${S_OID}

##########################
# Dropping complex object
##########################

${C_OID} = Put object ${USER_KEY} ${FILE_COMPLEX} ${PRIV_CID} ${EMPTY} ${EMPTY}
Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read
Head object ${NEOFS_IR_WIF} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY}

Drop object ${NODE} ${WIF} ${PRIV_CID} ${C_OID}

Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read
Head object ${NEOFS_IR_WIF} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY}

@{SPLIT_OIDS} = Get Split objects ${USER_KEY} ${PRIV_CID} ${C_OID}
FOR ${CHILD_OID} IN @{SPLIT_OIDS}
Drop object ${NODE} ${WIF} ${PRIV_CID} ${CHILD_OID}

END

Wait Until Keyword Succeeds 3x ${SHARD_0_GC_SLEEP}
... Run Keyword And Expect Error Error:*
... Get object ${USER_KEY} ${PRIV_CID} ${C_OID} ${EMPTY} s_file_read options='--ttl 1'
Run Keyword And Expect Error Error:*
... Head object ${NEOFS_IR_WIF} ${PRIV_CID} ${C_OID} ${EMPTY} ${EMPTY}


[Teardown] Teardown netmap_control_drop
2 changes: 1 addition & 1 deletion robot/variables/acl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PUBLIC_ACL = "0x1FFFFFFF"
PRIVATE_ACL = "0x18888888"
READONLY_ACL = "0x1FFF88FF"
INACCESSIBLE_ACL = "0x40000000 "
INACCESSIBLE_ACL = "0x40000000"
13 changes: 9 additions & 4 deletions robot/variables/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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")
SHARD_0_GC_SLEEP = os.getenv("NEOFS_STORAGE_SHARD_0_GC_REMOVER_SLEEP_INTERVAL", "1m")

NEOFS_IR_WIF = os.getenv("NEOFS_IR_WIF", "KxyjQ8eUa4FHt3Gvioyt1Wz29cTUrE4eTqX3yFSk1YFCsPL8uNsY")
NEOFS_SN_WIF = os.getenv("NEOFS_SN_WIF", "Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s")
Expand All @@ -46,15 +47,19 @@

NEOFS_NETMAP_DICT = {'s01': {'rpc': 's01.neofs.devenv:8080',
'control': 's01.neofs.devenv:8081',
'wif': 'Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s'},
'wif': 'Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s',
'UN-LOCODE': 'RU MOW'},
's02': {'rpc': 's02.neofs.devenv:8080',
'control': 's02.neofs.devenv:8081',
'wif': 'L1NdHdnrTNGQZH1fJSrdUZJyeYFHvaQSSHZHxhK3udiGFdr5YaZ6'},
'wif': 'L1NdHdnrTNGQZH1fJSrdUZJyeYFHvaQSSHZHxhK3udiGFdr5YaZ6',
'UN-LOCODE': 'RU LED'},
's03': {'rpc': 's03.neofs.devenv:8080',
'control': 's03.neofs.devenv:8081',
'wif': 'KzN38k39af6ACWJjK8YrnARWo86ddcc1EuBWz7xFEdcELcP3ZTym'},
'wif': 'KzN38k39af6ACWJjK8YrnARWo86ddcc1EuBWz7xFEdcELcP3ZTym',
'UN-LOCODE': 'SE STO'},
's04': {'rpc': 's04.neofs.devenv:8080',
'control': 's04.neofs.devenv:8081',
'wif': 'Kzk1Z3dowAqfNyjqeYKWenZMduFV3NAKgXg9K1sA4jRKYxEc8HEW'}
'wif': 'Kzk1Z3dowAqfNyjqeYKWenZMduFV3NAKgXg9K1sA4jRKYxEc8HEW',
'UN-LOCODE': 'FI HEL'}
}
NEOFS_NETMAP = [i['rpc'] for i in NEOFS_NETMAP_DICT.values()]

0 comments on commit 42ba6ac

Please sign in to comment.