2021-07-15 17:57:57 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
Library Collections
|
|
|
|
Library Process
|
|
|
|
Library String
|
2021-09-27 20:41:21 +00:00
|
|
|
Library contract_keywords.py
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Resource payment_operations.robot
|
2021-09-27 20:41:21 +00:00
|
|
|
Resource setup_teardown.robot
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
*** Variables ***
|
2022-06-13 20:33:09 +00:00
|
|
|
${SN_01_ADDR} = s01.neofs.devenv:8080
|
|
|
|
${SN_02_ADDR} = s02.neofs.devenv:8080
|
|
|
|
${DEPOSIT} = ${30}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
*** Test cases ***
|
|
|
|
NetworkInfo RPC Method
|
|
|
|
[Documentation] Testcase to check NetworkInfo RPC method.
|
2022-06-13 20:33:09 +00:00
|
|
|
[Tags] RPC NetworkInfo
|
2021-07-15 17:57:57 +00:00
|
|
|
[Timeout] 10 min
|
|
|
|
|
|
|
|
[Setup] Setup
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Checking if the command returns equal results for two storage nodes
|
|
|
|
######################################################################
|
2022-06-13 20:33:09 +00:00
|
|
|
${RESULT1_S01} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Integers ${RESULT1_S01.rc} 0
|
|
|
|
${RESULT1_S02} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Integers ${RESULT1_S02.rc} 0
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
#############################################
|
|
|
|
# Checking if morph magic number is relevant
|
|
|
|
#############################################
|
2021-09-09 13:36:34 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${NETWORK_MAGIC_S01} = Parse Magic ${RESULT1_S01.stdout}
|
|
|
|
Should Be Equal ${NETWORK_MAGIC_S01} ${MORPH_MAGIC}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${NETWORK_MAGIC_S02} = Parse Magic ${RESULT1_S02.stdout}
|
|
|
|
Should Be Equal ${NETWORK_MAGIC_S02} ${MORPH_MAGIC}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Checking if epoch numbers requested from two storage nodes are equal
|
|
|
|
#######################################################################
|
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${EPOCH1_S01} = Parse Epoch ${RESULT1_S01.stdout}
|
|
|
|
${EPOCH1_S02} = Parse Epoch ${RESULT1_S02.stdout}
|
|
|
|
Should Be Equal As Integers ${EPOCH1_S01} ${EPOCH1_S02}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
# Ticking epoch and getting new netinfo
|
|
|
|
########################################
|
2021-09-09 13:36:34 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
Tick Epoch
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${RESULT2_S01} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_01_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Integers ${RESULT2_S01.rc} 0
|
|
|
|
${RESULT2_S02} = Run Process ${NEOFS_CLI_EXEC} netmap netinfo -r ${SN_02_ADDR} --wallet ${STORAGE_WALLET_PATH} --config ${WALLET_CONFIG}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Integers ${RESULT2_S02.rc} 0
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
Should Be Equal As Strings ${RESULT2_S01.stdout} ${RESULT2_S02.stdout}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${EPOCH2_S01} = Parse Epoch ${RESULT2_S01.stdout}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
#################################################################
|
|
|
|
# Checking if the second epoch value is more than the first by 1
|
|
|
|
#################################################################
|
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${NEW_EPOCH} = Evaluate ${EPOCH1_S01}+${1}
|
|
|
|
Should Be Equal ${EPOCH2_S01} ${NEW_EPOCH}
|
2021-07-15 17:57:57 +00:00
|
|
|
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
[Teardown] Teardown network_rpc_method
|
2021-07-15 17:57:57 +00:00
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
|
|
|
Parse Magic
|
2021-09-09 13:36:34 +00:00
|
|
|
[Arguments] ${RESULT_STDOUT}
|
2021-07-15 17:57:57 +00:00
|
|
|
@{MAGIC} = Split String ${RESULT_STDOUT} ${\n}
|
|
|
|
${NETWORK_MAGIC} = Get From List ${MAGIC} ${1}
|
|
|
|
@{MAGIC_INFO} = Split String ${NETWORK_MAGIC} ${SPACE}
|
|
|
|
${MAGIC_VALUE} = Get From List ${MAGIC_INFO} ${4}
|
|
|
|
[Return] ${MAGIC_VALUE}
|
|
|
|
|
|
|
|
Parse Epoch
|
2021-09-09 13:36:34 +00:00
|
|
|
[Arguments] ${RESULT_STDOUT}
|
2021-07-15 17:57:57 +00:00
|
|
|
@{EPOCH} = Split String ${RESULT_STDOUT} ${\n}
|
|
|
|
${NETWORK_EPOCH} = Get From List ${EPOCH} ${0}
|
|
|
|
@{EPOCH_INFO} = Split String ${NETWORK_EPOCH} ${SPACE}
|
|
|
|
${EPOCH_VALUE} = Get From List ${EPOCH_INFO} ${1}
|
|
|
|
${EPOCH_VALUE_INT} = Convert To Integer ${EPOCH_VALUE}
|
|
|
|
[Return] ${EPOCH_VALUE_INT}
|