Permalink
Browse files

[qa] Switch to py3

Github-Pull: #7814
Rebased-From: fa389d4
  • Loading branch information...
1 parent 1233cb4 commit 28265655da658bf8351f038f7c51a48d8c80f7c0 @MarcoFalke MarcoFalke committed Mar 19, 2016
Showing with 494 additions and 531 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. +4 −4 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. +15 −15 qa/rpc-tests/invalidateblock.py
  24. +5 −6 qa/rpc-tests/invalidblockrequest.py
  25. +5 −6 qa/rpc-tests/invalidtxrequest.py
  26. +2 −2 qa/rpc-tests/keypool.py
  27. +2 −2 qa/rpc-tests/listtransactions.py
  28. +5 −6 qa/rpc-tests/maxblocksinflight.py
  29. +17 −18 qa/rpc-tests/maxuploadtarget.py
  30. +3 −3 qa/rpc-tests/mempool_limit.py
  31. +12 −12 qa/rpc-tests/mempool_packages.py
  32. +2 −2 qa/rpc-tests/mempool_reorg.py
  33. +2 −2 qa/rpc-tests/mempool_resurrect_test.py
  34. +2 −2 qa/rpc-tests/mempool_spendcoinbase.py
  35. +3 −3 qa/rpc-tests/merkle_blocks.py
  36. +11 −18 qa/rpc-tests/multi_rpc.py
  37. +5 −11 qa/rpc-tests/nodehandling.py
  38. +18 −19 qa/rpc-tests/p2p-acceptblock.py
  39. +3 −5 qa/rpc-tests/p2p-fullblocktest.py
  40. +3 −4 qa/rpc-tests/p2p-versionbits-warning.py
  41. +7 −7 qa/rpc-tests/prioritise_transaction.py
  42. +4 −3 qa/rpc-tests/proxy_test.py
  43. +34 −34 qa/rpc-tests/pruning.py
  44. +2 −2 qa/rpc-tests/rawtransactions.py
  45. +2 −2 qa/rpc-tests/receivedby.py
  46. +3 −3 qa/rpc-tests/reindex.py
  47. +13 −13 qa/rpc-tests/replace-by-fee.py
  48. +9 −16 qa/rpc-tests/rest.py
  49. +3 −3 qa/rpc-tests/rpcbind_test.py
  50. +22 −23 qa/rpc-tests/sendheaders.py
  51. +2 −2 qa/rpc-tests/signrawtransactions.py
  52. +3 −3 qa/rpc-tests/smartfees.py
  53. +2 −3 qa/rpc-tests/test_framework/bignum.py
  54. +7 −6 qa/rpc-tests/test_framework/blockstore.py
  55. +3 −3 qa/rpc-tests/test_framework/blocktools.py
  56. +8 −9 qa/rpc-tests/test_framework/comptool.py
  57. +5 −0 qa/rpc-tests/test_framework/coverage.py
  58. +40 −35 qa/rpc-tests/test_framework/mininode.py
  59. +2 −2 qa/rpc-tests/test_framework/netutil.py
  60. +6 −5 qa/rpc-tests/test_framework/script.py
  61. +5 −4 qa/rpc-tests/test_framework/socks5.py
  62. +4 −4 qa/rpc-tests/test_framework/test_framework.py
  63. +11 −10 qa/rpc-tests/test_framework/util.py
  64. +2 −2 qa/rpc-tests/txn_clone.py
  65. +2 −2 qa/rpc-tests/txn_doublespend.py
  66. +4 −4 qa/rpc-tests/wallet.py
  67. +2 −2 qa/rpc-tests/walletbackup.py
  68. +3 −3 qa/rpc-tests/zapwallettxes.py
  69. +6 −12 qa/rpc-tests/zmq_test.py
View
@@ -36,15 +36,15 @@ matrix:
- compiler: ": ARM"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=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 libcap-dev libz-dev libbz2-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
-#
-# 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 2826565

Please sign in to comment.