aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_bitcoin_cli.py
AgeCommit message (Collapse)Author
2024-07-16scripted-diff: Add `__file__` argument to `BitcoinTestFramework.init()`Hennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py) sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py -END VERIFY SCRIPT-
2024-05-13cli: Sanitize ports in rpcconnect and rpcporttdb3
Adds error handling of invalid ports to rpcconnect and rpcport, with associated functional tests.
2023-10-10 test: Use pathlib over os.path #28362ns-xvrn
revert netutil chgs py3.8 compliant fixes based on PR review
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-12-02bitcoin-cli: Make it an error to specify the "args" parameter two different waysRyan Ofsky
MarcoFalke reported the case of positional arguments silently overwriting the named "args" parameter in bitcoin-cli https://github.com/bitcoin/bitcoin/pull/19762#discussion_r1035761471 and this behavior is confusing and was not intended when support for "args" parameters was added to bitcoin-cli in #19762. Instead of letting one "args" value overwrite the other in the client, just pass the values to the server verbatim, and let the error be handled server side.
2022-12-02test: Add RPC tests for same named parameter specified more than onceRyan Ofsky
Current behavior isn't ideal and will be changed in upcoming commits, but it's useful to have test coverage regardless. MarcoFalke reported the case of bitcoin-cli positional arguments overwriting the named "args" parameter in https://github.com/bitcoin/bitcoin/pull/19762#discussion_r1035761471
2022-11-29Merge bitcoin/bitcoin#19762: rpc: Allow named and positional arguments to be ↵Andrew Chow
used together d8b12a75dbfdc1d3e62352f0fa815bbbdc685caf rpc: Allow named and positional arguments to be used together (Ryan Ofsky) Pull request description: It's nice to be able to use named options and positional arguments together. Most shell tools accept both, and python functions combine options and arguments allowing them to be passed with even more flexibility. This change adds support for python's approach so as a motivating example: ```sh bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=1 ``` Can be shortened to: ```sh bitcoin-cli -named createwallet mywallet load_on_startup=1 ``` JSON-RPC standard doesn't have a convention for passing named and positional parameters together, so this implementation makes one up and interprets any unused `"args"` named parameter as a positional parameter array. This change is backwards compatible. It doesn't change the interpretation of any previously valid calls, just treats some previously invalid calls as valid. Another use case even if you only occasionally use named arguments is that you can define an alias: ``` alias bcli='bitcoin-cli -named' ``` And now use both named named and unnamed arguments from the same alias without having to manually add `-named` option for named arguments or see annoying error "No '=' in named argument... this needs to be present for every argument (even if it is empty)`" for unnamed arguments ACKs for top commit: achow101: ACK d8b12a75dbfdc1d3e62352f0fa815bbbdc685caf stickies-v: re-ACK d8b12a75d aureleoules: re-ACK d8b12a75dbfdc1d3e62352f0fa815bbbdc685caf Tree-SHA512: 0cff8b50f584bcbbd376624adccf40536566ed8d1bcd6c88ad565dbc208f19d5e7a48c994efd6329d42b560149340d330397278f08a2912af5f3418d8c8837a9
2022-11-10test: Remove wallet option from non-wallet testsMacroFake
Review note: The changes are complete, because self.options.descriptors is set to None in parse_args (test_framework.py). A value of None implies -disablewallet, see the previous commit. So if a call to add_wallet_options is missing, it will lead to a test failure when the wallet is compiled in.
2022-11-10test: Make requires_wallet privateMacroFake
The bool is only used to call a public helper, which some tests already do. So use the public helper in all tests consistently and make the confusingly named bool private.
2022-11-05rpc: Allow named and positional arguments to be used togetherRyan Ofsky
It's nice to be able to use named options and positional arguments together. Most shell tools accept both, and python functions combine options and arguments allowing them to be passed with even more flexibility. This change adds support for python's approach so as a motivating example: bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=1 Can be shortened to: bitcoin-cli -named createwallet mywallet load_on_startup=1 JSON-RPC standard doesn't have a convention for passing named and positional parameters together, so this implementation makes one up and interprets any unused "args" named parameter as a positional parameter array.
2021-12-09test: fix test feature_coinstatsindex.py for descriptor walletsSebastian Falbesoner
2021-12-08test: feature_rbf.py: check specified wallet type availabilitySebastian Falbesoner
The test currently leads to a failure if in general wallet support is compiled, but the library for the specified type (BDB/SQLite) is not, i.e. if started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support. Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available. Also move the helper `is_specified_wallet_compiled()` to the test framework's class BitcoinTestFramework first, so it can be reused.
2021-12-08test: interface_bitcoin_cli.py: check specified wallet type availabilitySebastian Falbesoner
Currently the test performs the wallet-relevant parts if _any_ wallet type support is compiled in, independently of whether the test is run with legacy or descriptor wallet specified. This leads to a failure if the test is started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support. Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available.
2021-12-06test: fix test interface_bitcoin_cli.py for descriptor walletsSebastian Falbesoner
2021-11-10scripted-diff: Bump copyright headersMarcoFalke
The previous diff touched most files in ./test/, so bump the headers to avoid having to touch them again for a bump later. -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2021-11-03net: don't skip CJDNS from GetNetworksInfo()Vasil Dimov
2021-09-20cli: Display all proxies in -getinfoklementtan
2021-09-02scripted-diff: Use generate* from TestFrameworkMarcoFalke
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i \ 's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \ $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf') -END VERIFY SCRIPT-
2021-08-18test: use f-strings in interface_*.py testsfanquake
2021-07-21cli: Implement human readable -getinfo.Klement Tan
2021-06-03rpc: Add test for -rpcwaittimeoutChristian Decker
Suggested-by: Jon Atack <@jonatack>
2021-05-31Use COINBASE_MATURITY constant in functional tests.Kiminuo
2021-05-01test: resolve bug in test/functional/interface_bitcoin_cli.py - Test ↵klementtan
-getinfo with -rpcwallet=unloaded wallet returns no balances
2021-01-27Setup wallets for interface_bitcoin_cli.pyAndrew Chow
2020-09-29test, refactor: add default_wallet_name and wallet_data_filename variablesRussell Yanofsky
No changes in behavior
2020-08-24Add in/out connections to cli -getinfoJon Atack
2020-06-02rpc: add missing space in JSON parsing error message, update testJon Atack
2020-06-02test: add multiwallet tests for bitcoin-cli -generateJon Atack
2020-06-02test: add tests for bitcoin-cli -generateJon Atack
2020-05-21test: add -getinfo multiwallet functional testsJon Atack
and improve the existing -getinfo -rpcwallet tests.
2020-04-24Merge #18724: test: add coverage for -rpcwallet cli optionMarcoFalke
2495110012fc0cb7142a4536791dd79da5cc3e44 test: add coverage for -rpcwallet cli option (Jon Atack) Pull request description: The bitcoin-cli `-rpcwallet=` option is an essential RPC/CLI option when more than one wallet is loaded (see `bitcoin-cli -help | grep -A5 rpcwallet` or `src/bitcoin-cli.cpp::L61`) and it currently has no test coverage. It is not only used by users, but also by the test framework and ~10 test files via `get_wallet_rpc()`. This PR adds coverage, while simultaneously improving the `-getinfo` coverage when multiple wallets are loaded. This is similar to the test coverage that would be added in #18594. ACKs for top commit: robot-visions: ACK 2495110012fc0cb7142a4536791dd79da5cc3e44 Tree-SHA512: caaa8b99fb8fa481ab2c6b2a287ed29720bb4553c3f66657462c44fa2990acaaf36cabeaaf81408678e5fdce4e105d729dd94b5ed8588dd1a6f2cb03fc25acf3
2020-04-24test: add coverage for -rpcwallet cli optionJon Atack
and add -getinfo coverage with multiple wallets loaded.
2020-04-21test: display command line options passed to send_cli() in debug logJon Atack
and fixup two cli calls from rpc commands to command line options. Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2020-04-19test: fix intermittent race condition in interface_bitcoin_cli.pyJon Atack
by calling wait_for_cookie_credentials() to ensure the cookie file is written and auth credentials available for testing the CLI -rpcwait option before the RPC connection is up.
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-04-15test: add -getinfo "unlocked_until" and "headers" coverageJon Atack
2020-04-15test: verify cli.getwalletinfo in wallet sectionJon Atack
2020-04-15test: verify bitcoin-cli -version with node stoppedJon Atack
in interface_bitcoin_cli.py and improve/harmonize the test logging.
2020-04-15test: add coverage for bitcoin-cli -rpcwaitJon Atack
in interface_bitcoin_cli.py
2020-04-09test: update and harden interface_bitcoin_cli testsJon Atack
- no longer depend on the deprecated balance field of getwalletinfo - test blockcount and balance against non-default, non-zero expected values
2019-12-04Merge #17650: util: remove unwanted fields from bitcoin-cli -getinfofanquake
01c87015597021bf1c0856f7f6be175bdde844b2 util: remove unwanted fields from bitcoin-cli -getinfo (malevolent) Pull request description: Removed the following fields from -getinfo: protocolversion, walletversion and keypoololdest. This change closes #17314 . ACKs for top commit: laanwj: ACK 01c87015597021bf1c0856f7f6be175bdde844b2 achow101: ACK 01c87015597021bf1c0856f7f6be175bdde844b2 practicalswift: ACK 01c87015597021bf1c0856f7f6be175bdde844b2 -- diff looks correct Tree-SHA512: c98f2e8a3fee04d46766f70cb88f4e49e892a4424eff8940a7d48e9e808597b702427225788f984f5c3641591fd8d86acee56774afde1d57a4259c31d971ea08
2019-12-04util: remove unwanted fields from bitcoin-cli -getinfomalevolent
In accordance with #17314, Removing noisy fields from -getinfo. Fields removed: protocolversion, walletversion and keypoololdest. In addition to changing bitcoin-cli -getinfo, there is another change to test/functional/interface_bitcoin_cli.py. This change deletes tests that utilize removed -getinfo calls.
2019-11-18test: skip bitcoin_cli test when the cli isn't compiledfanquake
2019-07-31test: Adapt test framework for chains other than "regtest"MarcoFalke
Co-Authored-By: Jorge Timón <jtimon@jtimon.cc>
2019-04-25QA: feature_filelock, interface_bitcoin_cli: Use PACKAGE_NAME in messages ↵Luke Dashjr
rather than hardcoding Bitcoin Core
2019-03-11Merge #15564: cli: remove duplicate wallet fields from -getinfoMarcoFalke
3f6568d66b cli: remove duplicate wallet fields from -getinfo (fanquake) Pull request description: `walletversion` and `balance` are both included below. Tree-SHA512: cd9fe9739a2f492c8f7c0407b43a6fa95187f7e5318f05e080bac112f9f4333d2e9b84c505d098f8d66fa79439007d1c0b22e5a87d70bf5ea53ab647ee4c2046
2019-03-09cli: remove duplicate wallet fields from -getinfofanquake
2019-03-09cli: replace testnet with chain and return network name as per BIP70.fanquake
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Remove brackets after assertMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test) -END VERIFY SCRIPT-