Commit graph

670 commits

Author SHA1 Message Date
MarcoFalke
0a6d48d9ed
Merge #9168: [qa] add assert_raises_message to check specific error message
307acdd [qa] add assert_raises_message to check specific error message (mrbandrews)
2016-11-16 10:51:25 +01:00
Wladimir J. van der Laan
4333b1c4ea
Merge #9151: [qa] proxy_test: Calculate hardcoded port numbers
fa80ef8 [qa] proxy_test: Calculate hardcoded port numbers instead (MarcoFalke)
2016-11-16 10:04:18 +01:00
mrbandrews
307acdd3df [qa] add assert_raises_message to check specific error message 2016-11-15 15:37:46 -05:00
Russell Yanofsky
7943b13ab3 [qa] Avoid 2 list comprehensions in sync_blocks 2016-11-14 12:02:33 -05:00
Russell Yanofsky
05e57ccd74 [qa] Fix sync_blocks timeout argument
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 12:02:31 -05:00
Russell Yanofsky
fd6bb700b7 [qa] Improve sync_blocks error messages. 2016-11-14 12:01:51 -05:00
MarcoFalke
fa80ef8173 [qa] proxy_test: Calculate hardcoded port numbers instead 2016-11-13 22:32:23 +01:00
Wladimir J. van der Laan
7977a1157a
Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842)
dac53b5 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
55bfddc [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
47e9659 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
2016-11-11 11:02:44 +01:00
MarcoFalke
e5364991da
Merge #9097: [qa] Rework sync_* and preciousblock.py
fa97ccb [qa] util: Rework sync_*() (MarcoFalke)
fac1141 [qa] preciousblock: Use assert_equal and BitcoinTestFramework.__init__ (MarcoFalke)
2016-11-10 11:23:40 +01:00
Wladimir J. van der Laan
faec09bc7f
Merge #8894: [Testing] Include fRelay in mininode version messages
e5d682f Fix mininode version message format (jnewbery)
2016-11-09 22:06:57 +01:00
jnewbery
e5d682faa3 Fix mininode version message format 2016-11-09 02:34:30 +00:00
Wladimir J. van der Laan
71ab476b04
Merge #9098: [qa] Handle zombies and cluttered tmpdirs
fab0f07 [qa] rpc-tests: Apply random offset to portseed (MarcoFalke)
fae19aa [qa] test_framework: Exit when tmpdir exists (MarcoFalke)
2016-11-08 10:55:45 +01:00
MarcoFalke
fab0f07dec [qa] rpc-tests: Apply random offset to portseed
This helps to skip over resources, which are blocked by regtest bitcoind
zombie nodes
2016-11-08 10:50:31 +01:00
Pieter Wuille
dc6b9406bd
Merge #9026: Fix handling of invalid compact blocks
d4833ff Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
88c3549 Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
c93beac [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
2016-11-07 18:11:18 -08:00
MarcoFalke
fae19aa1da [qa] test_framework: Exit when tmpdir exists 2016-11-07 22:55:27 +01:00
MarcoFalke
fa97ccb06d [qa] util: Rework sync_*()
* Only allow named args in sync_*()
* Make sync_* fails more verbose
* Add timeout to sync_chain()
2016-11-07 20:42:21 +01:00
Russell Yanofsky
dac53b58b5 Modify getblocktxn handler not to drop requests for old blocks
The current getblocktxn implementation drops and ignores requests for old
blocks, which causes occasional sync_block timeouts during the
p2p-compactblocks.py test as reported in
https://github.com/bitcoin/bitcoin/issues/8842.

The p2p-compactblocks.py test setup creates many new blocks in a short
period of time, which can lead to getblocktxn requests for blocks below the
hardcoded depth limit of 10 blocks. This commit changes the getblocktxn
handler not to ignore these requests, so the peer nodes in the test setup
will reliably be able to sync.

The protocol change is documented in BIP-152 update "Allow block responses
to getblocktxn requests" at https://github.com/bitcoin/bips/pull/469.

The protocol change is not expected to affect nodes running outside the test
environment, because there shouldn't normally be lots of new blocks being
rapidly added that need to be synced.
2016-11-07 14:35:11 -05:00
MarcoFalke
fac1141600 [qa] preciousblock: Use assert_equal and BitcoinTestFramework.__init__ 2016-11-07 19:23:33 +01:00
MarcoFalke
1253f8692f
Merge #9077: [qa] Increase wallet-dump RPC timeout
e89614b [qa] Add more helpful RPC timeout message (Russell Yanofsky)
8463aaa [qa] Increase wallet-dump RPC timeout (Russell Yanofsky)
2016-11-07 18:31:36 +01:00
Russell Yanofsky
e89614b6ab [qa] Add more helpful RPC timeout message
Replace previous timeout('timed out',) exception with more detailed error.
2016-11-07 12:04:19 -05:00
Russell Yanofsky
8463aaa63c [qa] Increase wallet-dump RPC timeout
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-11-07 12:04:01 -05:00
isle2983
4b04e32c20 [copyright] copyright header style uniform
Three categories of modifications:

1)

1 instance of 'The Bitcoin Core developers \n',
1 instance of 'the Bitcoin Core developers\n',
3 instances of 'Bitcoin Core Developers\n', and
12 instances of 'The Bitcoin developers\n'

are made uniform with the 443 instances of 'The Bitcoin Core developers\n'

2)

3 instances of 'BitPay, Inc\.\n' are made uniform with the other 6
instances of 'BitPay Inc\.\n'

3)

4 instances where there was no '(c)' between the 'Copyright' and the year
where it deviates from the style of the local directory.
2016-11-06 10:12:50 -07:00
Suhas Daftuar
c93beac43f [qa] Test that invalid compactblocks don't result in ban 2016-11-03 12:26:37 -04:00
Russell Yanofsky
55bfddcabb [qa] Fix stale data bug in test_compactblocks_not_at_tip
Clear test_node.last_block before requesting blocks in the
compactblocks_not_at_tip test so comparisons won't fail if a blocks were received
before the test started.

The bug doesn't currently cause any problems due to the order tests run, but
this will change in the next commit.
2016-11-02 15:35:11 -04:00
Russell Yanofsky
47e9659ecf [qa] Fix bug in compactblocks v2 merge
Bug caused the wait_for_block_announcement to be called on the wrong node,
leading to nondeterminism and occasional test failures. Bug was introduced in
merge commit:

d075479 Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py

Underlying commits which conflicted were:

27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py

The first commit changed the test_compactblock_construction function signature
and second commit added code which wasn't updated during the merge to use the
new arguments.

Suhas Daftuar <sdaftuar@chaincode.com> noticed the bug and suggested the fix.
2016-11-02 15:35:11 -04:00
Wladimir J. van der Laan
f2d705629b
Merge #7551: Add importmulti RPC call
215caba Add consistency check to RPC call importmulti (Pedro Branco)
cb08fdb Add importmulti rpc call (Pedro Branco)
2016-10-20 09:04:32 +02:00
Pedro Branco
215caba4ed Add consistency check to RPC call importmulti 2016-10-19 15:17:42 +01:00
Pedro Branco
cb08fdbf78 Add importmulti rpc call 2016-10-19 15:17:13 +01:00
mruddy
fc146095d2 RPC: augment getblockchaininfo bip9_softforks data 2016-10-19 09:08:39 -04:00
Wladimir J. van der Laan
7f71a3c591
Merge #6996: Add preciousblock RPC
5805ac8 Add preciousblock tests (Pieter Wuille)
5127c4f Add preciousblock RPC (Pieter Wuille)
2016-10-18 21:36:38 +02:00
Pieter Wuille
3ac6de0a04 Align constant names for maximum compact block / blocktxn depth 2016-10-17 16:46:30 +02:00
Matt Corallo
fe998e962d More agressively filter compact block requests
Unit test adaptations by Pieter Wuille.
2016-10-17 16:44:57 +02:00
Wladimir J. van der Laan
53133c1c04
Merge #8499: Add several policy limits and disable uncompressed keys for segwit scripts
67d6ee1 remove redundant tests in p2p-segwit.py (Johnson Lau)
9260085 test segwit uncompressed key fixes (Johnson Lau)
248f3a7 Fix ismine and addwitnessaddress: no uncompressed keys in segwit (Pieter Wuille)
b811124 [qa] Add tests for uncompressed pubkeys in segwit (Suhas Daftuar)
9f0397a Make test framework produce lowS signatures (Johnson Lau)
4c0c25a Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts (Johnson Lau)
3ade2f6 Add standard limits for P2WSH with tests (Johnson Lau)
2016-10-17 13:27:05 +02:00
Johnson Lau
67d6ee1e36 remove redundant tests in p2p-segwit.py 2016-10-17 03:18:36 +08:00
Johnson Lau
9260085377 test segwit uncompressed key fixes 2016-10-17 00:34:37 +08:00
Suhas Daftuar
b811124202 [qa] Add tests for uncompressed pubkeys in segwit 2016-10-16 23:53:35 +08:00
Johnson Lau
9f0397aff7 Make test framework produce lowS signatures 2016-10-16 23:53:35 +08:00
Johnson Lau
3ade2f64cf Add standard limits for P2WSH with tests 2016-10-16 23:53:35 +08:00
Matt Corallo
a4ad37d4ef [qa] Build v4 blocks in p2p-compactblocktests
This fixes an issue in backporting to 0.13 as 0.13 enforces SF
activation by block version lockin instead of through a hard-coded
block height.
2016-10-15 17:51:05 -04:00
Matt Corallo
032e883b93 [qa] Send segwit-encoded blocktxn messages in p2p-compactblocks 2016-10-14 12:54:15 -04:00
Wladimir J. van der Laan
e2a17e43e3
Merge #8904: [qa] Fix compact block shortids for a test case
4cdece4 [qa] Fix compact block shortids for a test case (Dagur Valberg Johannsson)
2016-10-13 18:48:13 +02:00
MarcoFalke
d075479969
Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py
b55d941 [qa] Fix race condition in sendheaders.py (Suhas Daftuar)
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py (Suhas Daftuar)
2016-10-11 10:50:22 +02:00
Dagur Valberg Johannsson
4cdece4041 [qa] Fix compact block shortids for a test case 2016-10-10 13:37:16 -04:00
Suhas Daftuar
b55d9411e7 [qa] Fix race condition in sendheaders.py
Also de-duplicates code that has been moved to mininode
2016-10-06 14:21:11 -04:00
Suhas Daftuar
6976db2f46 [qa] Another attempt to fix race condition in p2p-compactblocks.py
sync_with_ping() only guarantees that the node has processed messages
it's received from the peer, not that block announcements from the node have
made it back to the peer.  Replace sync_with_ping() with an explicit check that
the node's tip has been announced.
2016-10-04 15:17:19 -04:00
Suhas Daftuar
27acfc1d2e [qa] Update p2p-compactblocks.py for compactblocks v2 2016-10-04 19:10:49 +02:00
Suhas Daftuar
422fac649f [qa] Add support for compactblocks v2 to mininode 2016-10-04 19:10:49 +02:00
Suhas Daftuar
f5b9b8f437 [qa] Fix bug in mininode witness deserialization
Also improve tx printing
2016-10-04 19:10:49 +02:00
Matt Corallo
be7555f0c0 Fix overly-prescriptive p2p-segwit test for new fetch logic 2016-10-04 18:24:10 +02:00
MarcoFalke
76f3c02fb0
Merge #8860: [qa] util: Move wait_bitcoinds() into stop_nodes()
fa7c35c [qa] util: Move wait_bitcoinds() into stop_nodes() (MarcoFalke)
2016-10-03 10:12:42 +02:00