aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/test_node.py
AgeCommit message (Collapse)Author
2018-10-24qa: Premine to deterministic address with -disablewalletMarcoFalke
Github-Pull: #14180 Rebased-From: faa669cbcd1fc799517b523b0f850e01b11bf40a
2018-10-24qa: Add TestNode::assert_debug_logMarcoFalke
Github-Pull: #14024 Rebased-From: fa3e9f7627784ee00980590e5bf044a0e1249999
2018-08-11Merge #13867: qa: Make extended tests pass on native WindowsMarcoFalke
fafe73a626 qa: Raise feature_help timeout to 5s (MarcoFalke) faabd7bc47 qa: Use files for stdout/stderr to support Windows (MarcoFalke) facb56ffaf qa: Run gen_rpcauth with sys.executable (MarcoFalke) fada8966c5 qa: Close stdout and stderr file when node stops (MarcoFalke) Pull request description: ### qa: Close stdout and stderr file when node stops Since these files are potentially deleted by the test framework for cleanup, they should be closed first. Otherwise this will lead to errors on Windows when the tests finish successfully. Side note: After the patch, it is no longer possible to reopen the file on Windows (see https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile) ### qa: Run gen_rpcauth with sys.executable Similar to `test_runner.py`, the `sys.executable` needs to be passed down into subprocesses to pass on native Windows. (Should have no effect on Linux) ### qa: Use files for stdout/stderr to support Windows It seems that using PIPE is not supported on Windows. Also, it is easier to just use the files that capture the stdout and stderr within the test node class. Tree-SHA512: ec675012b10705978606b7fcbdb287c39a8e6e3732aae2fa4041d963a3c6993c6eac6a9a3cbd5479514e7d8017fe74c12235d1ed6fed2e8af8f3c71981e91864
2018-08-09Merge #13916: qa: wait_for_verack by defaultMarcoFalke
fa5587fe71 qa: wait_for_verack by default (MarcoFalke) Pull request description: This removes the need to do so manually every time a connection is added. Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
2018-08-08qa: wait_for_verack by defaultMarcoFalke
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-08-03qa: Use files for stdout/stderr to support WindowsMarcoFalke
2018-08-03qa: Close stdout and stderr file when node stopsMarcoFalke
2018-08-02Merge #13823: qa: quote path in authproxy for external multiwalletsWladimir J. van der Laan
fa67505e1ea007bdc081bc7425fb83d5455d8308 qa: Quote wallet name for rpc path (MarcoFalke) Pull request description: When using external multiwallets they are specified by their full path which might contain non-ascii characters (e.g. umlauts or emojis). Fix this by url-quoting the path. Tree-SHA512: 7cc66514579d9f602f88a6817c5ab43a44c6d3711df452dc904173f0bc34e2c0b2c34877497f06b61f6720c532fa183053f54622dc454e316c89cee7eaa72463
2018-08-02qa: Quote wallet name for rpc pathMarcoFalke
2018-08-01qa: Extract rpc_timewait as test paramMarcoFalke
Also increase it for wallet_dump and wallet_groups
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-12QA: Fix bug in -usecli logic that converts booleans to non-lowercase stringsJonas Schnelli
2018-06-25qa: Avoid start/stop of the network thread mid-testMarcoFalke
2018-05-09[qa] Avoid printing to console during cache creationSuhas Daftuar
2018-05-09[tests] Allow stderr to be tested against specified stringJohn Newbery
Allow bitcoind's stderr to be tested against a specified string on shutdown.
2018-05-09[Tests] Use LIBC_FATAL_STDERR_=1 in testsJohn Newbery
By default, libc will print fatal errors to /dev/tty instead of stderr. Adding the LIBC_FATAL_STDERR_ to the environment variables allows us to catch libc errors in stderr and test for them.
2018-05-09[Tests] Write stdout/stderr to datadir instead of temp file.John Newbery
2018-04-25Merge #13051: qa: Normalize executable locationWladimir J. van der Laan
fa811b0 qa: Normalize executable location (MarcoFalke) Pull request description: This removes the need to override the executable locations by just reading them from the config file. Beside making the code easier to read, running individual test on Windows is now possible by default (without providing further command line arguments). Note: Of course, it is still possible to manually specify the location through the `BITCOIND` environment variable, e.g. `bitcoin-qt`. Tree-SHA512: bee6d22246796242d747120ca18aaab089f73067de213c9111182561985c5912228a0b0f7f9eec025ecfdb44db031f15652f30d67c489d481c995bb3232a7ac7
2018-04-21qa: Normalize executable locationMarcoFalke
2018-04-19[qa] Attach node index to test_node AssertionError and print messagesJames O'Beirne
to aid debugging. Feedback incorporated from @Empact.
2018-04-17Print to console by default when not run with -daemonEvan Klitzke
Printing to the debug log file can be disabled with -nodebulogfile
2018-04-09Merge #12902: [qa] Handle potential cookie race when starting nodeMarcoFalke
75d0e4c544 [qa] Delete cookie file before starting node (Suhas Daftuar) Pull request description: When a node is restarted during a test after an unclean shutdown (such as with -dbcrashratio), it's possible an old cookie file was left behind. This can cause a race condition when restarting the node, where the test framework might try to connect using credentials from the old cookie file, just as the node will generate new credentials and overwrite the old file. Delete any such cookie file if present prior to startup. Tree-SHA512: ae1e8bf8fd20e07c32b0715025693bb28b0e3dd34f328cae4346abf579b0c97b5db1c02782e1c46b7a3b6058d268b6d46b668e847658a6eed0be857ffb0d65dc
2018-04-09[qa] Delete cookie file before starting nodeSuhas Daftuar
If a cookie file exists in a datadir prior to node startup, it must have been leftover from a prior unclean shutdown. As bitcoind will overwrite it anyway, delete it before starting up to prevent the test framework from inadvertently trying to connect using stale credentials.
2018-04-08Merge #12904: [qa] Ensure bitcoind processes are cleaned up when tests endWladimir J. van der Laan
e36a0c0 [qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar) Pull request description: When tests fail (such as due to a bug in the test, race condition, etc), it's possible that we could follow code paths that bypass our normal node shutdown that occurs in `TestNode.stop_node`. Add a destructor to `TestNode` that cleans this up. Tree-SHA512: 72e04bc21462ebd0cb346fd1fe0540da454acfbad41923a0b06ea2317e9045b68e58f9adb02d8200891aca89a9d03a022eb72282aeb31a3b3afe7c6843a4b450
2018-04-08[qa] Ensure bitcoind processes are cleaned up when tests endSuhas Daftuar
2018-04-01qa: Match full plain text by defaultMarcoFalke
2018-03-28[Tests] fix a typo in TestNode.assert_start_raises_init_error()Roman Zeyde
Also, use specific exception for testing TestNode initialization failure.
2018-03-22Merge #12076: qa: Use node.datadir instead of tmpdir in test frameworkWladimir J. van der Laan
c8330d4 qa: Use node.datadir instead of tmpdir in test framework (MarcoFalke) Pull request description: Commit c53c9831eedaf3b311bb942945268830f9ba3abc introduced the utility function `get_datadir_path`, however not all places in the code use this util function. Using the util function everywhere makes it easier to review pull requests related to the datadir. This commit replaces datadir path creation with the `datadir` member of `TestNode`, which itself uses `get_datadir_path`. Tree-SHA512: c75707ab7149d732a6d56152a5813138a33459d3d07577b60b89f2a207c83b7663fac5f203593677c9892d1c23a5eba4bd45c5c4ababf040d720b437240fcddf
2018-03-22Merge #12718: [Tests] Require exact match in assert_start_raises_init_eror ↵Wladimir J. van der Laan
(jnewbery) fae1374 qa: Allow for partial_match when checking init error (MarcoFalke) 5812273 [Tests] Require exact match in assert_start_raises_init_eror() (John Newbery) 0ec08a6 [Tests] Move assert_start_raises_init_error method to TestNode (John Newbery) Pull request description: Extracted from #12379, because the changes are important on their own. This allows for exact testing, since the match can be specified with a strict regex. Internal details (such as exact formatting of the error message) can still be fuzzed away by regex wildcards. Tree-SHA512: 605d2c9c42362a32d42321b066637577a026d0bb8cfc1c9f5737a4ca6503ffe85457a5122cea6e1101053ccc6c8aa1bbae3602e1fa7d2988bf7d5c275f412f66
2018-03-21Fix typosDimitris Apostolou
2018-03-19qa: Allow for partial_match when checking init errorMarcoFalke
This allows the tests to pass on different platforms
2018-03-19qa: Use node.datadir instead of tmpdir in test frameworkMarcoFalke
2018-03-18[Tests] Require exact match in assert_start_raises_init_eror()John Newbery
2018-03-18[Tests] Move assert_start_raises_init_error method to TestNodeJohn Newbery
2018-03-06[tests] bind functional test nodes to 127.0.0.1Sjors Provoost
Prevents OSX firewall allow-this-application-to-accept-inbound-connections permission popups and is generally safer. To prevent binding to 127.0.0.1, set self.bind_to_localhost_only = False.
2018-02-15qa: Move common args to bitcoin.confMarcoFalke
2018-01-24Merge #12089: qa: Make TestNodeCLI command optional in send_cliMarcoFalke
fae7b14a04 qa: Make TestNodeCLI command optional in send_cli (MarcoFalke) ffffb10a9f qa: Rename cli.args to cli.options (MarcoFalke) Pull request description: Makes the `command` optional, since there are valid bitcoin-cli calls that have no `command`: * `bitcoin-cli -?` * `bitcoin-cli -getinfo` * ... Also, rename self.args to self.options, since that is the name in the `bitcoin-cli -help` documentation. Tree-SHA512: f49c06024e78423301d70782946d47c0fb97a26876afba0a1f71ed329f5d7124aee4c2df520c7af74079bf9937851902f7be9c54abecc28dc29274584804d46c
2018-01-23qa: Make TestNodeCLI command optional in send_cliMarcoFalke
2018-01-23qa: Rename cli.args to cli.optionsMarcoFalke
That is the name in bitcoin-cli -help
2018-01-18Don't allow relative -walletdir pathsRussell Yanofsky
Also warn if bitcoind is configured to use a relative -datadir path. Specifying paths relative to the current working directory in a daemon process can be dangerous, because files can fail to be located even if the configuration doesn't change, but the daemon is started up differently. Specifying a relative -datadir now adds a warning to the debug log. It would not be backwards-compatible to forbid relative -datadir paths entirely, and it could also be also inconvenient for command line testing. Specifying a relative -walletdir now results in a startup error. But since the -walletdir option is new in 0.16.0, there should be no compatibility issues. Another reason not to use working directory paths for -walletdir specifically is that the default -walletdir is a "wallets" subdirectory inside the datadir, so it could be surprising that setting -walletdir manually would choose a directory rooted in a completely different location.
2018-01-08[tests] allow tests to be run with --usecliJohn Newbery
test_framework accepts a new --usecli parameter. Running the test with this parameter will cause all RPCs to be sent through bitcoin-cli rather than directly over http. By default, individual test cases do not support --usecli, and self.supports_cli must be set to True in the set_test_params method. We can make supports_cli default to True in future once we know which tests will fail with use_cli.
2018-01-08TestNodeCLI batch emulationRussell Yanofsky
Support same get_request and batch methods as AuthServiceProxy
2018-01-08Prevent TestNodeCLI.args mixupsRussell Yanofsky
Change TestNodeCLI.__call__() to return a new instance instead of modifying the existing instance. This way, it's possible to create different cli objects that have their own options (for example -rpcwallet options to connect to different wallets), and options set for a single call (`node.cli(options).method(args)`) will no longer leak into future calls.
2018-01-08Improve TestNodeCLI output parsingRussell Yanofsky
Parse JSONRPCException errors, and avoid JSON decode exception if RPC method returns a plain string.
2017-11-28[tests] Make NodeConnCB a subclass of NodeConnJohn Newbery
This makes NodeConnCB a subclass of NodeConn, and removes the need for the client code to know anything about the implementation details of NodeConnCB. NodeConn can now be swapped out for any other implementation of a low-level connection without changing client code.
2017-11-14Merge #11677: qa: Remove unused NodeConn membersMarcoFalke
fafdad0d4 qa: Remove unused NodeConn members (MarcoFalke) Pull request description: * `ver_send` and `ver_recv` were completely unused * `rpc` was only used once, in p2p-segwit. Imo better only pass it to the constructor in that single test Tree-SHA512: 7f85554d6d0fd2096516ca3c608811d5370da66cde35d8031bdc921607a7a4efdb26355896012f75f713f8df09e28d46ba46be69fd96a5898fabb1a25cbcb8ad
2017-11-13qa: Remove unused NodeConn membersMarcoFalke
2017-11-13qa: Only allow disconnecting all NodeConnsMarcoFalke
2017-11-08[tests] Add p2p connection to TestNodeJohn Newbery
p2p connections can now be added to TestNode instances. This commit also updates the example test to use the new p2p interface in TestNode to demonstrate usage. A future commit will update the existing tests to use p2p through the TestNode.