From 017fedffed0b86f5fe7b7b14d5bb9588679108a3 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 07:28:01 +0300 Subject: [PATCH 1/2] update --- README.md | 1 + .../testsuites/integration/replication.robot | 45 +++++++++++++++++++ robot/testsuites/integration/withdraw.robot | 45 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 robot/testsuites/integration/replication.robot create mode 100644 robot/testsuites/integration/withdraw.robot diff --git a/README.md b/README.md index 1ab6d57..ea5566a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ * object_simple.robot - операции над большим объектом * withdraw.robot - оперция Deposit и Withdraw с счета NeoFS * netmap_simple.robot - проверка Placement policy + * replication.robot - базовый тесткейс проверки репликации объектов ### Запуск тесткейсов в докере diff --git a/robot/testsuites/integration/replication.robot b/robot/testsuites/integration/replication.robot new file mode 100644 index 0000000..9e74500 --- /dev/null +++ b/robot/testsuites/integration/replication.robot @@ -0,0 +1,45 @@ +*** Settings *** +Variables ../../variables/common.py + +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Test cases *** +NeoFS Simple Object Operations + [Documentation] Testcase to validate NeoFS Withdraw operation. + [Tags] Withdraw NeoFS NeoCLI + [Timeout] 10 min + + ${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} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + Sleep 1 min + + ${CID} = Create container ${PRIV_KEY} ${EMPTY} REP 2 IN X CBF 1 SELECT 4 FROM * AS X + Container Existing ${PRIV_KEY} ${CID} + + ${FILE} = Generate file of bytes 1024 + ${FILE_HASH} = Get file hash ${FILE} + + ${S_OID} = Put object to NeoFS ${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} + @{NODES_OBJ_STOPPED} = Stop nodes 1 @{NODES_OBJ} + Sleep 1 min + Validate storage policy for object ${PRIV_KEY} 2 ${CID} ${S_OID} + Start nodes @{NODES_OBJ_STOPPED} \ No newline at end of file diff --git a/robot/testsuites/integration/withdraw.robot b/robot/testsuites/integration/withdraw.robot new file mode 100644 index 0000000..359cdc0 --- /dev/null +++ b/robot/testsuites/integration/withdraw.robot @@ -0,0 +1,45 @@ +*** Settings *** +Variables ../../variables/common.py + +Library ${RESOURCES}/neofs.py +Library ${RESOURCES}/payment_neogo.py + +*** Test cases *** +NeoFS Simple Object Operations + [Documentation] Testcase to validate NeoFS Withdraw operation. + [Tags] Withdraw NeoFS NeoCLI + [Timeout] 10 min + + ${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} 55 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + Get Transaction ${TX} + Expexted Mainnet Balance ${ADDR} 55 + + ${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY} + + ${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX_DEPOSIT} + Get Transaction ${TX_DEPOSIT} + + Sleep 1 min + + Expexted Mainnet Balance ${ADDR} 4.86192020 + ${NEOFS_BALANCE} = Get Balance ${PRIV_KEY} + + ${TX} = Withdraw Mainnet Gas ${WALLET} ${ADDR} ${SCRIPT_HASH} 50 + Wait Until Keyword Succeeds 1 min 15 sec + ... Transaction accepted in block ${TX} + + Sleep 1 min + Get Balance ${PRIV_KEY} + Expected Balance ${PRIV_KEY} ${NEOFS_BALANCE} -50 + Expexted Mainnet Balance ${ADDR} 54.82554860 + + From e0cf6f3a2b74b563fc20371ad5e94c4e673f55e8 Mon Sep 17 00:00:00 2001 From: "anatoly@nspcc.ru" Date: Sun, 29 Nov 2020 07:30:45 +0300 Subject: [PATCH 2/2] update --- robot/testsuites/integration/replication.robot | 6 +++--- robot/testsuites/integration/withdraw.robot | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/robot/testsuites/integration/replication.robot b/robot/testsuites/integration/replication.robot index 9e74500..9e300a2 100644 --- a/robot/testsuites/integration/replication.robot +++ b/robot/testsuites/integration/replication.robot @@ -5,9 +5,9 @@ Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py *** Test cases *** -NeoFS Simple Object Operations - [Documentation] Testcase to validate NeoFS Withdraw operation. - [Tags] Withdraw NeoFS NeoCLI +NeoFS Object Replication + [Documentation] Testcase to validate NeoFS object replication. + [Tags] Migration Replication NeoFS NeoCLI [Timeout] 10 min ${WALLET} = Init wallet diff --git a/robot/testsuites/integration/withdraw.robot b/robot/testsuites/integration/withdraw.robot index 359cdc0..7d60ee2 100644 --- a/robot/testsuites/integration/withdraw.robot +++ b/robot/testsuites/integration/withdraw.robot @@ -5,7 +5,7 @@ Library ${RESOURCES}/neofs.py Library ${RESOURCES}/payment_neogo.py *** Test cases *** -NeoFS Simple Object Operations +NeoFS Deposit and Withdraw [Documentation] Testcase to validate NeoFS Withdraw operation. [Tags] Withdraw NeoFS NeoCLI [Timeout] 10 min