2020-11-29 04:28:01 +00:00
|
|
|
*** Settings ***
|
2021-02-08 05:05:17 +00:00
|
|
|
Variables ../../../variables/common.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
Library ../${RESOURCES}/neofs.py
|
|
|
|
Library ../${RESOURCES}/payment_neogo.py
|
2021-04-26 10:30:40 +00:00
|
|
|
Library ../${RESOURCES}/utility_keywords.py
|
2021-05-07 12:14:37 +00:00
|
|
|
Library ${KEYWORDS}/wallet_keywords.py
|
|
|
|
Library ${KEYWORDS}/rpc_call_keywords.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-05-04 09:27:43 +00:00
|
|
|
*** Variables ***
|
2021-05-07 12:14:37 +00:00
|
|
|
${PLACEMENT_RULE} = "REP 2 IN X CBF 1 SELECT 4 FROM * AS X"
|
|
|
|
${TRANSFER_AMOUNT} = ${11}
|
2021-05-04 09:27:43 +00:00
|
|
|
|
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
|
2021-04-02 14:29:41 +00:00
|
|
|
[Timeout] 25 min
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-04-26 10:30:40 +00:00
|
|
|
[Setup] Create Temporary Directory
|
|
|
|
|
2021-04-26 17:48:43 +00:00
|
|
|
${WALLET} ${ADDR} ${PRIV_KEY} = Init Wallet with Address ${TEMP_DIR}
|
2021-05-07 12:14:37 +00:00
|
|
|
${TX} = Transfer Mainnet Gas ${MAINNET_WALLET_WIF} ${ADDR} ${TRANSFER_AMOUNT}
|
2021-04-26 10:30:40 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
2020-11-29 04:28:01 +00:00
|
|
|
... Transaction accepted in block ${TX}
|
2021-05-07 12:14:37 +00:00
|
|
|
|
|
|
|
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
|
|
|
|
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
|
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-03-09 10:08:40 +00:00
|
|
|
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 10
|
2021-04-26 10:30:40 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
2020-11-29 04:28:01 +00:00
|
|
|
... Transaction accepted in block ${TX_DEPOSIT}
|
|
|
|
Get Transaction ${TX_DEPOSIT}
|
2020-12-02 23:08:05 +00:00
|
|
|
|
2021-05-04 09:27:43 +00:00
|
|
|
${CID} = Create container ${PRIV_KEY} ${EMPTY} ${PLACEMENT_RULE}
|
2020-12-02 23:08:05 +00:00
|
|
|
Container Existing ${PRIV_KEY} ${CID}
|
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
|
2020-11-29 04:28:01 +00:00
|
|
|
${FILE_HASH} = Get file hash ${FILE}
|
|
|
|
|
2021-04-26 10:30:40 +00:00
|
|
|
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
|
|
|
|
Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
|
|
|
|
|
|
|
|
@{NODES_OBJ} = Get nodes with object ${PRIV_KEY} ${CID} ${S_OID}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
${NODES_LOG_TIME} = Get Nodes Log Latest Timestamp
|
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
@{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
${state} ${output}= Run Keyword And Ignore Error
|
2021-04-26 10:30:40 +00:00
|
|
|
... Wait Until Keyword Succeeds 10 min 2 min
|
2021-02-08 05:05:17 +00:00
|
|
|
... Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
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}
|
|
|
|
|
2020-12-02 23:08:05 +00:00
|
|
|
Start nodes @{NODES_OBJ_STOPPED}
|
2021-04-02 14:29:41 +00:00
|
|
|
|
|
|
|
# We have 2 or 3 copies. Expected behaviour: after one epoch potential 3rd copy should be removed.
|
|
|
|
|
|
|
|
Sleep ${NEOFS_EPOCH_TIMEOUT}
|
|
|
|
|
|
|
|
Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
[Teardown] Cleanup
|
2021-04-26 10:30:40 +00:00
|
|
|
|
|
|
|
|
2020-12-16 11:19:24 +00:00
|
|
|
*** Keywords ***
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2020-12-16 11:19:24 +00:00
|
|
|
Cleanup
|
2021-04-26 10:30:40 +00:00
|
|
|
Cleanup Files
|
2020-12-29 19:55:33 +00:00
|
|
|
Get Docker Logs replication
|