2020-09-01 03:23:17 +00:00
*** Settings ***
2021-02-08 05:05:17 +00:00
Variables ../../../variables/common.py
2020-09-01 03:23:17 +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
*** Variables ***
${TRANSFER_AMOUNT} = ${11}
2021-04-26 10:30:40 +00:00
2020-09-01 03:23:17 +00:00
*** Test cases ***
NeoFS Simple Netmap
[Documentation] Testcase to validate NeoFS Netmap.
[Tags] Netmap NeoFS NeoCLI
[Timeout] 20 min
2021-04-26 10:30:40 +00:00
[Setup] Create Temporary Directory
2020-11-27 00:33:11 +00:00
Generate Key and Pre-payment
2020-09-01 03:23:17 +00:00
2020-12-02 23:08:05 +00:00
Generate file
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 2 IN X CBF 2 SELECT 2 FROM * AS X 2 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 2 IN X CBF 1 SELECT 2 FROM * AS X 2 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 3 IN X CBF 1 SELECT 3 FROM * AS X 3 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 1 IN X CBF 1 SELECT 1 FROM * AS X 1 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 1 IN X CBF 2 SELECT 1 FROM * AS X 1 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
Validate Policy REP 2 IN X CBF 1 SELECT 4 FROM * AS X 2 @{EMPTY}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 4 IN X CBF 1 SELECT 4 FROM * AS X 4 @{EXPECTED}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s03.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 1 IN LOC_PLACE CBF 1 SELECT 1 FROM LOC_SW AS LOC_PLACE FILTER Country EQ Sweden AS LOC_SW 1 @{EXPECTED}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s02.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER Location EQ 'Saint Petersburg (ex Leningrad)' AS LOC_SPB 1 @{EXPECTED}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 1 IN LOC_SPB_PLACE REP 1 IN LOC_MSK_PLACE CBF 1 SELECT 1 FROM LOC_SPB AS LOC_SPB_PLACE SELECT 1 FROM LOC_MSK AS LOC_MSK_PLACE FILTER Location EQ 'Saint Petersburg (ex Leningrad)' AS LOC_SPB FILTER Location EQ 'Moskva' AS LOC_MSK 2 @{EXPECTED}
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080 s03.neofs.devenv:8080 s04.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 4 CBF 1 SELECT 4 FROM LOC_EU FILTER Continent EQ Europe AS LOC_EU 4 @{EXPECTED}
2020-11-27 00:33:11 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s02.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER Location NE 'Moskva' AND Location NE 'Stockholm' AND Location NE 'Helsinki (Helsingfors)' AS LOC_SPB 1 @{EXPECTED}
2020-11-27 00:33:11 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER SubDivCode NE 'AB' AND SubDivCode NE '18' AS LOC_RU 2 @{EXPECTED}
2020-11-27 00:33:11 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s01.neofs.devenv:8080 s02.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER Country EQ 'Russia' AS LOC_RU 2 @{EXPECTED}
2020-11-27 00:33:11 +00:00
2020-12-01 21:48:20 +00:00
@{EXPECTED} = Create List s03.neofs.devenv:8080 s04.neofs.devenv:8080
2021-04-26 10:30:40 +00:00
Validate Policy REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU 2 @{EXPECTED}
2020-12-01 21:48:20 +00:00
Log Put operation should be failed with error "not enough nodes to SELECT from: 'X'"
Run Keyword And Expect Error *
2021-04-26 10:30:40 +00:00
... Validate Policy REP 2 IN X CBF 2 SELECT 6 FROM * AS X 2 @{EMPTY}
2020-12-02 23:08:05 +00:00
2021-04-26 10:30:40 +00:00
[Teardown] Cleanup
2020-09-01 03:23:17 +00:00
2020-12-01 21:48:20 +00:00
*** Keywords ***
2020-09-01 03:23:17 +00:00
2020-11-27 00:33:11 +00:00
Generate file
2021-04-02 14:29:41 +00:00
${FILE} = Generate file of bytes ${SIMPLE_OBJ_SIZE}
2020-11-28 03:16:10 +00:00
Set Global Variable ${FILE} ${FILE}
2021-04-26 10:30:40 +00:00
2020-11-27 00:33:11 +00:00
Generate Key and Pre-payment
2021-04-26 17:48:43 +00:00
${WALLET} ${ADDR} ${USER_KEY_GEN} = Init Wallet with Address ${TEMP_DIR}
2020-11-28 03:16:10 +00:00
Set Global Variable ${PRIV_KEY} ${USER_KEY_GEN}
2021-04-26 10:30:40 +00:00
Payment Operations ${WALLET} ${ADDR} ${PRIV_KEY}
2020-11-27 00:33:11 +00:00
Payment Operations
[Arguments] ${WALLET} ${ADDR} ${KEY}
2021-04-26 10:30:40 +00:00
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-27 00:33:11 +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-27 00:33:11 +00:00
2021-03-09 10:08:40 +00:00
${SCRIPT_HASH} = Get ScriptHash ${KEY}
2020-11-27 00:33:11 +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-27 00:33:11 +00:00
... Transaction accepted in block ${TX_DEPOSIT}
Get Transaction ${TX_DEPOSIT}
Validate Policy
[Arguments] ${POLICY} ${EXPECTED_VAL} @{EXPECTED_LIST}
2021-04-26 10:30:40 +00:00
2020-11-27 00:33:11 +00:00
Log Container with rule ${POLICY}
2021-04-26 10:30:40 +00:00
${CID} = Create container ${PRIV_KEY} ${EMPTY} ${POLICY}
Container Existing ${PRIV_KEY} ${CID}
${S_OID} = Put object ${PRIV_KEY} ${FILE} ${CID} ${EMPTY} ${EMPTY}
2020-11-28 03:16:10 +00:00
Validate storage policy for object ${PRIV_KEY} ${EXPECTED_VAL} ${CID} ${S_OID} @{EXPECTED_LIST}
2021-04-26 10:30:40 +00:00
Get object ${PRIV_KEY} ${CID} ${S_OID} ${EMPTY} s_file_read
2020-11-27 00:33:11 +00:00
2020-12-29 19:55:33 +00:00
Cleanup
2021-04-26 10:30:40 +00:00
Cleanup Files
Get Docker Logs netmap_simple