Browse Source

[QA] restructure rpc tests directory

* move non-test classes to subdir `test-framework`
tags/v0.15.1
Jonas Schnelli 6 years ago
parent
commit
64937fe51a
42 changed files with 71 additions and 88 deletions
  1. 6
    6
      qa/rpc-tests/bipdersig-p2p.py
  2. 2
    3
      qa/rpc-tests/bipdersig.py
  3. 2
    3
      qa/rpc-tests/forknotify.py
  4. 2
    3
      qa/rpc-tests/getblocktemplate_longpoll.py
  5. 2
    3
      qa/rpc-tests/getblocktemplate_proposals.py
  6. 2
    2
      qa/rpc-tests/getchaintips.py
  7. 2
    2
      qa/rpc-tests/httpbasics.py
  8. 2
    3
      qa/rpc-tests/invalidateblock.py
  9. 5
    5
      qa/rpc-tests/invalidblockrequest.py
  10. 2
    2
      qa/rpc-tests/keypool.py
  11. 2
    3
      qa/rpc-tests/listtransactions.py
  12. 3
    3
      qa/rpc-tests/maxblocksinflight.py
  13. 2
    3
      qa/rpc-tests/mempool_coinbase_spends.py
  14. 2
    4
      qa/rpc-tests/mempool_resurrect_test.py
  15. 2
    3
      qa/rpc-tests/mempool_spendcoinbase.py
  16. 2
    3
      qa/rpc-tests/merkle_blocks.py
  17. 3
    3
      qa/rpc-tests/proxy_test.py
  18. 2
    3
      qa/rpc-tests/pruning.py
  19. 2
    3
      qa/rpc-tests/receivedby.py
  20. 2
    3
      qa/rpc-tests/reindex.py
  21. 3
    2
      qa/rpc-tests/rest.py
  22. 2
    3
      qa/rpc-tests/rpcbind_test.py
  23. 7
    7
      qa/rpc-tests/script_test.py
  24. 2
    3
      qa/rpc-tests/smartfees.py
  25. 0
    0
      qa/rpc-tests/test_framework/__init__.py
  26. 0
    0
      qa/rpc-tests/test_framework/bignum.py
  27. 0
    0
      qa/rpc-tests/test_framework/blockstore.py
  28. 0
    0
      qa/rpc-tests/test_framework/blocktools.py
  29. 0
    0
      qa/rpc-tests/test_framework/comptool.py
  30. 0
    0
      qa/rpc-tests/test_framework/mininode.py
  31. 0
    0
      qa/rpc-tests/test_framework/netutil.py
  32. 0
    0
      qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/.gitignore
  33. 0
    0
      qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/__init__.py
  34. 0
    0
      qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/authproxy.py
  35. 0
    0
      qa/rpc-tests/test_framework/python-bitcoinrpc/setup.py
  36. 2
    2
      qa/rpc-tests/test_framework/script.py
  37. 0
    0
      qa/rpc-tests/test_framework/socks5.py
  38. 0
    0
      qa/rpc-tests/test_framework/test_framework.py
  39. 0
    0
      qa/rpc-tests/test_framework/util.py
  40. 2
    3
      qa/rpc-tests/txn_doublespend.py
  41. 2
    3
      qa/rpc-tests/wallet.py
  42. 2
    2
      qa/rpc-tests/zapwallettxes.py

+ 6
- 6
qa/rpc-tests/bipdersig-p2p.py View File

@@ -4,14 +4,14 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#

from test_framework import ComparisonTestFramework
from util import *
from mininode import CTransaction, NetworkThread
from blocktools import create_coinbase, create_block
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block
from test_framework.comptool import TestInstance, TestManager
from test_framework.script import CScript
from binascii import hexlify, unhexlify
import cStringIO
from comptool import TestInstance, TestManager
from script import CScript
import time

# A canonical signature consists of:

+ 2
- 3
qa/rpc-tests/bipdersig.py View File

@@ -7,9 +7,8 @@
# Test the BIP66 changeover logic
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil


+ 2
- 3
qa/rpc-tests/forknotify.py View File

@@ -7,9 +7,8 @@
# Test -alertnotify
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil


+ 2
- 3
qa/rpc-tests/getblocktemplate_longpoll.py View File

@@ -3,9 +3,8 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *


def check_array_result(object_array, to_match, expected):

+ 2
- 3
qa/rpc-tests/getblocktemplate_proposals.py View File

@@ -3,9 +3,8 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

from binascii import a2b_hex, b2a_hex
from hashlib import sha256

+ 2
- 2
qa/rpc-tests/getchaintips.py View File

@@ -7,8 +7,8 @@
# on chains of different lengths, and join the network together again.
# This gives us two tips, verify that it works.

from test_framework import BitcoinTestFramework
from util import assert_equal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal

class GetChainTipsTest (BitcoinTestFramework):


+ 2
- 2
qa/rpc-tests/httpbasics.py View File

@@ -7,8 +7,8 @@
# Test REST interface
#

from test_framework import BitcoinTestFramework
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import base64

try:

+ 2
- 3
qa/rpc-tests/invalidateblock.py View File

@@ -7,9 +7,8 @@
# Test InvalidateBlock code
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

class InvalidateTest(BitcoinTestFramework):

+ 5
- 5
qa/rpc-tests/invalidblockrequest.py View File

@@ -4,11 +4,11 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#

from test_framework import ComparisonTestFramework
from util import *
from comptool import TestManager, TestInstance
from mininode import *
from blocktools import *
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance
from test_framework.mininode import *
from test_framework.blocktools import *
import logging
import copy
import time

+ 2
- 2
qa/rpc-tests/keypool.py View File

@@ -8,7 +8,7 @@
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_framework/python-bitcoinrpc"))

import json
import shutil
@@ -17,7 +17,7 @@ import tempfile
import traceback

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.util import *


def check_array_result(object_array, to_match, expected):

+ 2
- 3
qa/rpc-tests/listtransactions.py View File

@@ -5,9 +5,8 @@

# Exercise the listtransactions API

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *


def check_array_result(object_array, to_match, expected):

+ 3
- 3
qa/rpc-tests/maxblocksinflight.py View File

@@ -4,9 +4,9 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#

from mininode import *
from test_framework import BitcoinTestFramework
from util import *
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import logging

'''

+ 2
- 3
qa/rpc-tests/mempool_coinbase_spends.py View File

@@ -8,9 +8,8 @@
# that spend (directly or indirectly) coinbase transactions.
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil


+ 2
- 4
qa/rpc-tests/mempool_resurrect_test.py View File

@@ -8,9 +8,8 @@
# the blockchain is re-organized.
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil

@@ -34,7 +33,6 @@ class MempoolCoinbaseTest(BitcoinTestFramework):

def run_test(self):
node0_address = self.nodes[0].getnewaddress()

# Spend block 1/2/3's coinbase transactions
# Mine a block.
# Create three more transactions, spending the spends

+ 2
- 3
qa/rpc-tests/mempool_spendcoinbase.py View File

@@ -13,9 +13,8 @@
# but less mature coinbase spends are NOT.
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil


+ 2
- 3
qa/rpc-tests/merkle_blocks.py View File

@@ -7,9 +7,8 @@
# Test merkleblock fetch/validation
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil


+ 3
- 3
qa/rpc-tests/proxy_test.py View File

@@ -7,9 +7,9 @@ import traceback, sys
from binascii import hexlify
import time, os

from socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework import BitcoinTestFramework
from util import *
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
'''
Test plan:
- Start bitcoind's with different proxy configurations

+ 2
- 3
qa/rpc-tests/pruning.py View File

@@ -11,9 +11,8 @@
# This test takes 30 mins or more (up to 2 hours)
# ********

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os.path

def calc_usage(blockdir):

+ 2
- 3
qa/rpc-tests/receivedby.py View File

@@ -5,9 +5,8 @@

# Exercise the listreceivedbyaddress API

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *


def get_sub_array_from_array(object_array, to_match):

+ 2
- 3
qa/rpc-tests/reindex.py View File

@@ -6,9 +6,8 @@
#
# Test -reindex with CheckBlockIndex
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os.path

class ReindexTest(BitcoinTestFramework):

+ 3
- 2
qa/rpc-tests/rest.py View File

@@ -7,8 +7,9 @@
# Test REST interface
#

from test_framework import BitcoinTestFramework
from util import *

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from struct import *
import binascii
import json

+ 2
- 3
qa/rpc-tests/rpcbind_test.py View File

@@ -16,9 +16,8 @@ import subprocess
import tempfile
import traceback

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from netutil import *
from test_framework.util import *
from test_framework.netutil import *

def run_bind_test(tmpdir, allow_ips, connect_to, addresses, expected):
'''

+ 7
- 7
qa/rpc-tests/script_test.py View File

@@ -19,12 +19,12 @@ that flag, we use a block time before the switchover date).
NOTE: This test is very slow and may take more than 40 minutes to run.
'''

from test_framework import ComparisonTestFramework
from util import *
from comptool import TestInstance, TestManager
from mininode import *
from blocktools import *
from script import *
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestInstance, TestManager
from test_framework.mininode import *
from test_framework.blocktools import *
from test_framework.script import *
import logging
import copy
import json
@@ -42,7 +42,7 @@ class ScriptTestFile(object):

def load_files(self):
for f in self.files:
self.data.extend(json.loads(open(f).read()))
self.data.extend(json.loads(open(os.path.dirname(os.path.abspath(__file__))+"/"+f).read()))

# Skip over records that are not long enough to be tests
def get_records(self):

+ 2
- 3
qa/rpc-tests/smartfees.py View File

@@ -7,9 +7,8 @@
# Test fee estimation code
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

# Construct 2 trivial P2SH's and the ScriptSigs that spend them
# So we can create many many transactions without needing to spend

qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py → qa/rpc-tests/test_framework/__init__.py View File


qa/rpc-tests/bignum.py → qa/rpc-tests/test_framework/bignum.py View File


qa/rpc-tests/blockstore.py → qa/rpc-tests/test_framework/blockstore.py View File


qa/rpc-tests/blocktools.py → qa/rpc-tests/test_framework/blocktools.py View File


qa/rpc-tests/comptool.py → qa/rpc-tests/test_framework/comptool.py View File


qa/rpc-tests/mininode.py → qa/rpc-tests/test_framework/mininode.py View File


qa/rpc-tests/netutil.py → qa/rpc-tests/test_framework/netutil.py View File


qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore → qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/.gitignore View File


+ 0
- 0
qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/__init__.py View File


qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py → qa/rpc-tests/test_framework/python-bitcoinrpc/bitcoinrpc/authproxy.py View File


qa/rpc-tests/python-bitcoinrpc/setup.py → qa/rpc-tests/test_framework/python-bitcoinrpc/setup.py View File


qa/rpc-tests/script.py → qa/rpc-tests/test_framework/script.py View File

@@ -14,7 +14,7 @@ Functionality to build scripts, as well as SignatureHash().

from __future__ import absolute_import, division, print_function, unicode_literals

from mininode import CTransaction, CTxOut, hash256
from test_framework.mininode import CTransaction, CTxOut, hash256

import sys
bchr = chr
@@ -27,7 +27,7 @@ if sys.version > '3':
import copy
import struct

import bignum
import test_framework.bignum

MAX_SCRIPT_SIZE = 10000
MAX_SCRIPT_ELEMENT_SIZE = 520

qa/rpc-tests/socks5.py → qa/rpc-tests/test_framework/socks5.py View File


qa/rpc-tests/test_framework.py → qa/rpc-tests/test_framework/test_framework.py View File


qa/rpc-tests/util.py → qa/rpc-tests/test_framework/util.py View File


+ 2
- 3
qa/rpc-tests/txn_doublespend.py View File

@@ -7,10 +7,9 @@
# Test proper accounting with malleable transactions
#

from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from decimal import Decimal
from util import *
import os
import shutil


+ 2
- 3
qa/rpc-tests/wallet.py View File

@@ -19,9 +19,8 @@
# k) test ResendWalletTransactions - create transactions, startup fourth node, make sure it syncs
#

from test_framework import BitcoinTestFramework
from util import *

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *

class WalletTest (BitcoinTestFramework):


+ 2
- 2
qa/rpc-tests/zapwallettxes.py View File

@@ -3,8 +3,8 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

from test_framework import BitcoinTestFramework
from util import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *


class ZapWalletTXesTest (BitcoinTestFramework):

Loading…
Cancel
Save