aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/util.py
Commit message (Collapse)AuthorAgeFilesLines
* s/DOGE/DIS/gTomo Ueda2021-09-021-2/+2
|
* s/doge/dis/gTomo Ueda2021-09-021-5/+5
|
* Remove relay-only roundingRoss Nicoll2021-08-171-1/+1
| | | | | Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic.
* Rename binaries to match DogecoinRoss Nicoll2019-03-251-5/+5
|
* Update RPC tests for Dogecoin (#1431)Ross Nicoll2018-09-191-10/+14
| | | | | | | | | * Make most of the RPC tests pass * Add AUXPoW rpc tests - Tests the auxpow rpc interface `getauxblock` - Tests consensus constraints for auxpow: - Minimum block height - Valid scrypt proof of work - Foreign chain ID
* qa: Check return code when stopping nodesMarcoFalke2017-02-231-14/+5
| | | | | | | This includes work by jnewbery Github-Pull: #9824 Rebased-From: fa4cd2e998e0ebebe283a6243f7f752123a105ab
* Fix RPC failure testingJohn Newbery2017-02-081-3/+20
| | | | | | | 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.
* Merge #9222: Add 'subtractFeeFromAmount' option to 'fundrawtransaction'.Wladimir J. van der Laan2017-01-121-3/+7
|\ | | | | | | 453bda6 Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. (Chris Moore)
| * Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'.Chris Moore2016-12-131-3/+7
| |
* | test: Add test for RPC named argumentsWladimir J. van der Laan2017-01-051-0/+12
|/ | | | Add RPC testcase for RPC named arguments.
* [qa] pruning: Use cached utxo set to run fasterMarcoFalke2016-12-041-5/+9
|
* Merge #9221: [qa] Get rid of duplicate codeMarcoFalke2016-12-021-5/+13
|\ | | | | | | facbfa5 [qa] Get rid of duplicate code (MarcoFalke)
| * [qa] Get rid of duplicate codeMarcoFalke2016-12-021-5/+13
| |
* | Fix some typosfsb40002016-11-281-3/+3
|/
* Merge #9139: Change sync_blocks to pick smarter maxheight (on top of #9196)MarcoFalke2016-11-231-6/+8
|\ | | | | | | 1126c85 [qa] Change sync_blocks to pick smarter maxheight (Russell Yanofsky)
| * [qa] Change sync_blocks to pick smarter maxheightRussell Yanofsky2016-11-111-6/+8
| | | | | | | | | | | | | | 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 <[email protected]>.
* | [qa] add assert_raises_message to check specific error messagemrbandrews2016-11-151-2/+6
|/
* [qa] Avoid 2 list comprehensions in sync_blocksRussell Yanofsky2016-11-141-2/+2
|
* [qa] Fix sync_blocks timeout argumentRussell Yanofsky2016-11-141-3/+8
| | | | | | | | | 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.
* [qa] Improve sync_blocks error messages.Russell Yanofsky2016-11-141-2/+4
|
* [qa] util: Rework sync_*()MarcoFalke2016-11-071-15/+17
| | | | | | * Only allow named args in sync_*() * Make sync_* fails more verbose * Add timeout to sync_chain()
* [qa] Increase wallet-dump RPC timeoutRussell Yanofsky2016-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Merge #6996: Add preciousblock RPCWladimir J. van der Laan2016-10-181-0/+10
|\ | | | | | | | | 5805ac8 Add preciousblock tests (Pieter Wuille) 5127c4f Add preciousblock RPC (Pieter Wuille)
| * Add preciousblock testsPieter Wuille2016-08-261-0/+10
| | | | | | | | Rebased, improved and extended by Luke-Jr.
* | [qa] util: Move wait_bitcoinds() into stop_nodes()MarcoFalke2016-10-021-1/+1
| |
* | test: Explicitly set encoding to utf8 when opening text filesWladimir J. van der Laan2016-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for testsCory Fields2016-09-071-2/+6
|/ | | | | | | | | | | | | | 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.
* Revert "[qa] Adjust timeouts for micro-optimization of run time"Wladimir J. van der Laan2016-08-181-2/+2
| | | | | | This reverts commit fa2d68f79c459b505652728c3d8da60679f98ae3. Temporary revert - see discussion in #8532.
* Merge #8482: [qa] Use single cache dir for chainsWladimir J. van der Laan2016-08-171-12/+12
|\ | | | | | | | | | | 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)
| * [qa] Use single cache dir for chainsMarcoFalke2016-08-071-10/+10
| |
| * [qa] Adjust timeouts for micro-optimization of run timeMarcoFalke2016-08-071-2/+2
| |
* | [qa]: add parsing for '<host>:<port>' argument form to rpc_url()whythat2016-07-251-1/+9
|/
* Merge #8066: [qa] test_framework: Use different rpc_auth_pair for each nodeWladimir J. van der Laan2016-06-201-3/+8
|\ | | | | | | fad1845 [qa] test_framework: Use different rpc_auth_pair for each node (MarcoFalke)
| * [qa] test_framework: Use different rpc_auth_pair for each nodeMarcoFalke2016-05-171-3/+8
| |
* | [qa] util: Move check_fee_amount out of wallet.pyMarcoFalke2016-06-131-0/+9
| |
* | Tests: add timeout to sync_blocks() and sync_mempools()Suhas Daftuar2016-05-261-9/+13
| | | | | | | | | | | | | | | | | | 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.
* | Merge #8047: [qa] test_framework: Set wait-timeout for bitcoind procsMarcoFalke2016-05-201-2/+4
|\ \ | | | | | | | | | fab5233 [qa] test_framework: Set wait-timeout for bitcoind procs (MarcoFalke)
| * | [qa] test_framework: Set wait-timeout for bitcoind procsMarcoFalke2016-05-121-2/+4
| |/
* / [qa] Remove hardcoded "4 nodes" from test_frameworkMarcoFalke2016-05-151-13/+20
|/
* [qa] Add option --portseed to test_frameworkMarcoFalke2016-05-091-3/+7
|
* [qa] Stop other nodes, even when one fails to stopMarcoFalke2016-05-061-2/+9
|
* [qa] Refactor test_framework and pull testerMarcoFalke2016-05-061-4/+13
| | | | | | | * log to stdout * increase range for p2p and rpc ports * UPPERCASE_CONSTANTS * Stop nodes on CTRL+C
* [qa] Switch to py3MarcoFalke2016-05-051-10/+11
|
* [qa] test_framework: Properly print exceptions and assert empty dictMarcoFalke2016-04-261-1/+1
|
* Move method to check matches within arrays on util.pyJoao Fonseca2016-04-191-0/+29
|
* Merge #7853: [qa] py2: Unfiddle strings into bytes explicitlyWladimir J. van der Laan2016-04-141-1/+14
|\ | | | | | | faa41ee [qa] py2: Unfiddle strings into bytes explicitly (MarcoFalke)
| * [qa] py2: Unfiddle strings into bytes explicitlyMarcoFalke2016-04-101-1/+14
| |
* | getblockchaininfo: make bip9_softforks an object, not an array.Rusty Russell2016-04-131-4/+1
|/ | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Tests: move get_bip9_status to util.pySuhas Daftuar2016-04-071-0/+7
|
* test_framework: detect failure of bitcoind startupWladimir J. van der Laan2016-03-261-20/+40
| | | | | | | | | 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).