Commit graph

153 commits

Author SHA1 Message Date
Anthony Towns 3150b3fea7 [tests] Rename misc functional tests. 2018-01-25 09:44:30 +10:00
Anthony Towns 81b79f2c39 [tests] Rename rpc_* functional tests. 2018-01-25 09:44:29 +10:00
Anthony Towns 61b8f7f273 [tests] Rename p2p_* functional tests. 2018-01-25 09:44:29 +10:00
Anthony Towns 90600bc7db [tests] Rename wallet_* functional tests. 2018-01-25 09:44:29 +10:00
Anthony Towns ca6523d0c8 [tests] Rename feature_* functional tests. 2018-01-25 09:44:29 +10:00
MarcoFalke faefd2923a
qa: Prepare functional tests for Windows
* Pass `sys.executable` when calling a python script via the subprocess
  module
* Don't remove the log file while it is still open and written to
* Properly use os.pathsep and os.path.sep when modifying the PATH
  environment variable
* util-tests: Use os.path.join for Windows compatibility
2018-01-24 15:52:07 -05:00
Russell Yanofsky ac96e788fa test_runner: Readable output if create_cache.py fails
Without this change, create_cache.py process output is shown as a byte() object
with \n escapes in a single line that is hard to read.
2018-01-19 13:04:03 -05:00
Wladimir J. van der Laan 4db16ec827
Merge #11796: [tests] Functional test naming convention
5fecd84 [tests] Remove redundant import in blocktools.py test (Anthony Towns)
9b20bb4 [tests] Check tests conform to naming convention (Anthony Towns)
7250b4e [tests] README.md nit fixes (Anthony Towns)
82b2712 [tests] move witness util functions to blocktools.py (John Newbery)
1e10854 [tests] [docs] update README for new test naming scheme (John Newbery)

Pull request description:

  Splitting #11774 into two parts -- this part updates the README with the proposed naming convention, and adds some checks to test_runner.py that the number of tests violating the naming convention doesn't increase too much. Idea is this part of the change should not introduce merge conflicts or require much rebasing, so reviews of the complicated bits won't become invalidated too often; while the second part will just be file renames, which will require regular rebasing and will introduce merge conflicts with pending PRs, but can be merged later, and should also be much easier to review, since it will only include relatively trivial changes.

Tree-SHA512: b96557d41714addbbfe2aed62fb5a48639eaeb1eb3aba30ac1b3a86bb3cb8d796c6247f9c414c4695c4bf54c0ec9968ac88e2f88fb62483bc1a2f89368f7fc80
2018-01-15 10:38:01 +01:00
MarcoFalke b7450cdbd8
Merge #11970: Add test coverage for bitcoin-cli multiwallet calls
a14dbff39e Allow multiwallet.py to be used with --usecli (Russell Yanofsky)
f6ade9ce1a [tests] allow tests to be run with --usecli (John Newbery)
ff9a363ff7 TestNodeCLI batch emulation (Russell Yanofsky)
ca9085afc5 Prevent TestNodeCLI.args mixups (Russell Yanofsky)
fcfb952bca Improve TestNodeCLI output parsing (Russell Yanofsky)

Pull request description:

  Lack of test coverage was pointed out by @jnewbery in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r158133900

Tree-SHA512: 5f10e31abad11a5edab0da4e2515e39547adb6ab9e55e50427ab2eb7ec9a43d6b896b579b15863e5edc9beee7d8bf1c84d9dabd247be0760a1b9ae39e1e8ee02
2018-01-12 17:25:01 -05:00
Jonas Schnelli d889c036cd
Merge #11403: SegWit wallet support
b224a47a1 Add address_types test (Pieter Wuille)
7ee54fd7c Support downgrading after recovered keypool witness keys (Pieter Wuille)
940a21932 SegWit wallet support (Pieter Wuille)
f37c64e47 Implicitly know about P2WPKH redeemscripts (Pieter Wuille)
57273f2b3 [test] Serialize CTransaction with witness by default (Pieter Wuille)
cf2c0b6f5 Support P2WPKH and P2SH-P2WPKH in dumpprivkey (Pieter Wuille)
37c03d3e0 Support P2WPKH addresses in create/addmultisig (Pieter Wuille)
3eaa003c8 Extend validateaddress information for P2SH-embedded witness (Pieter Wuille)
30a27dc5b Expose method to find key for a single-key destination (Pieter Wuille)
985c79552 Improve witness destination types and use them more (Pieter Wuille)
cbe197470 [refactor] GetAccount{PubKey,Address} -> GetAccountDestination (Pieter Wuille)
0c8ea6380 Abstract out IsSolvable from Witnessifier (Pieter Wuille)

Pull request description:

  This implements a minimum viable implementation of SegWit wallet support, based on top of #11389, and includes part of the functionality from #11089.

  Two new configuration options are added:
  * `-addresstype`, with options `legacy`, `p2sh`, and `bech32`. It controls what kind of addresses are produced by `getnewaddress`, `getaccountaddress`, and `createmultisigaddress`.
  * `-changetype`, with the same options, and by default equal to `-addresstype`, that controls what kind of change is used.

  All wallet private and public keys can be used for any type of address. Support for address types dependent on different derivation paths will need a major overhaul of how our internal detection of outputs work. I expect that that will happen for a next major version.

  The above also applies to imported keys, as having a distinction there but not for normal operations is a disaster for testing, and probably for comprehension of users. This has some ugly effects, like needing to associate the provided label to `importprivkey` with each style address for the corresponding key.

  To deal with witness outputs requiring a corresponding redeemscript in wallet, three approaches are used:
  * All SegWit addresses created through `getnewaddress` or multisig RPCs explicitly get their redeemscripts added to the wallet file. This means that downgrading after creating a witness address will work, as long as the wallet file is up to date.
  * All SegWit keys in the wallet get an _implicit_ redeemscript added, without it being written to the file. This means recovery of an old backup will work, as long as you use new software.
  * All keypool keys that are seen used in transactions explicitly get their redeemscripts added to the wallet files. This means that downgrading after recovering from a backup that includes a witness address will work.

  These approaches correspond to solutions 3a, 1a, and 5a respectively from https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2. As argued there, there is no full solution for dealing with the case where you both downgrade and restore a backup, so that's also not implemented.

  `dumpwallet`, `importwallet`, `importmulti`, `signmessage` and `verifymessage` don't work with SegWit addresses yet. They're remaining TODOs, for this PR or a follow-up. Because of that, several tests unexpectedly run with `-addresstype=legacy` for now.

Tree-SHA512: d425dbe517c0422061ab8dacdc3a6ae47da071450932ed992c79559d922dff7b2574a31a8c94feccd3761c1dffb6422c50055e6dca8e3cf94a169bc95e39e959
2018-01-10 20:55:41 -10:00
Pieter Wuille b224a47a1a Add address_types test
Improvements and cleanups by John Newbery
2018-01-09 15:35:31 -08:00
Pieter Wuille 940a21932b SegWit wallet support
This introduces two command line flags (-addresstype and -changetype) which control
the type of addresses/outputs created by the GUI and RPCs. Certain RPCs allow
overriding these (`getnewaddress` and `getrawchangeaddress`). Supported types
are "legacy" (P2PKH and P2SH-multisig), "p2sh-segwit" (P2SH-P2WPKH and P2SH-P2WSH-multisig),
and "bech32" (P2WPKH and P2WSH-multisig).

A few utility functions are added to the wallet to construct different address type
and to add the necessary entries to the wallet file to be compatible with earlier
versions (see `CWallet::LearnRelatedScripts`, `GetDestinationForKey`,
`GetAllDestinationsForKey`, `CWallet::AddAndGetDestinationForScript`).
2018-01-09 15:35:31 -08:00
Russell Yanofsky a14dbff39e Allow multiwallet.py to be used with --usecli
Add test coverage for bitcoin-cli multiwallet calls.
2018-01-08 17:35:27 -05:00
Wladimir J. van der Laan 5961b23898
Merge #12062: Increment MIT Licence copyright header year on files modified in 2017
595a7ba Increment MIT Licence copyright header year on files modified in 2017 (Akira Takizawa)

Pull request description:

  Edited via:

  $ contrib/devtools/copyright_header.py update .

  ps) It is the same commit as #9450

Tree-SHA512: 274bfcd6cf2914315ed52f6db773a68800ce9d6bd225a3142654483f0bbc3fd865009e62f9d954f65765d038c626e55d2a64e37e16843809adc2f67abe659b6d
2018-01-03 14:33:28 +01:00
Akira Takizawa 595a7bab23 Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
MarcoFalke fadf60e381 qa: Note on test order in test_runner 2017-12-21 08:56:40 -05:00
MeshCollider be9a13c8a0 Add configuration/argument testing 2017-12-20 12:23:12 +13:00
Anthony Towns 9b20bb40fb [tests] Check tests conform to naming convention
Extra-Author: John Newbery <john@johnnewbery.com>
2017-12-08 01:50:02 +10:00
Jonas Schnelli e054d0e532
[QA] Add node_network_limited test 2017-12-06 21:13:48 -10:00
Wladimir J. van der Laan 24df9af816
Merge #11781: Add -debuglogfile option
5a7c09a test: Add tests for `-debuglogfile` with subdirs (Anthony Towns)
4158734 doc: Update release notes for `-debuglogfile` (Wladimir J. van der Laan)
2323242 test: Add test for `-debuglogfile` (Wladimir J. van der Laan)
cf5f432 Add `-debuglogfile` option (Wladimir J. van der Laan)

Pull request description:

  This patch adds an option to configure the name and/or directory of the debug log file.

  The user can specify either a relative path, in which case the path is relative to the (network specific) data directory. They can also specify an absolute path to put the log anywhere else in the file system.

  Alternative to #11741 that gets rid of the concept of a "log directory" by specifying the path for the specific kind of log, the debug log. Which happens to be the only kind of log we have at this point*, but a hypothetical new kind of log (say, an audit log) would get a new option. This has more flexibility than specifying a directory which has to contain all of them.

  \* excluding `db.log` which is internally generated by the wallet database library, but that one moves along with `-walletdir`.

Tree-SHA512: 4434d0e598dc23504e5c9e67fdbaef56db4f0fd490f9f54fd503e69d4dda9b5b69c539e1794ed841e72161b7b1dc3374d2f1193dd431b057566750e56fd8f24b
2017-12-04 18:55:17 +01:00
Wladimir J. van der Laan 23232422e5 test: Add test for -debuglogfile 2017-12-01 11:28:13 +01:00
John Newbery ff8a9b068a [tests] Add combinedlogslen argument to test_runner.py
Instead of calling combine_logs from test_runner when the environment variable
PYTHON_DEBUG is set, add a combinedlogslen argument. This makes it easier
to call when running locally, and allows a different length of combined logs
to be printed.
2017-11-29 15:10:51 -05:00
John Newbery dba94ead0c [tests] [travis-ci] Move Travis functional test log post processing to test_runner 2017-11-29 15:10:05 -05:00
MeshCollider c1e5d40e16 Make debugging test crash easier 2017-11-18 00:51:00 +13:00
Matt Corallo f3d4adfa6f Make p2p-acceptablock not an extended test 2017-10-31 13:51:34 -04:00
Wladimir J. van der Laan 2ca518deff
Merge #11486: [tests] Add uacomment tests
c5dfa90 [tests] Add uacomment tests (Cristian Mircea Messel)

Pull request description:

  Checks for setting the value, max length and reserved characters

Tree-SHA512: a62e2cf8e455a3cd3987c0855f7bfc49de47504c01263e3573366e3cbff400c5678224773d4f1e4ac684fff34d987994e490a0978c4da05ff2a4bfa972c84723
2017-10-18 15:49:37 +02:00
John Newbery f893085325 [tests] Don't subclass from object for Python 3 2017-10-16 21:46:23 -04:00
Cristian Mircea Messel c5dfa90aab [tests] Add uacomment tests
Checks for setting the value, max length and reserved characters
2017-10-11 23:19:16 +03:00
Wladimir J. van der Laan 364da2c529
Merge #10941: Add blocknotify and walletnotify functional tests
857b32b [tests] Add -walletnotify functional test (João Barbosa)
df18d29 [tests] Add -blocknotify functional test (João Barbosa)
9c72a46 [tests] Tidy up forknotify.py (John Newbery)

Pull request description:

  This patch adds the missing functional tests for `-blocknotify` and `-walletnotify` notifications. The `-alertnotify` test file `forknotify.py` is renamed to `notifications.py` to accommodate the new tests. Credits to @jnewbery for this cleanup and unification.

Tree-SHA512: ee7b28b9f1bd225587efaefa6427c6d080ccb50ead390b23d94717c137a317183b37be00da0b2bffedd4192a363c971dea510d78d29278eb9fa76374f7855c09
2017-10-11 11:26:10 +02:00
João Barbosa df18d29a02 [tests] Add -blocknotify functional test 2017-10-10 23:46:04 +01:00
Jim Posen eff4bd8ab2 [test] P2P functional test for certain fingerprinting protections 2017-10-03 10:28:00 -07:00
Cristian Mircea Messel 048e0c3e26 [rpc] [tests] Add deprecated RPC test 2017-09-26 12:17:41 -04:00
Suhas Daftuar eac64bb7a3 [qa] Test nMinimumChainWork
Nodes don't consider themselves out of "initial block download" until
their active chain has more work than nMinimumChainWork.

While in initial block download, nodes won't relay blocks to their
peers, so test that this parameter functions as intended by verifying
that block relay only succeeds past a given node once its
nMinimumChainWork has been exceeded.
2017-09-05 15:09:21 -04:00
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
MarcoFalke 6366941275
Merge #10680: Fix inconsistencies and grammar in various files
1d8df0141 Fix MD formatting in REST-interface.md and spelling mistake in test_runner.py (MeshCollider)
41f3e84aa Fix inconsistencies and grammar in various files (MeshCollider)

Pull request description:

  Just a simple fix of some inconsistent capitalization, formatting and grammar in a few files (no code changes)

Tree-SHA512: 60b12a5a5c69a1af4a25b7db0b32ed806ed62ad2966cee08b3792a7cfa7f51848fd485349b4c09e60a7eedfdf55ee730c51daa066d6e226ae404c93342bf3e13
2017-08-16 00:46:40 +02:00
MarcoFalke d7be7b39fa
Merge #10705: Trivial: spelling fixes
f42fc1d50 doc: spelling fixes (klemens)

Pull request description:

  patch contains some spelling fixes ( just in comments ) as found by a bot ( http://www.misfix.org, https://github.com/ka7/misspell_fixer ).

Tree-SHA512: ba6046cfcd81b0783420daae7d776be92dd7b85a593e212f8f1b4403aca9b1b6af12cef7080d4ea5ed4a14952fd25e4300109a59c414e08f5395cdb9947bb750
2017-08-16 00:30:12 +02:00
klemens f42fc1d508 doc: spelling fixes 2017-08-16 00:24:39 +02:00
John Newbery c6ec4358a7 [tests] Add bitcoin_cli.py test script 2017-08-15 17:52:56 -04:00
John Newbery b23549f6e6 [tests] add TestNodeCLI class for calling bitcoin-cli for a node 2017-08-15 17:52:51 -04:00
Wladimir J. van der Laan 653a46dd91
Merge #11022: Basic keypool topup
d34957e [wallet] [tests] Add keypool topup functional test (Jonas Schnelli)
095142d [wallet] keypool mark-used and topup (John Newbery)
c25d90f [wallet] Add HasUnusedKeys() helper (John Newbery)
f2123e3 [wallet] Cache keyid -> keypool id mappings (John Newbery)
83f1ec3 [wallet] Don't hold cs_LastBlockFile while calling setBestChain (John Newbery)
2376bfc [wallet] [moveonly] Move LoadKeyPool to cpp (Matt Corallo)
cab8557 [wallet] [moveonly] Move CAffectedKeysVisitor (Jonas Schnelli)

Pull request description:

  This PR contains the first part of #10882 :

  - if a key from the keypool is used, mark all keys up to that key as used, and then try to top up the keypool
  - top up the keypool on startup

  Notably, it does not stop the node or prevent the best block from advancing if the keypool drops below a threshold (which means that transactions may be missed and funds lost if restoring from an old HD wallet backup).

Tree-SHA512: ac681fefeaf7ec2aab2fa1da93d12273ea80bd05eb48d7b3b551ea6e5d975dd97ba7de52b7fba52993823280ac4079cc36cf78a27dac708107ebf8fb6326142b
2017-08-14 16:08:44 +02:00
João Barbosa bdf607e438 test: Add resendwallettransactions functional tests 2017-08-12 04:42:45 +01:00
Jonas Schnelli d34957e17e [wallet] [tests] Add keypool topup functional test 2017-08-10 13:50:16 -04:00
MarcoFalke 929fd7276c
Merge #10695: [qa] Rewrite BIP65/BIP66 functional tests
4ccc12a54 [qa] Rewrite BIP66 functional tests (Suhas Daftuar)
d4f0d87b6 [qa] Rewrite BIP65 functional tests (Suhas Daftuar)

Pull request description:

  After 122786d0e0, BIP65 and BIP66 activate at
  particular fixed heights (without regard to version numbers of blocks
  below those heights).  Rewrite the functional tests to take
  this into account, and remove two tests that weren't really testing anything.

  Moves the rewritten functional tests out of the extended test suite, so that they run in travis regularly.

  Note: I discovered that the ComparisonTestFramework (which the original versions of these p2p tests were written is, has a bug that caused them to not catch obvious errors, eg if you just comment out setting the script flags for these softforks in ConnectBlock, the versions of these tests in master do not fail(!) -- will separately PR a fix for the comparison test framework).

Tree-SHA512: 2108b79951f2e980854d0d14ccc0fd1810a43dd4251fd6e3b203e7f104ea55e00650bb1a60a28c2801b4249f46563a8559ac3e3cd39db220914acfed0b3b163d
2017-08-08 23:04:03 +02:00
Wladimir J. van der Laan 60f9778abf
Revert "[tests] Allow tests to pass when stderr is non-empty"
This reverts commit d64ac3f4aa after further discussion.

Tree-SHA512: db1e4ff5b17bcd6fd000a3d21aa74f6b7e4c194e0663c1896a100612671910a7cdadd896b59642420ea016598895b54a8468914847ebefef105a3c47c311d4b2
2017-07-25 21:42:36 +02:00
MarcoFalke f1f1605c22
Merge #10703: [tests] Allow tests to pass when stderr is non-empty
d64ac3f [tests] Allow tests to pass when stderr is non-empty (Jonas Schnelli)

Pull request description:

  Resurrect #10241 with nits addressed

  Not sure how much people want this. Would be useful for functional tests which cause bitcoind to print to stderr.

Tree-SHA512: 28caccf7818fb3ed5a38caef7f77161b1678aa9b8fd12c2d1e76032f409f0d33c40f7ac91e0c8d908df4a44fd01cf97d657a08bae50c6ff17d07f5b2e20c3a6e
2017-07-25 21:21:09 +02:00
Jonas Schnelli 44eb9d406a
[QA] Avoid running multiwallet.py twice 2017-07-21 15:59:06 +02:00
John Newbery 3707fcd94e [wallet] [tests] Add listwallets to multiwallet test 2017-07-20 17:06:29 -04:00
Jonas Schnelli 6b9faf7470
[QA] add basic multiwallet test 2017-07-17 17:42:22 +02:00
Wladimir J. van der Laan e4f226a133
Merge #10190: [tests] mining functional tests (including regression test for submitblock)
11ba8e9 [tests] rename getblocktemplate_proposals.py to mining.py (John Newbery)
b29dd41 [tests] add test for submit block (John Newbery)
9bf0d80 [tests] run successful test in getblocktemplate first (John Newbery)
82dc597 [tests] don't build blocks manually in getblocktemplate test (John Newbery)
f82c709 [tests] clarify assertions in getblocktemplate test (John Newbery)
66c570a [tests] Don't build the coinbase manually in getblocktemplate test (John Newbery)
38b38cd [tests] getblocktemplate_proposals.py: add logging (John Newbery)
0a3a5ff [tests] Fix flake8 warnings in getblocktemplate tests (John Newbery)
32cffe6 [tests] Fix import order in getblocktemplate test (John Newbery)

Tree-SHA512: a51a57314fa1c4c4b8a7896492ec6e677b6bed12387060def34a62e9dfbee7961f71bb5553fbd70028be61ae32eccf13fd255fa9651f908e9a5e64c28f43f00e
2017-07-11 15:21:26 +02:00
Suhas Daftuar 4ccc12a54a [qa] Rewrite BIP66 functional tests
Rewrite the BIP66 functional tests to reflect height-based activation,
and move it out of the extended test suite.

Remove the unnecessary bipdersig.py test
2017-07-06 10:09:54 -04:00
MeshCollider 1d8df01412 Fix MD formatting in REST-interface.md and spelling mistake in
test_runner.py
2017-07-01 20:29:00 +12:00
Suhas Daftuar d4f0d87b6f [qa] Rewrite BIP65 functional tests
After 122786d0e0, BIP65 activates at
a particular height (without regard to version numbers of blocks
below that height).  Rewrite the BIP65 functional tests to take
this into account, and add a test case that exercises
OP_CHECKLOCKTIMEVERIFY in a block where the soft-fork is active.

Also moves the bip65 functional test out of the extended test suite.
2017-06-30 09:04:36 -04:00
Jonas Schnelli d64ac3f4aa [tests] Allow tests to pass when stderr is non-empty
Tests which pass with non-empty stderr are reported as "passed with
warnings"
2017-06-29 14:32:30 +01:00
Wladimir J. van der Laan d4e551adfe
Merge #10148: Use non-atomic flushing with block replay
176c021 [qa] Test non-atomic chainstate writes (Suhas Daftuar)
d6af06d Dont create pcoinsTip until after ReplayBlocks. (Matt Corallo)
eaca1b7 Random db flush crash simulator (Pieter Wuille)
0580ee0 Adapt memory usage estimation for flushing (Pieter Wuille)
013a56a Non-atomic flushing using the blockchain as replay journal (Pieter Wuille)
b3a279c [MOVEONLY] Move LastCommonAncestor to chain (Pieter Wuille)

Tree-SHA512: 47ccc62303f9075c44d2a914be75bd6969ff881a857a2ff1227f05ec7def6f4c71c46680c5a28cb150c814999526797dc05cf2701fde1369c06169f46eccddee
2017-06-28 18:26:41 +02:00
John Newbery 11ba8e9cdd [tests] rename getblocktemplate_proposals.py to mining.py 2017-06-27 16:02:18 +01:00
Wladimir J. van der Laan 7c87a9c748
Merge #10612: The young person's guide to the test_framework
e7ba6c1 [tests] add example test (John Newbery)
76859e6 [tests] Update functional tests documentation (John Newbery)

Tree-SHA512: 74eb464e965e16466f95b9eda7d1e89a31ef1ef204dd30e1b11ddf482336f12f33fa5ca3cc733b6eaf440c46401e663585af9caca202deddb440bbadce964a62
2017-06-27 12:07:21 +02:00
John Newbery e7ba6c16b3 [tests] add example test 2017-06-27 05:04:52 -04:00
Suhas Daftuar 176c021d08 [qa] Test non-atomic chainstate writes
Adds new functional test, dbcrash.py, which uses -dbcrashratio to exercise the
logic for recovering from a crash during chainstate flush.

dbcrash.py is added to the extended tests, as it may take ~10 minutes to run

Use _Exit() instead of exit() for crash simulation

This eliminates stderr output such as:
    terminate called without an active exception
or
    Assertion failed: (!pthread_mutex_destroy(&m)), function ~recursive_mutex, file /usr/local/include/boost/thread/pthread/recursive_mutex.hpp, line 104.

Eliminating the stderr output on crash simulation allows testing with
test_runner.py, which reports a test as failed if stderr is produced.
2017-06-26 14:48:42 -07:00
Ricardo Velhote c07475294a
[RPC] Add an uptime command that displays the amount of time that bitcoind has been running 2017-06-25 20:25:45 +01:00
MarcoFalke 643fa0b22d
Merge #10555: [tests] various improvements to zmq_test.py
0a4912e [tests] timeout integration tests on travis after 20 minutes (John Newbery)
7c51e9f [tests] destroy zmq context in zmq_tests.py (John Newbery)
b1bac1c [tests] in zmq test, timeout if message not received (John Newbery)
5ebd5f9 [tests] tidy up zmq_test.py (John Newbery)
4a0c08f [tests] update zmq test to use correct config.ini file (John Newbery)

Tree-SHA512: 5e607af2f2dc5c73fba4b2d3890097580a7525f6a4996c7c78f01822e45e0054fd0a225ea53fce6308804e560cced6de6cf5d16137469dcf100b2e9643e08d03
2017-06-18 14:14:25 +02:00
John Newbery 0a4912e46a [tests] timeout integration tests on travis after 20 minutes 2017-06-12 09:17:18 -04:00
John Newbery 5ebd5f9e15 [tests] tidy up zmq_test.py 2017-06-08 15:18:32 -04:00
Andrew Chow ec98b78e1e Tests for wallet encryption stuff
Added a functional test which tests the encryptwallet, walletpassphrase, walletpassphrasechange, and walletlock RPCs
2017-06-08 11:07:11 -07:00
MarcoFalke 75e898c094
Merge #10331: Share config between util and functional tests
8ad5bde Merge bctest.py into bitcoin-util-test.py (John Newbery)
95836c5 Use shared config file for functional and util tests (John Newbery)
89fcd35 Use an .ini config file for environment vars in bitcoin-util-test.py (John Newbery)
e9265df Change help_text in bitcoin-util-test.py to a docstring. (John Newbery)
ce58e93 Change bitcoin-util-test.py to use Python3 (John Newbery)

Tree-SHA512: 66dab0b4a8546aee0dfaef134a165f1447aff4c0ec335754bbc7d9e55909721c62f09cdbf4b22d02ac1fcd5a9b66780f91e1cc4d8687fae7288cc9072a23a78f
2017-06-06 23:55:24 +02:00
MarcoFalke 8e5725666b
Merge #10433: [tests] improve tmpdir structure
b040243 [tests] improve tmpdir structure (John Newbery)

Tree-SHA512: b21ad555c3c23a43087b893ad18bd2398e1df91b82c0bf1804d07fdb582600a1c339e6f4aaca58074e52f146f459943a0e492abc045b2666d4a3a7e0e455d6dd
2017-05-22 08:59:48 +02:00
John Newbery b040243cc3 [tests] improve tmpdir structure 2017-05-18 18:11:32 -04:00
MarcoFalke fac79e4d18 qa: Warn when specified test is not found 2017-05-14 12:39:02 +02:00
John Newbery 95836c5eba Use shared config file for functional and util tests
The functional tests and util tests both require a config file that is
generated by ./configure. This commit merges those two config
files into a single configuration file that can be shared by both tests.

The config from config.ini is put into a Namespace object to maintain
the interface with bctest.py. A future commit could change this
interface to use a dictionary instead of a namespace.
2017-05-03 14:18:30 -04:00
Wladimir J. van der Laan 35da2aeed7
Merge #10327: [tests] remove import-abort-rescan.py
981e586 [tests] remove import-abort-rescan.py (John Newbery)

Tree-SHA512: 8658d42b5ecdefbb71c55849036ee4e8e113abbc9c549730524009fb6eacc50340ffb7ef99fb35809d4abd6b304d491a618e45ff6ded1990f01f18cbcebf2b12
2017-05-03 15:42:58 +02:00
John Newbery 981e586ab8 [tests] remove import-abort-rescan.py
Reverts PR 10225
2017-05-03 09:16:42 -04:00
Wladimir J. van der Laan 2a183de0ec
Merge #9966: Control mempool persistence using a command line parameter
a750d77 Add tests for mempool persistence (John Newbery)
91c91e1 Control mempool persistence using a command line parameter. (John Newbery)

Tree-SHA512: 157d01cefd1903b8bfc5cbab42a3cc5e9c1094179bf4b64b3d34c0d4d9b976d593755bfea5c41c631cb758e1de17c6c2058c130d487d20560b7c0bafcddfa520
2017-05-03 11:03:48 +02:00
John Newbery b8251f6337 [tests] allow zmq test to be run in out-of-tree builds 2017-05-01 15:12:49 -04:00
Wladimir J. van der Laan e0a7e1994e
Merge #10225: [test] Add aborttrescan tests
ed60970 [test] Test abortrescan command. (Karl-Johan Alm)

Tree-SHA512: 7f617adba65a6df8fdc4b01432992926a06c4a05da4e657653436f7716301fa5d6249d77894a097737e7fb9e118925883f2425c639058b8973680339bb8e61b6
2017-04-25 16:10:50 +02:00
MarcoFalke 1b25b6df0f
Merge #10097: Move zmq test skipping logic into individual test case.
6803e09 Move zmq test skipping logic into individual test case. (John Newbery)

Tree-SHA512: 9d166b53e9acf386c4dafc860b38e2901b331a7505bba9714a2f4e3bdef68b0316c8b76fddbfb620835ddee549cf32fffb3a96a19b0799ad94f2553f55f19a35
2017-04-23 17:54:06 +02:00
MarcoFalke c530c15180
Merge #10023: [tests] remove maxblocksinflight.py (functionality covered by other test)
5f4bcf2 [tests] Remove maxblocksinflight testcase (John Newbery)

Tree-SHA512: 827c8b12f4b52684a973bbfc508c5906e640572e22a96b9420a7aea86ad8d4aa4d6fcc2bb091f747e2fdd18c897e0456baff254bd5e3ceaf721bd3f09a2fd60b
2017-04-23 17:43:08 +02:00
Karl-Johan Alm ed60970c83
[test] Test abortrescan command. 2017-04-21 12:51:50 +09:00
John Newbery 6803e09e6e Move zmq test skipping logic into individual test case.
This commit uses the new skip test funcationality added in
232b6665bc to skip the zmq tests if the
python zmq module is not available or if bitcoind has been built without
zmq support.

This removes the zmq-specific logic from test_runner.py. In general it's
better if test_runner.py has no knowledge of special cases for
individual tests and is a general purpose test runner.
2017-04-20 11:25:33 -04:00
Wladimir J. van der Laan a987def4f6
Merge #10143: [net] Allow disconnectnode RPC to be called with node id
d54297f [tests] disconnect_ban: add tests for disconnect-by-nodeid (John Newbery)
5cc3ee2 [tests] disconnect_ban: remove dependency on urllib (John Newbery)
12de2f2 [tests] disconnect_ban: use wait_until instead of sleep (John Newbery)
2077fda [tests] disconnect_ban: add logging (John Newbery)
395561b [tests] disconnectban test - only use two nodes (John Newbery)
e367ad5 [tests] rename nodehandling to disconnectban (John Newbery)
d6564a2 [tests] fix nodehandling.py flake8 warnings (John Newbery)
23e6e64 Allow disconnectnode() to be called with node id (John Newbery)

Tree-SHA512: a371bb05a24a91cdb16a7ac4fbb091d5d3bf6554b29bd69d74522cb7523d3f1c5b1989d5e7b03f3fc7369fb727098dd2a549de551b731dd480c121d9517d3576
2017-04-20 11:47:22 +02:00
John Newbery e367ad5b44 [tests] rename nodehandling to disconnectban 2017-04-19 13:47:56 -04:00
MarcoFalke 9111df9673
Merge #10219: Tests: Order Python Tests Differently
637706d Tests: Put Extended tests first when they're included (Jimmy Song)

Tree-SHA512: 0a720b2443b3e65f4ad548ecdf822468460fc4f4ecf32385dd79511a01c9ea4c94f0bf765ca593705b19baee1bae254dfcc3952da64b9c51d75b7da7abcdcd28
2017-04-18 09:26:43 +02:00
Jimmy Song 637706dc9e Tests: Put Extended tests first when they're included
* Added documentation in tests/README.md about enabling wallet, utils and daemon.
* Change ordering to make the long-running EXTENDED_TESTS go first.
2017-04-17 15:20:35 -07:00
MarcoFalke d86bb075bf
Merge #10197: [tests] Functional test warnings
08e51c1 [tests] Remove cache directory by default when running test_runner (John Newbery)
c85b080 [test] add warnings to test_runner (John Newbery)

Tree-SHA512: 537a8a258e410102708d1e02893f3f45abe7a3a3290536249381a7dc55d74ca78322804bf34178dec1461ec1c29d8f8358c5901ddd1633f8b301b95bcbb6ce6d
2017-04-17 22:17:22 +02:00
John Newbery a97ed80f97 [tests] test_runner - check unicode 2017-04-17 14:16:43 -04:00
John Newbery 08e51c1c03 [tests] Remove cache directory by default when running test_runner 2017-04-17 10:31:55 -04:00
John Newbery c85b080cc7 [test] add warnings to test_runner 2017-04-17 10:31:55 -04:00
John Newbery 5f4bcf28ef [tests] Remove maxblocksinflight testcase
maxblocksinflight tested that a node would not send get_data messages
for more than 16 new blocks at the same time. bitcoin core no longer
responds to block invs with get_data, since it does headers-first
sync'ing. This test was therefore testing nothing and can be removed.

the sendheaders test script tests that bitcoin will not send get_headers
for more than 16 blocks simultaneously.
2017-04-13 11:48:02 -04:00
Wladimir J. van der Laan e96462fbec tests: Fix test_runner return value in case of skipped test
Currently test_runner reports an error if a test case is skipped.
This is not how it should be, only failed tests should cause it to fail.
2017-04-11 19:49:34 +02:00
John Newbery d80baaa514 fixup - align summary row correctly and make colors/glyphs globals 2017-04-07 09:15:29 -04:00
John Newbery bb92d839d5 [tests] Add unicode symbols for tests passing/failing/skipping 2017-04-06 13:31:47 -04:00
John Newbery 63062bda1a [tests] color test results and sort alphabetically 2017-04-05 18:36:37 -04:00
Wladimir J. van der Laan ebfd653798
Merge #10077: [qa] Add setnetworkactive smoke test
fa697b7 [qa] Add setnetworkactive smoke test (MarcoFalke)

Tree-SHA512: 7205bae16f551e93383987392702e6853cfb06d4448735815fa116385cbf5deb6c4a8f521efdd43cf3cc59fede3b3d1ffe74e662890b74bcc21b5c13ce1f20b7
2017-04-02 15:39:26 +02:00
MarcoFalke 79af9fbd8c
Merge #10096: Check that all test scripts in test/functional are being run
29d6634 Check that all test scripts in test/functional are being run (John Newbery)

Tree-SHA512: 9231d3a119632be031c51c4f7e95a8adae58489a8ec36fc967d499c0708bae2941a3bf28f11dcd4efd59141eb54c3c920f2629f5cd8a0139d30397a19591666d
2017-03-28 11:36:42 +02:00
John Newbery 55992f1302 Add --quiet option to suppress rpc-tests.py output
rpt-tests.py outputs progress information as it runs tests. This commit
adds a --quiet option that suppresses that progress output and only
prints a summary of results (and logs from failed tests).
2017-03-27 11:55:48 -04:00
John Newbery 29d6634a69 Check that all test scripts in test/functional are being run
This commit checks that all of the python files in the test/functional
directory are listed in test_runner.py.
2017-03-27 11:33:00 -04:00
Wladimir J. van der Laan b1a4f27576
Merge #10073: Actually run assumevalid.py
717ad13 Actually run assumevalid.py. (John Newbery)

Tree-SHA512: 6fd55789be43e26347f8f5456194aa5e7beeeba3db85411dc75581b98059ca3a85485494fca36848f21c0f48096004906a0409fd76309951b5f977bab9f45b91
2017-03-27 09:50:42 +02:00
MarcoFalke fa697b7192 [qa] Add setnetworkactive smoke test 2017-03-25 15:33:01 +01:00
Wladimir J. van der Laan 90dd9e6c4c
Merge #9946: Fix build errors if spaces in path or parent directory
b1f584d fix build if spaces in src dir path (Matthew Zipkin)

Tree-SHA512: 5834690c1f63b85ed04bb8ed411a94da04738534364d58bd9ee333ccff7129b2bbb710f31598c40123199e023da02c1745514294af3efdbb2c2e4c1320aded35
2017-03-25 12:15:06 +01:00
Matthew Zipkin b1f584dbc1 fix build if spaces in src dir path 2017-03-24 18:22:34 -07:00
John Newbery 717ad131f6 Actually run assumevalid.py.
assumevalid was merged as part of PR 9484, but was not added to the
test_runner, so is not run even as part of the extended tests.

This commit adds assumevalid to the list of tests in test_runner. It
also clarifies the code in assumevalid considerably.
2017-03-24 18:23:36 -04:00
John Newbery 0c1ade6a4b Skip rpcbind_test if OS/network requirements are not met. 2017-03-24 00:05:30 -04:00