dash/test/functional/test_framework
MarcoFalke 4ae6d0fbef
Merge #10798: [tests] [utils] test bitcoin-cli
c6ec4358a [tests] Add bitcoin_cli.py test script (John Newbery)
b23549f6e [tests] add TestNodeCLI class for calling bitcoin-cli for a node (John Newbery)

Pull request description:

  We don't test bitcoin-cli at all. That means that we can miss inconsistencies between the bitcoin-cli client and the RPC interface, such as #10698 and #10747. It also means that the various bitcoin-cli options and features are untested and regressions could be silently introduced.

  Let's fix that.

  This PR adds bitcoin-cli testing in the python functional test_framework:

  1. Add a bitcoin_cli.py test script that tests bitcoin-cli. At the moment it only tests that the result of `getinfo` is the same if you run it as an RPC or through bitcoin-cli, but can easily be extended to test additional bitcoin-cli features

  **EDIT: `--usecli` option is moved to a separate PR. This PR now only covers the bitcoin_cli.py test.**

  2. ~Add a `--usecli` option to the test framework. This changes the test to use bitcoin-cli for all RPC calls instead of using direct HTTP requests. This is somewhat experimental. It works for most tests, but there are some cases where it can't work transparently because:~
  - ~the testcase is asserting on a specific error code, and bitcoin-cli returns a different error code from the direct RPC~
  - ~we're sending a very large RPC request (eg `submitblock`) and it can't be serialized into a shell bitcoin-cli call.~

  ~I think that even though `--usecli` doesn't work on all tests, it's still a useful experimental feature. Future potential enhancements:~
  - ~enhance the framework to automatically skip tests that are known to fail with bitcoin-cli if the `--usecli` option is used.~
  - ~run a subset of tests in Travis with `-usecli`~

  This builds on and requires the `TestNode` PR #10711 . As an aside, this is a good demonstration of how tidy it is to add additional features/interfaces now that test node logic/state is encapsulated in a TestNode class.

  Addresses #10791

Tree-SHA512: a1e6be12e8e007f6f67b3d3bbcd142d835787300831eb38e6027a1ad25ca9d79c4bc99a41b19e31ee95205cba1b3b2d21a688b5909316aad70bfc2b4eb6d8a52
2017-08-24 16:04:36 -04:00
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
authproxy.py [tests] [wallet] Add wallet endpoint support to authproxy 2017-07-17 17:42:21 +02:00
bignum.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
blockstore.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
blocktools.py Tests: Refactor to create witness script creation function 2017-04-20 11:28:45 -07:00
comptool.py qa: Move wait_until to util 2017-08-17 15:17:09 +02:00
coverage.py [tests] [wallet] Add wallet endpoint support to authproxy 2017-07-17 17:42:21 +02:00
key.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
mininode.py qa: Move wait_until to util 2017-08-17 15:17:09 +02:00
netutil.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
script.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
siphash.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
socks5.py [tests] Remove unused and duplicate imports 2017-03-22 17:49:23 +01:00
test_framework.py Merge #10711: [tests] Introduce TestNode 2017-08-15 23:35:07 +02:00
test_node.py Merge #10798: [tests] [utils] test bitcoin-cli 2017-08-24 16:04:36 -04:00
util.py qa: Move wait_until to util 2017-08-17 15:17:09 +02:00