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-07-20 11:10:13 +00:00
|
|
|
Library Collections
|
2021-02-08 05:05:17 +00:00
|
|
|
Library ../${RESOURCES}/payment_neogo.py
|
2021-07-20 11:10:13 +00:00
|
|
|
Library ../${RESOURCES}/neofs.py
|
|
|
|
Library wallet_keywords.py
|
|
|
|
Library rpc_call_keywords.py
|
|
|
|
Library contract_keywords.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
Resource ../${RESOURCES}/payment_operations.robot
|
2021-06-01 12:07:31 +00:00
|
|
|
Resource ../${RESOURCES}/setup_teardown.robot
|
2021-06-01 12:07:31 +00:00
|
|
|
|
2021-05-04 09:27:43 +00:00
|
|
|
*** Variables ***
|
2021-05-26 14:14:46 +00:00
|
|
|
${PLACEMENT_RULE} = REP 2 IN X CBF 1 SELECT 4 FROM * AS X
|
2021-07-20 11:10:13 +00:00
|
|
|
${EXPECTED_COPIES} = ${2}
|
|
|
|
${CHECK_INTERVAL} = 1 min
|
2021-08-31 15:16:19 +00:00
|
|
|
${CONTAINER_WAIT_INTERVAL} = 1 min
|
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-06-01 12:07:31 +00:00
|
|
|
[Setup] Setup
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
${WALLET} ${ADDR} ${WIF} = Init Wallet with Address ${ASSETS_DIR}
|
2021-06-01 12:07:31 +00:00
|
|
|
Payment Operations ${ADDR} ${WIF}
|
2020-12-02 23:08:05 +00:00
|
|
|
|
2021-08-31 15:16:19 +00:00
|
|
|
${CID} = Create container ${WIF} ${EMPTY} ${PLACEMENT_RULE}
|
|
|
|
Wait Until Keyword Succeeds ${MORPH_BLOCK_TIME} ${CONTAINER_WAIT_INTERVAL}
|
|
|
|
... Container Existing ${WIF} ${CID}
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-08-31 15:16:19 +00:00
|
|
|
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
|
|
|
|
${FILE_HASH} = Get file hash ${FILE}
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-07-20 11:10:13 +00:00
|
|
|
${S_OID} = Put object ${WIF} ${FILE} ${CID} ${EMPTY} ${EMPTY}
|
|
|
|
Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-06-01 12:07:31 +00:00
|
|
|
@{NODES_OBJ} = Get nodes with object ${WIF} ${CID} ${S_OID}
|
2021-02-08 05:05:17 +00:00
|
|
|
${NODES_LOG_TIME} = Get Nodes Log Latest Timestamp
|
|
|
|
|
2021-07-20 11:10:13 +00:00
|
|
|
@{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ}
|
|
|
|
@{NETMAP} = Convert To List ${NEOFS_NETMAP}
|
|
|
|
Remove Values From List ${NETMAP} @{NODES_OBJ_STOPPED}
|
|
|
|
|
|
|
|
# We expect that during two epochs the missed copy will be replicated.
|
|
|
|
FOR ${i} IN RANGE 2
|
|
|
|
${PASSED} = Run Keyword And Return Status
|
|
|
|
... Validate storage policy for object ${WIF} ${EXPECTED_COPIES}
|
|
|
|
... ${CID} ${S_OID} ${EMPTY} ${NETMAP}
|
|
|
|
Exit For Loop If ${PASSED}
|
|
|
|
Tick Epoch
|
|
|
|
Sleep ${CHECK_INTERVAL}
|
|
|
|
END
|
|
|
|
Run Keyword Unless ${PASSED} Fail Keyword failed: Validate storage policy for object ${S_OID}
|
|
|
|
|
|
|
|
Find in Nodes Log object successfully replicated ${NODES_LOG_TIME}
|
|
|
|
Start nodes @{NODES_OBJ_STOPPED}
|
|
|
|
Tick Epoch
|
|
|
|
|
|
|
|
# We have 2 or 3 copies. Expected behaviour: during two epochs potential 3rd copy should be removed.
|
|
|
|
FOR ${i} IN RANGE 2
|
|
|
|
${PASSED} = Run Keyword And Return Status
|
|
|
|
... Validate storage policy for object ${WIF} ${EXPECTED_COPIES} ${CID} ${S_OID}
|
|
|
|
Exit For Loop If ${PASSED}
|
|
|
|
Tick Epoch
|
|
|
|
Sleep ${CHECK_INTERVAL}
|
|
|
|
END
|
|
|
|
Run Keyword Unless ${PASSED} Fail Keyword failed: Validate storage policy for object ${S_OID}
|
|
|
|
|
|
|
|
|
|
|
|
[Teardown] Teardown replication
|