2021-09-09 13:36:34 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
Library Collections
|
|
|
|
Library Process
|
|
|
|
Library String
|
|
|
|
Library utility_keywords.py
|
|
|
|
|
|
|
|
Resource setup_teardown.robot
|
|
|
|
Resource payment_operations.robot
|
|
|
|
|
|
|
|
*** Variables ***
|
|
|
|
${DEPOSIT_AMOUNT} = ${10}
|
|
|
|
|
|
|
|
*** Test cases ***
|
|
|
|
CLI Accounting Balance Test
|
|
|
|
[Documentation] neofs-cli accounting balance test
|
|
|
|
[Timeout] 10 min
|
|
|
|
|
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${WALLET} ${ADDR} ${_} = Prepare Wallet And Deposit ${DEPOSIT_AMOUNT}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
# Getting balance with wallet and address
|
2022-06-13 20:33:09 +00:00
|
|
|
${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ADDR} --wallet ${WALLET} --config ${WALLET_CONFIG}
|
2022-02-01 13:42:41 +00:00
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
# Getting balance with wallet only
|
2022-06-13 20:33:09 +00:00
|
|
|
${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --wallet ${WALLET} --config ${WALLET_CONFIG}
|
2022-02-01 13:42:41 +00:00
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
# Getting balance with wallet and wrong address
|
2022-07-04 19:49:14 +00:00
|
|
|
${_} ${ANOTHER_ADDR} ${_} = Generate Wallet
|
2022-06-13 20:33:09 +00:00
|
|
|
${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance -r ${NEOFS_ENDPOINT} --address ${ANOTHER_ADDR} --wallet ${WALLET} --config ${WALLET_CONFIG}
|
2022-02-01 13:42:41 +00:00
|
|
|
... shell=True
|
2022-07-04 19:49:14 +00:00
|
|
|
Should Contain ${OUTPUT.stderr} --address option must be specified and valid
|
2021-09-09 13:36:34 +00:00
|
|
|
Should Be Equal As Numbers ${OUTPUT.rc} 1
|
|
|
|
|
|
|
|
# Getting balance with control API
|
2022-02-01 13:42:41 +00:00
|
|
|
${CONFIG_PATH} = Write API Config ${NEOFS_ENDPOINT} ${WALLET}
|
2022-01-12 07:39:53 +00:00
|
|
|
${OUTPUT} = Run Process ${NEOFS_CLI_EXEC} accounting balance --config ${CONFIG_PATH}
|
2022-02-01 13:42:41 +00:00
|
|
|
... shell=True
|
2021-09-09 13:36:34 +00:00
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
2021-11-01 16:22:04 +00:00
|
|
|
Write API Config
|
|
|
|
[Documentation] Write YAML config for requesting NeoFS API via CLI
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${ENDPOINT} ${WALLET}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
Set Local Variable ${PATH} ${ASSETS_DIR}/config.yaml
|
2022-02-01 13:42:41 +00:00
|
|
|
Create File ${PATH} rpc-endpoint: ${ENDPOINT}\nwallet: ${WALLET}\npassword: ''
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
[Return] ${PATH}
|