aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/util.py
AgeCommit message (Collapse)Author
2017-02-23qa: Check return code when stopping nodesMarcoFalke
This includes work by jnewbery Github-Pull: #9824 Rebased-From: fa4cd2e998e0ebebe283a6243f7f752123a105ab
2017-02-08Fix RPC failure testingJohn Newbery
Make sure that RPC tests are actually checking failures correctly by: - Catching JSON RPC exceptions and verifying the error codes and messages. - Failing the test case if the JSON RPC exception isn't raised.
2017-01-12Merge #9222: Add 'subtractFeeFromAmount' option to 'fundrawtransaction'.Wladimir J. van der Laan
453bda6 Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. (Chris Moore)
2017-01-05test: Add test for RPC named argumentsWladimir J. van der Laan
Add RPC testcase for RPC named arguments.
2016-12-13Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'.Chris Moore
2016-12-04[qa] pruning: Use cached utxo set to run fasterMarcoFalke
2016-12-02Merge #9221: [qa] Get rid of duplicate codeMarcoFalke
facbfa5 [qa] Get rid of duplicate code (MarcoFalke)
2016-12-02[qa] Get rid of duplicate codeMarcoFalke
2016-11-28Fix some typosfsb4000
2016-11-23Merge #9139: Change sync_blocks to pick smarter maxheight (on top of #9196)MarcoFalke
1126c85 [qa] Change sync_blocks to pick smarter maxheight (Russell Yanofsky)
2016-11-15[qa] add assert_raises_message to check specific error messagemrbandrews
2016-11-14[qa] Avoid 2 list comprehensions in sync_blocksRussell Yanofsky
2016-11-14[qa] Fix sync_blocks timeout argumentRussell Yanofsky
Motivation for this change is mainly to make sync_blocks behavior easier to understand. Behavior is unchanged in the normal case when there are only 2 nodes in the rpc_connections set. When there are more than 2 nodes, the previous "timeout -= wait" statement wouldn't take into account time spent waiting for all nodes and as a result could lead to blocking for longer than the requested timeout.
2016-11-14[qa] Improve sync_blocks error messages.Russell Yanofsky
2016-11-11[qa] Change sync_blocks to pick smarter maxheightRussell Yanofsky
Instead of syncing to max height returned by the waitforblockheight RPC, sync to the max height returned by the getblockcount RPC. This change was suggested by Suhas Daftuar <sdaftuar@chaincode.com>.
2016-11-07[qa] util: Rework sync_*()MarcoFalke
* Only allow named args in sync_*() * Make sync_* fails more verbose * Add timeout to sync_chain()
2016-11-07[qa] Increase wallet-dump RPC timeoutRussell Yanofsky
Increase wallet-dump RPC timeout from 30 seconds to 1 minute. This avoids a timeout error that seemed to happen regularly (around 50% of builds) on a particular jenkins server during the first getnewaddress RPC call made by the test. The failing stack trace looked like: Unexpected exception caught during testing: timeout('timed out',) File ".../bitcoin/qa/rpc-tests/test_framework/test_framework.py", line 146, in main self.run_test() File ".../bitcoin/qa/rpc-tests/wallet-dump.py", line 73, in run_test addr = self.nodes[0].getnewaddress() File ".../bitcoin/qa/rpc-tests/test_framework/coverage.py", line 49, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 145, in __call__ response = self._request('POST', self.__url.path, postdata.encode('utf-8')) File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 121, in _request return self._get_response() File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 160, in _get_response http_response = self.__conn.getresponse() File "/usr/lib/python3.4/http/client.py", line 1171, in getresponse response.begin() File "/usr/lib/python3.4/http/client.py", line 351, in begin version, status, reason = self._read_status() File "/usr/lib/python3.4/http/client.py", line 313, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.4/socket.py", line 374, in readinto return self._sock.recv_into(b)
2016-10-18Merge #6996: Add preciousblock RPCWladimir J. van der Laan
5805ac8 Add preciousblock tests (Pieter Wuille) 5127c4f Add preciousblock RPC (Pieter Wuille)
2016-10-02[qa] util: Move wait_bitcoinds() into stop_nodes()MarcoFalke
2016-09-29test: Explicitly set encoding to utf8 when opening text filesWladimir J. van der Laan
These are text files but their encoding does not depend on the locale. Not all of them require utf8 but it is better to fix it at something to remove potential unpredictability. This is necessary on FreeBSD where no locale is set by default, and apparently Python defaults not only the terminal encoding to the locale but that of every text file. So without LOCALE environment it defaults text file encoding to ASCII. This causes problems with e.g. `bitcoin.conf`. Luckily the locale doesn't affect the default encoding for str.encode() and bytes.decode() on Python 3, so this is the only change necessary.
2016-09-07add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for testsCory Fields
waitfornewblock waits until a new block is received, or the timeout expires, then returns the current block height/hash. waitforblock waits for a specific blockhash, or until the timeout expires, then returns the current block height/hash. If the target blockhash is the current tip, it will return immediately. waitforblockheight waits until the tip has reached a certain height or higher, then returns the current height and hash. waitforblockheight is used to avoid polling in the rpc tests.
2016-08-26Add preciousblock testsPieter Wuille
Rebased, improved and extended by Luke-Jr.
2016-08-18Revert "[qa] Adjust timeouts for micro-optimization of run time"Wladimir J. van der Laan
This reverts commit fa2d68f79c459b505652728c3d8da60679f98ae3. Temporary revert - see discussion in #8532.
2016-08-17Merge #8482: [qa] Use single cache dir for chainsWladimir J. van der Laan
fad8cf6 [qa] Use single cache dir for chains (MarcoFalke) fa2d68f [qa] Adjust timeouts for micro-optimization of run time (MarcoFalke) fae596f [qa] Sort scripts by time for pull_tester and don't overwrite setup_chain (MarcoFalke)
2016-08-07[qa] Use single cache dir for chainsMarcoFalke
2016-08-07[qa] Adjust timeouts for micro-optimization of run timeMarcoFalke
2016-07-25[qa]: add parsing for '<host>:<port>' argument form to rpc_url()whythat
2016-06-20Merge #8066: [qa] test_framework: Use different rpc_auth_pair for each nodeWladimir J. van der Laan
fad1845 [qa] test_framework: Use different rpc_auth_pair for each node (MarcoFalke)
2016-06-13[qa] util: Move check_fee_amount out of wallet.pyMarcoFalke
2016-05-26Tests: add timeout to sync_blocks() and sync_mempools()Suhas Daftuar
Previously these functions would infinitely loop if sync failed; now they have a default timeout of 60 seconds, after which an AssertionError is raised. sync_blocks() has also been improved and now compares the tip hash of each node, rather than just using block count.
2016-05-20Merge #8047: [qa] test_framework: Set wait-timeout for bitcoind procsMarcoFalke
fab5233 [qa] test_framework: Set wait-timeout for bitcoind procs (MarcoFalke)
2016-05-17[qa] test_framework: Use different rpc_auth_pair for each nodeMarcoFalke
2016-05-15[qa] Remove hardcoded "4 nodes" from test_frameworkMarcoFalke
2016-05-12[qa] test_framework: Set wait-timeout for bitcoind procsMarcoFalke
2016-05-09[qa] Add option --portseed to test_frameworkMarcoFalke
2016-05-06[qa] Stop other nodes, even when one fails to stopMarcoFalke
2016-05-06[qa] Refactor test_framework and pull testerMarcoFalke
* log to stdout * increase range for p2p and rpc ports * UPPERCASE_CONSTANTS * Stop nodes on CTRL+C
2016-05-05[qa] Switch to py3MarcoFalke
2016-04-26[qa] test_framework: Properly print exceptions and assert empty dictMarcoFalke
2016-04-19Move method to check matches within arrays on util.pyJoao Fonseca
2016-04-14Merge #7853: [qa] py2: Unfiddle strings into bytes explicitlyWladimir J. van der Laan
faa41ee [qa] py2: Unfiddle strings into bytes explicitly (MarcoFalke)
2016-04-13getblockchaininfo: make bip9_softforks an object, not an array.Rusty Russell
We can't change "softforks", but it seems far more logical to use tags in an object rather than using an "id" field in an array. For example, to get the csv status before, you need to iterate the array to find the entry with 'id' field equal to "csv": jq '.bip9_softforks | map(select(.id == "csv"))[] | .status' Now: jq '.bip9_softforks.csv.status' There is no issue with fork names being incompatible with JSON tags, since we're selecting them ourselves. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-10[qa] py2: Unfiddle strings into bytes explicitlyMarcoFalke
2016-04-07Tests: move get_bip9_status to util.pySuhas Daftuar
2016-03-26test_framework: detect failure of bitcoind startupWladimir J. van der Laan
Replace the `bitcoin-cli -rpcwait` after spawning bitcoind with our own loop that detects when bitcoind exits prematurely. And if one node fails to start, stop the others. This prevents a hang in such a case (see #7463).
2016-03-16Tests: make prioritise_transaction.py more robustSuhas Daftuar
2016-03-14[qa] Move create_tx() to util.pyMarcoFalke
2016-01-20[qa] Change default block priority size to 0MarcoFalke
2016-01-19Merge pull request #7164: Do not download transactions during initial ↵Wladimir J. van der Laan
blockchain sync 39a525c Do not download transactions during inital sync (ptschip)
2016-01-18Merge pull request #7194Wladimir J. van der Laan
135d6ec Add RPC tests for getblockheader. (James O'Beirne) 4745636 Add RPC documentation for getblockheader[chainwork]. (James O'Beirne) 16d4fce Add assert_is_hex_string and assert_is_hash_string to RPC test utils. (James O'Beirne)