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 contract_keywords.py
|
|
|
|
Library cli_keywords.py
|
|
|
|
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
|
|
|
|
[Tags] NeoFSCLI Accounting
|
|
|
|
[Timeout] 10 min
|
|
|
|
|
|
|
|
[Setup] Setup
|
|
|
|
|
|
|
|
${WALLET} ${ADDR} ${WIF} = Prepare Wallet And Deposit ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
# Getting balance with WIF
|
|
|
|
${OUTPUT} = Run Process neofs-cli accounting balance -r ${NEOFS_ENDPOINT} --wif ${WIF}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
# Getting balance with wallet and address
|
|
|
|
${OUTPUT} = Run Process And Enter Empty Password
|
|
|
|
... neofs-cli accounting balance -r ${NEOFS_ENDPOINT} --address ${ADDR} --wallet ${WALLET}
|
|
|
|
Should Be Equal As Numbers ${OUTPUT} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
# Getting balance with wallet only
|
|
|
|
${OUTPUT} = Run Process And Enter Empty Password
|
|
|
|
... neofs-cli accounting balance -r ${NEOFS_ENDPOINT} --wallet ${WALLET}
|
|
|
|
Should Be Equal As Numbers ${OUTPUT} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
# Getting balance with wallet and wrong address
|
|
|
|
${ANOTHER_WALLET} ${ANOTHER_ADDR} ${ANOTHER_WIF} = Init Wallet With Address ${ASSETS_DIR}
|
|
|
|
${OUTPUT} = Run Process neofs-cli accounting balance -r ${NEOFS_ENDPOINT} --address ${ANOTHER_ADDR} --wallet ${WALLET}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Strings ${OUTPUT.stderr} --address option must be specified and valid
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.rc} 1
|
|
|
|
|
|
|
|
# Getting balance with control API
|
2021-11-01 16:22:04 +00:00
|
|
|
${CONFIG_PATH} = Write API Config ${NEOFS_ENDPOINT} ${WIF}
|
2021-09-09 13:36:34 +00:00
|
|
|
${OUTPUT} = Run Process neofs-cli accounting balance --config ${CONFIG_PATH}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
# Getting balance with binary key
|
|
|
|
${KEY_PATH} = WIF To Binary ${WIF}
|
|
|
|
${OUTPUT} = Run Process neofs-cli accounting balance -r ${NEOFS_ENDPOINT} --binary-key ${KEY_PATH}
|
|
|
|
... shell=True
|
|
|
|
Should Be Equal As Numbers ${OUTPUT.stdout} ${DEPOSIT_AMOUNT}
|
|
|
|
|
|
|
|
[Teardown] Teardown cli_accounting_balance
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
2021-11-01 16:22:04 +00:00
|
|
|
Write API Config
|
|
|
|
[Documentation] Write YAML config for requesting NeoFS API via CLI
|
2021-09-09 13:36:34 +00:00
|
|
|
[Arguments] ${ENDPOINT} ${WIF}
|
|
|
|
|
|
|
|
Set Local Variable ${PATH} ${ASSETS_DIR}/config.yaml
|
2021-11-01 16:22:04 +00:00
|
|
|
Create File ${PATH} rpc-endpoint: ${ENDPOINT}\nwif: ${WIF}
|
2021-09-09 13:36:34 +00:00
|
|
|
|
|
|
|
[Return] ${PATH}
|