Skip to content

Commit

Permalink
tests: Mark functional tests not supporting bitcoin-cli (--usecli) as…
Browse files Browse the repository at this point in the history
… such

Summary:
The option `--usecli` was added to test_framework in [[bitcoin/bitcoin#11970 | PR11970]]. Running the test with this parameter will cause all RPCs to be sent through `bitcoin-cli` rather than directly over http. But the test were not all annotated accordingly. 74 tests were unnecessarily skipped.

Explicitely annotating the tests that do not support this option will allow to make this lack of support the exception, and identify these tests clearly as needing to be fixed in  the future.

This commit has currently no effect, as `self.supports_cli` is still considered `False` by default. This will be changed in the next commit.

In addition to the tests skipped in the Core PR, I also found the following tests to not support `--usecli`:
- `abc_wallet_standardness`: `TypeError: Object of type 'Decimal' is not JSON serializable` (will be fixed when backporting PR17705)
- `abc-magnetic-anomaly-mining`: idem
- `p2p_blocksonly`: idem
- `rpc_whitelist`: `AttributeError: 'NoneType' object has no attribute 'rfind'` (this test was added after PR17675 and should have been skipped in Core as well)
- `abc_p2p_fullblocktest`: `OSError: [Errno 7] Argument list too long: '.../bitcoin-abc/build/src/bitcoin-cli'`
- `wallet_groups` : idem

This is a backport of Core [[bitcoin/bitcoin#17675 | PR17675]] [1/2]
bitcoin/bitcoin@993e38a

Test Plan: `test/functional/test_runner.py --usecli`

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8316
  • Loading branch information
practicalswift authored and PiRK committed Nov 10, 2020
1 parent 5af0f21 commit cc5ceb0
Show file tree
Hide file tree
Showing 49 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/functional/abc-magnetic-anomaly-mining.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def set_test_params(self):

extra_arg = ['-spendzeroconfchange=0', '-whitelist=127.0.0.1']
self.extra_args = [extra_arg, extra_arg]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/abc_p2p_avalanche.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def set_test_params(self):
self.extra_args = [
['-enableavalanche=1', '-avacooldown=0', '-automaticunparking=0'],
['-enableavalanche=1', '-avacooldown=0', '-noparkdeepreorg', '-maxreorgdepth=-1']]
self.supports_cli = False

def run_test(self):
node = self.nodes[0]
Expand Down
1 change: 1 addition & 0 deletions test/functional/abc_p2p_fullblocktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def set_test_params(self):
self.excessive_block_size = 100 * ONE_MEGABYTE
self.extra_args = [['-whitelist=127.0.0.1',
"-excessiveblocksize={}".format(self.excessive_block_size)]]
self.supports_cli = False

def add_options(self, parser):
super().add_options(parser)
Expand Down
1 change: 1 addition & 0 deletions test/functional/abc_wallet_standardness.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [['-acceptnonstdtxn=0'], ['-acceptnonstdtxn=1']]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ConfArgsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False

def test_config_file_parser(self):
# Assume node is stopped
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_csv_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.extra_args = [['-whitelist=127.0.0.1', '-blockversion=4']]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_dbcrash.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = False
self.rpc_timeout = 480
self.supports_cli = False

# Set -maxmempool=0 to turn off mempool memory sharing with dbcache
# Set -rpcservertimeout=900 to reduce socket disconnects in this
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_loadblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class LoadblockTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.supports_cli = False

def run_test(self):
self.nodes[1].setnetworkactive(state=False)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_maxuploadtarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def set_test_params(self):
self.num_nodes = 1
# Start a node with maxuploadtarget of 200 MB (/24h)
self.extra_args = [["-maxuploadtarget=200", "-acceptnonstdtxn=1"]]
self.supports_cli = False

# Cache for utxos, as the listunspent may take a long time later in the
# test
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class PruneTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 6
self.supports_cli = False

# Create nodes 0 and 1 to mine.
# Create node 2 to test pruning.
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ShutdownTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False

def run_test(self):
node = get_rpc_proxy(
Expand Down
1 change: 1 addition & 0 deletions test/functional/interface_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class HTTPBasicsTest (BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self.supports_cli = False

def setup_network(self):
self.extra_args = [["-rpccorsdomain=null"], [], []]
Expand Down
1 change: 1 addition & 0 deletions test/functional/interface_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [["-rest"], []]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/interface_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RPCInterfaceTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.supports_cli = False

def test_getrpcinfo(self):
self.log.info("Testing getrpcinfo...")
Expand Down
1 change: 1 addition & 0 deletions test/functional/mempool_accept.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def set_test_params(self):
'-txindex',
'-acceptnonstdtxn=0', # Try to mimic main-net
]] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/mempool_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def set_test_params(self):
"-maxmempool=5",
"-spendzeroconfchange=0",
]]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/mempool_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def set_test_params(self):
self.extra_args = [
common_params, common_params +
["-limitancestorcount={}".format(MAX_ANCESTORS_CUSTOM)]]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/mining_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class MiningTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
self.supports_cli = False

def mine_chain(self):
self.log.info('Create some old blocks')
Expand Down
1 change: 1 addition & 0 deletions test/functional/mining_getblocktemplate_longpoll.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def run(self):
class GetBlockTemplateLPTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/mining_prioritisetransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def set_test_params(self):
"-acceptnonstdtxn=1",
"-txindex"
]] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/p2p_blocksonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
self.extra_args = [["-blocksonly"]]
self.supports_cli = False

def run_test(self):
self.nodes[0].add_p2p_connection(P2PInterface())
Expand Down
1 change: 1 addition & 0 deletions test/functional/p2p_disconnect_ban.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class DisconnectBanTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False

def run_test(self):
self.log.info("Connect nodes both way")
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.bind_to_localhost_only = False
self.num_nodes = 1
self.supports_cli = False

def setup_network(self):
self.add_nodes(self.num_nodes, None)
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def set_test_params(self):
self.num_nodes = 1
# TODO: remove -txindex. Currently required for getrawtransaction call.
self.extra_args = [["-txindex"]]
self.supports_cli = False

def run_test(self):
self.mine_chain()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_createmultisig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class RpcCreateMultiSigTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def set_test_params(self):
# This test isn't testing tx relay. Set whitelist on the peers for
# instant tx relay.
self.extra_args = [['-whitelist=127.0.0.1']] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_getblockstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def add_options(self, parser):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.supports_cli = False

def get_stats(self):
return [self.nodes[0].getblockstats(
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class HelpRpcTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False

def run_test(self):
self.test_categories()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class RpcMiscTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False

def run_test(self):
node = self.nodes[0]
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_named_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class NamedArgumentTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False

def run_test(self):
node = self.nodes[0]
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-minrelaytxfee=0.00001000"],
["-minrelaytxfee=0.00000500"]]
self.supports_cli = False

def run_test(self):
self.log.info('Connect nodes both way')
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_preciousblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def set_test_params(self):
self.num_nodes = 3
self.extra_args = [["-noparkdeepreorg"],
["-noparkdeepreorg"], ["-noparkdeepreorg"]]
self.supports_cli = False

def setup_network(self):
self.setup_nodes()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PSBTTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 3
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_rawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.extra_args = [["-txindex"], ["-txindex"], ["-txindex"]]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_signrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_txoutproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
self.setup_clean_chain = True
# Nodes 0/1 are "wallet" nodes, Nodes 2/3 are used for testing
self.extra_args = [[], [], [], ["-txindex"]]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def call_with_auth(node, user, password):
class HTTPBasicsTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False

def setup_chain(self):
super().setup_chain()
Expand Down
1 change: 1 addition & 0 deletions test/functional/rpc_whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def rpccall(node, user, method):
class RPCWhitelistTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False

def setup_chain(self):
super().setup_chain()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_abandonconflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AbandonConflictTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-minrelaytxfee=0.00001"], []]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_address_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def set_test_params(self):
self.num_nodes = 5
# whitelist all peers to speed up tx relay / mempool sync
self.extra_args = [["-whitelist=127.0.0.1"]] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def set_test_params(self):
['-limitdescendantcount=3'],
[],
]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def set_test_params(self):
self.extra_args = [
["-acceptnonstdtxn=1"],
] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def set_test_params(self):
self.extra_args = [
[], [], ['-avoidpartialspends'], ["-maxapsfee=0.0001"]]
self.rpc_timeout = 120
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [[], ['-keypool=0']]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_import_rescan.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_rand_amount():
class ImportRescanTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2 + len(IMPORT_NODES)
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_listsinceblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
self.extra_args = [["-noparkdeepreorg"], ["-noparkdeepreorg"], [], []]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_reorgsrestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ReorgsRestoreTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self.extra_args = [["-noparkdeepreorg"]] * self.num_nodes
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_txn_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.extra_args = [["-noparkdeepreorg"], ["-noparkdeepreorg"], [], []]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_txn_doublespend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.extra_args = [["-noparkdeepreorg"], ["-noparkdeepreorg"], [], []]
self.supports_cli = False

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
Expand Down

0 comments on commit cc5ceb0

Please sign in to comment.