Permalink
Browse files

Merge #7814: [qa] Switch to py3

fa389d4 [qa] Switch to py3 (MarcoFalke)
  • Loading branch information...
laanwj committed May 6, 2016
2 parents 65aecda + fa389d4 commit 77b637f20e8cb91cf007bf416b603ca362385cdb
Showing with 504 additions and 547 deletions.
  1. +5 −5 .travis.yml
  2. +1 −1 doc/zmq.md
  3. +2 −2 qa/README.md
  4. +5 −5 qa/pull-tester/rpc-tests.py
  5. +2 −4 qa/pull-tester/tests_config.py.in
  6. +7 −10 qa/rpc-tests/abandonconflict.py
  7. +7 −8 qa/rpc-tests/bip65-cltv-p2p.py
  8. +4 −4 qa/rpc-tests/bip65-cltv.py
  9. +54 −55 qa/rpc-tests/bip68-112-113-p2p.py
  10. +15 −15 qa/rpc-tests/bip68-sequence.py
  11. +4 −5 qa/rpc-tests/bip9-softforks.py
  12. +7 −8 qa/rpc-tests/bipdersig-p2p.py
  13. +4 −4 qa/rpc-tests/bipdersig.py
  14. +9 −9 qa/rpc-tests/blockchain.py
  15. +2 −2 qa/rpc-tests/decodescript.py
  16. +2 −2 qa/rpc-tests/disablewallet.py
  17. +2 −2 qa/rpc-tests/forknotify.py
  18. +6 −6 qa/rpc-tests/fundrawtransaction.py
  19. +3 −3 qa/rpc-tests/getblocktemplate_longpoll.py
  20. +6 −6 qa/rpc-tests/getblocktemplate_proposals.py
  21. +2 −2 qa/rpc-tests/getchaintips.py
  22. +16 −22 qa/rpc-tests/httpbasics.py
  23. +2 −2 qa/rpc-tests/importprunedfunds.py
  24. +15 −15 qa/rpc-tests/invalidateblock.py
  25. +5 −6 qa/rpc-tests/invalidblockrequest.py
  26. +5 −6 qa/rpc-tests/invalidtxrequest.py
  27. +2 −2 qa/rpc-tests/keypool.py
  28. +2 −2 qa/rpc-tests/listtransactions.py
  29. +5 −6 qa/rpc-tests/maxblocksinflight.py
  30. +17 −18 qa/rpc-tests/maxuploadtarget.py
  31. +3 −3 qa/rpc-tests/mempool_limit.py
  32. +12 −12 qa/rpc-tests/mempool_packages.py
  33. +2 −2 qa/rpc-tests/mempool_reorg.py
  34. +2 −2 qa/rpc-tests/mempool_resurrect_test.py
  35. +2 −2 qa/rpc-tests/mempool_spendcoinbase.py
  36. +3 −3 qa/rpc-tests/merkle_blocks.py
  37. +11 −18 qa/rpc-tests/multi_rpc.py
  38. +5 −11 qa/rpc-tests/nodehandling.py
  39. +18 −19 qa/rpc-tests/p2p-acceptblock.py
  40. +7 −7 qa/rpc-tests/p2p-feefilter.py
  41. +3 −4 qa/rpc-tests/p2p-fullblocktest.py
  42. +3 −4 qa/rpc-tests/p2p-versionbits-warning.py
  43. +7 −7 qa/rpc-tests/prioritise_transaction.py
  44. +4 −3 qa/rpc-tests/proxy_test.py
  45. +34 −34 qa/rpc-tests/pruning.py
  46. +2 −2 qa/rpc-tests/rawtransactions.py
  47. +2 −2 qa/rpc-tests/receivedby.py
  48. +3 −3 qa/rpc-tests/reindex.py
  49. +13 −13 qa/rpc-tests/replace-by-fee.py
  50. +9 −16 qa/rpc-tests/rest.py
  51. +3 −3 qa/rpc-tests/rpcbind_test.py
  52. +22 −23 qa/rpc-tests/sendheaders.py
  53. +1 −1 qa/rpc-tests/signmessages.py
  54. +2 −2 qa/rpc-tests/signrawtransactions.py
  55. +3 −3 qa/rpc-tests/smartfees.py
  56. +2 −3 qa/rpc-tests/test_framework/bignum.py
  57. +7 −6 qa/rpc-tests/test_framework/blockstore.py
  58. +3 −3 qa/rpc-tests/test_framework/blocktools.py
  59. +8 −9 qa/rpc-tests/test_framework/comptool.py
  60. +3 −4 qa/rpc-tests/test_framework/coverage.py
  61. +41 −36 qa/rpc-tests/test_framework/mininode.py
  62. +2 −2 qa/rpc-tests/test_framework/netutil.py
  63. +6 −5 qa/rpc-tests/test_framework/script.py
  64. +5 −4 qa/rpc-tests/test_framework/socks5.py
  65. +4 −4 qa/rpc-tests/test_framework/test_framework.py
  66. +11 −10 qa/rpc-tests/test_framework/util.py
  67. +2 −2 qa/rpc-tests/txn_clone.py
  68. +2 −2 qa/rpc-tests/txn_doublespend.py
  69. +4 −4 qa/rpc-tests/wallet.py
  70. +2 −2 qa/rpc-tests/walletbackup.py
  71. +3 −3 qa/rpc-tests/zapwallettxes.py
  72. +5 −12 qa/rpc-tests/zmq_test.py
View
@@ -37,15 +37,15 @@ matrix:
- compiler: ": ARM"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Win32"
env: HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="nsis g++-mingw-w64-i686 wine1.6 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports"
env: HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.6 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports"
- compiler: ": 32-bit + dash"
env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash"
env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python3-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash"
- compiler: ": Win64"
env: HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="nsis g++-mingw-w64-x86-64 wine1.6 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports"
env: HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine1.6 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports"
- compiler: ": bitcoind"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python3-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
- compiler: ": No wallet"
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Cross-Mac"
env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
exclude:
View
@@ -38,7 +38,7 @@ newer. Typically, it is packaged by distributions as something like
*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed.
In order to run the example Python client scripts in contrib/ one must
also install *python-zmq*, though this is not necessary for daemon
also install *python3-zmq*, though this is not necessary for daemon
operation.
## Enabling
View
@@ -11,9 +11,9 @@ Before running the tests, the following must be installed.
Unix
----
The python-zmq library is required. On Ubuntu or Debian it can be installed via:
The python3-zmq library is required. On Ubuntu or Debian it can be installed via:
```
sudo apt-get install python-zmq
sudo apt-get install python3-zmq
```
Running tests
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -70,14 +70,14 @@
if EXEEXT == ".exe" and "-win" not in opts:
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964
print "Win tests currently disabled by default. Use -win option to enable"
print("Win tests currently disabled by default. Use -win option to enable")
sys.exit(0)
if not (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1):
print "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
print("No rpc tests to run. Wallet, utils, and bitcoind must all be enabled")
sys.exit(0)
# python-zmq may not be installed. Handle this gracefully and with some helpful info
# python3-zmq may not be installed. Handle this gracefully and with some helpful info
if ENABLE_ZMQ:
try:
import zmq
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2013-2014 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -11,5 +11,3 @@ EXEEXT="@EXEEXT@"
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=1
@@ -1,15 +1,12 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
import urllib.parse
class AbandonConflictTest(BitcoinTestFramework):
@@ -34,7 +31,7 @@ def run_test(self):
assert(balance - newbalance < Decimal("0.001")) #no more than fees lost
balance = newbalance
url = urlparse.urlparse(self.nodes[1].url)
url = urllib.parse.urlparse(self.nodes[1].url)
self.nodes[0].disconnectnode(url.hostname+":"+str(p2p_port(1)))
# Identify the 10btc outputs
@@ -151,9 +148,9 @@ def run_test(self):
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
newbalance = self.nodes[0].getbalance()
#assert(newbalance == balance - Decimal("10"))
print "If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer"
print "conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315"
print balance , " -> " , newbalance , " ?"
print("If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer")
print("conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315")
print(str(balance) + " -> " + str(newbalance) + " ?")
if __name__ == '__main__':
AbandonConflictTest().main()
@@ -1,8 +1,7 @@
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
@@ -67,13 +66,13 @@ def get_tests(self):
self.coinbase_blocks = self.nodes[0].generate(2)
height = 3 # height of the next block to build
self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
self.tip = int("0x" + self.nodes[0].getbestblockhash(), 0)
self.nodeaddress = self.nodes[0].getnewaddress()
self.last_block_time = int(time.time())
''' 98 more version 3 blocks '''
test_blocks = []
for i in xrange(98):
for i in range(98):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 3
block.rehash()
@@ -86,7 +85,7 @@ def get_tests(self):
''' Mine 749 version 4 blocks '''
test_blocks = []
for i in xrange(749):
for i in range(749):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 4
block.rehash()
@@ -138,7 +137,7 @@ def get_tests(self):
''' Mine 199 new version blocks on last valid tip '''
test_blocks = []
for i in xrange(199):
for i in range(199):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 4
block.rehash()
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -32,7 +32,7 @@ def run_test(self):
raise AssertionError("Failed to mine 100 version=3 blocks")
# Mine 750 new-version blocks
for i in xrange(15):
for i in range(15):
self.nodes[2].generate(50)
self.sync_all()
if (self.nodes[0].getblockcount() != cnt + 850):
@@ -49,7 +49,7 @@ def run_test(self):
# TODO: check that new CHECKLOCKTIMEVERIFY rules are enforced
# Mine 198 new-version blocks
for i in xrange(2):
for i in range(2):
self.nodes[2].generate(99)
self.sync_all()
if (self.nodes[0].getblockcount() != cnt + 1049):
Oops, something went wrong.

0 comments on commit 77b637f

Please sign in to comment.