frostfs-testcases/robot/testsuites/integration/network/replication.robot

69 lines
3.5 KiB
Text
Raw Normal View History

2020-11-29 04:28:01 +00:00
*** Settings ***
Variables ../../../variables/common.py
2020-11-29 04:28:01 +00:00
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
2020-11-29 04:28:01 +00:00
*** Test cases ***
2020-11-29 04:30:45 +00:00
NeoFS Object Replication
[Documentation] Testcase to validate NeoFS object replication.
[Tags] Migration Replication NeoFS NeoCLI
[Timeout] 15 min
2020-11-29 04:28:01 +00:00
${WALLET} = Init wallet
Generate wallet ${WALLET}
${ADDR} = Dump Address ${WALLET}
${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR}
${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${ADDR} 11
2020-11-29 04:28:01 +00:00
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX}
Get Transaction ${TX}
Expexted Mainnet Balance ${ADDR} 11
2020-11-29 04:28:01 +00:00
${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY}
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 10
2020-11-29 04:28:01 +00:00
Wait Until Keyword Succeeds 1 min 15 sec
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
${CID} = Create container ${PRIV_KEY} ${EMPTY} REP 2 IN X CBF 1 SELECT 4 FROM * AS X
Container Existing ${PRIV_KEY} ${CID}
2020-11-29 04:28:01 +00:00
${FILE} = Generate file of bytes 1024
${FILE_HASH} = Get file hash ${FILE}
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
2020-11-29 04:28:01 +00:00
Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
2020-11-29 04:28:01 +00:00
@{NODES_OBJ} = Get nodes with object ${PRIV_KEY} ${CID} ${S_OID}
${NODES_LOG_TIME} = Get Nodes Log Latest Timestamp
2020-11-29 04:28:01 +00:00
@{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ}
${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}
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}
[Teardown] Cleanup ${FILE} @{NODES_OBJ_STOPPED}
*** Keywords ***
Cleanup
[Arguments] ${FILE} @{NODES_OBJ_STOPPED}
Start nodes @{NODES_OBJ_STOPPED}
Cleanup Files ${FILE}
Get Docker Logs replication