mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
test: Reduce unneeded whitelist permissions in tests
This commit is contained in:
parent
31c0006a6c
commit
fa45d60646
12 changed files with 31 additions and 22 deletions
|
@ -55,7 +55,7 @@ class BIP65Test(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.extra_args = [[
|
self.extra_args = [[
|
||||||
'-whitelist=127.0.0.1',
|
'-whitelist=noban@127.0.0.1',
|
||||||
'-par=1', # Use only one script thread to get the exact reject reason for testing
|
'-par=1', # Use only one script thread to get the exact reject reason for testing
|
||||||
'-acceptnonstdtxn=1', # cltv_invalidate is nonstandard
|
'-acceptnonstdtxn=1', # cltv_invalidate is nonstandard
|
||||||
]]
|
]]
|
||||||
|
|
|
@ -138,7 +138,11 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.extra_args = [['-whitelist=127.0.0.1', '-blockversion=4', '-addresstype=legacy']]
|
self.extra_args = [[
|
||||||
|
'-whitelist=noban@127.0.0.1',
|
||||||
|
'-blockversion=4',
|
||||||
|
'-addresstype=legacy',
|
||||||
|
]]
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
|
|
|
@ -40,7 +40,10 @@ def unDERify(tx):
|
||||||
class BIP66Test(BitcoinTestFramework):
|
class BIP66Test(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.extra_args = [['-whitelist=127.0.0.1', '-par=1']] # Use only one script thread to get the exact log msg for testing
|
self.extra_args = [[
|
||||||
|
'-whitelist=noban@127.0.0.1',
|
||||||
|
'-par=1', # Use only one script thread to get the exact log msg for testing
|
||||||
|
]]
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.rpc_timeout = 120
|
self.rpc_timeout = 120
|
||||||
|
|
||||||
|
|
|
@ -128,11 +128,11 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
# mine non-standard txs (e.g. txs with "dust" outputs)
|
# mine non-standard txs (e.g. txs with "dust" outputs)
|
||||||
# Force fSendTrickle to true (via whitelist)
|
# Force fSendTrickle to true (via whitelist.noban)
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
["-acceptnonstdtxn", "-whitelist=127.0.0.1"],
|
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1"],
|
||||||
["-acceptnonstdtxn", "-whitelist=127.0.0.1", "-blockmaxweight=68000"],
|
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1", "-blockmaxweight=68000"],
|
||||||
["-acceptnonstdtxn", "-whitelist=127.0.0.1", "-blockmaxweight=32000"],
|
["-acceptnonstdtxn", "-whitelist=noban@127.0.0.1", "-blockmaxweight=32000"],
|
||||||
]
|
]
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
|
|
|
@ -140,10 +140,9 @@ class MaxUploadTest(BitcoinTestFramework):
|
||||||
|
|
||||||
self.nodes[0].disconnect_p2ps()
|
self.nodes[0].disconnect_p2ps()
|
||||||
|
|
||||||
#stop and start node 0 with 1MB maxuploadtarget, whitelist 127.0.0.1
|
self.log.info("Restarting node 0 with noban permission and 1MB maxuploadtarget")
|
||||||
self.log.info("Restarting nodes with -whitelist=127.0.0.1")
|
|
||||||
self.stop_node(0)
|
self.stop_node(0)
|
||||||
self.start_node(0, ["-whitelist=127.0.0.1", "-maxuploadtarget=1"])
|
self.start_node(0, ["-whitelist=noban@127.0.0.1", "-maxuploadtarget=1"])
|
||||||
|
|
||||||
# Reconnect to self.nodes[0]
|
# Reconnect to self.nodes[0]
|
||||||
self.nodes[0].add_p2p_connection(TestP2PConn())
|
self.nodes[0].add_p2p_connection(TestP2PConn())
|
||||||
|
|
|
@ -41,7 +41,10 @@ class NULLDUMMYTest(BitcoinTestFramework):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
# This script tests NULLDUMMY activation, which is part of the 'segwit' deployment, so we go through
|
# This script tests NULLDUMMY activation, which is part of the 'segwit' deployment, so we go through
|
||||||
# normal segwit activation here (and don't use the default always-on behaviour).
|
# normal segwit activation here (and don't use the default always-on behaviour).
|
||||||
self.extra_args = [['-whitelist=127.0.0.1', '-segwitheight=432', '-addresstype=legacy']]
|
self.extra_args = [[
|
||||||
|
'-segwitheight=432',
|
||||||
|
'-addresstype=legacy',
|
||||||
|
]]
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
|
@ -22,7 +22,7 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.extra_args = [["-whitelist=127.0.0.1"]]
|
self.extra_args = [["-whitelist=noban@127.0.0.1"]]
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
# Add p2p connection to node0
|
# Add p2p connection to node0
|
||||||
|
|
|
@ -188,9 +188,9 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
self.num_nodes = 3
|
self.num_nodes = 3
|
||||||
# This test tests SegWit both pre and post-activation, so use the normal BIP9 activation.
|
# This test tests SegWit both pre and post-activation, so use the normal BIP9 activation.
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
["-whitelist=127.0.0.1", "-acceptnonstdtxn=1", "-segwitheight={}".format(SEGWIT_HEIGHT)],
|
["-acceptnonstdtxn=1", "-segwitheight={}".format(SEGWIT_HEIGHT), "-whitelist=noban@127.0.0.1"],
|
||||||
["-whitelist=127.0.0.1", "-acceptnonstdtxn=0", "-segwitheight={}".format(SEGWIT_HEIGHT)],
|
["-acceptnonstdtxn=0", "-segwitheight={}".format(SEGWIT_HEIGHT)],
|
||||||
["-whitelist=127.0.0.1", "-acceptnonstdtxn=1", "-segwitheight=-1"]
|
["-acceptnonstdtxn=1", "-segwitheight=-1"],
|
||||||
]
|
]
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
# This test isn't testing tx relay. Set whitelist on the peers for
|
# This test isn't testing tx relay. Set whitelist on the peers for
|
||||||
# instant tx relay.
|
# instant tx relay.
|
||||||
self.extra_args = [['-whitelist=127.0.0.1']] * self.num_nodes
|
self.extra_args = [['-whitelist=noban@127.0.0.1']] * self.num_nodes
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
|
@ -82,7 +82,7 @@ class AddressTypeTest(BitcoinTestFramework):
|
||||||
]
|
]
|
||||||
# whitelist all peers to speed up tx relay / mempool sync
|
# whitelist all peers to speed up tx relay / mempool sync
|
||||||
for args in self.extra_args:
|
for args in self.extra_args:
|
||||||
args.append("-whitelist=127.0.0.1")
|
args.append("-whitelist=noban@127.0.0.1")
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
|
|
|
@ -70,7 +70,7 @@ class AvoidReuseTest(BitcoinTestFramework):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
# This test isn't testing txn relay/timing, so set whitelist on the
|
# This test isn't testing txn relay/timing, so set whitelist on the
|
||||||
# peers for instant txn relay. This speeds up the test run time 2-3x.
|
# peers for instant txn relay. This speeds up the test run time 2-3x.
|
||||||
self.extra_args = [["-whitelist=127.0.0.1"]] * self.num_nodes
|
self.extra_args = [["-whitelist=noban@127.0.0.1"]] * self.num_nodes
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
def skip_test_if_missing_module(self):
|
||||||
self.skip_if_no_wallet()
|
self.skip_if_no_wallet()
|
||||||
|
|
|
@ -50,10 +50,10 @@ class WalletBackupTest(BitcoinTestFramework):
|
||||||
# nodes 1, 2,3 are spenders, let's give them a keypool=100
|
# nodes 1, 2,3 are spenders, let's give them a keypool=100
|
||||||
# whitelist all peers to speed up tx relay / mempool sync
|
# whitelist all peers to speed up tx relay / mempool sync
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
["-keypool=100", "-whitelist=127.0.0.1"],
|
["-whitelist=noban@127.0.0.1", "-keypool=100"],
|
||||||
["-keypool=100", "-whitelist=127.0.0.1"],
|
["-whitelist=noban@127.0.0.1", "-keypool=100"],
|
||||||
["-keypool=100", "-whitelist=127.0.0.1"],
|
["-whitelist=noban@127.0.0.1", "-keypool=100"],
|
||||||
["-whitelist=127.0.0.1"]
|
["-whitelist=noban@127.0.0.1"],
|
||||||
]
|
]
|
||||||
self.rpc_timeout = 120
|
self.rpc_timeout = 120
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue