Tests: Allow specifying different cmd-line params for each masternode (#3222)
This commit is contained in:
parent
9dad60386c
commit
08f447af92
@ -38,7 +38,7 @@ class TestNode(NodeConnCB):
|
|||||||
|
|
||||||
class LLMQCoinbaseCommitmentsTest(DashTestFramework):
|
class LLMQCoinbaseCommitmentsTest(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.test_node = TestNode()
|
self.test_node = TestNode()
|
||||||
|
@ -18,7 +18,7 @@ Checks LLMQs based ChainLocks
|
|||||||
|
|
||||||
class LLMQChainLocksTest(DashTestFramework):
|
class LLMQChainLocksTest(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Simulate and check DKG errors
|
|||||||
|
|
||||||
class LLMQDKGErrors(DashTestFramework):
|
class LLMQDKGErrors(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, ["-whitelist=127.0.0.1"], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, [["-whitelist=127.0.0.1"]] * 6, fast_dip3_enforcement=True)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class TestNode(NodeConnCB):
|
|||||||
|
|
||||||
class LLMQ_IS_CL_Conflicts(DashTestFramework):
|
class LLMQ_IS_CL_Conflicts(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True)
|
||||||
#disable_mocktime()
|
#disable_mocktime()
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
@ -18,7 +18,7 @@ Checks LLMQs signing sessions
|
|||||||
|
|
||||||
class LLMQSigningTest(DashTestFramework):
|
class LLMQSigningTest(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ Checks simple PoSe system based on LLMQ commitments
|
|||||||
|
|
||||||
class LLMQSimplePoSeTest(DashTestFramework):
|
class LLMQSimplePoSeTest(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(6, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(6, 5, fast_dip3_enforcement=True)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Tests InstantSend functionality (prevent doublespend for unconfirmed transaction
|
|||||||
|
|
||||||
class InstantSendTest(DashTestFramework):
|
class InstantSendTest(DashTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.set_dash_test_params(9, 5, [], fast_dip3_enforcement=True)
|
self.set_dash_test_params(9, 5, fast_dip3_enforcement=True)
|
||||||
# set sender, receiver, isolated nodes
|
# set sender, receiver, isolated nodes
|
||||||
self.isolated_idx = 1
|
self.isolated_idx = 1
|
||||||
self.receiver_idx = 2
|
self.receiver_idx = 2
|
||||||
|
@ -482,24 +482,26 @@ class MasternodeInfo:
|
|||||||
|
|
||||||
|
|
||||||
class DashTestFramework(BitcoinTestFramework):
|
class DashTestFramework(BitcoinTestFramework):
|
||||||
def set_dash_test_params(self, num_nodes, masterodes_count, extra_args, fast_dip3_enforcement=False):
|
def set_dash_test_params(self, num_nodes, masterodes_count, extra_args=None, fast_dip3_enforcement=False):
|
||||||
self.mn_count = masterodes_count
|
self.mn_count = masterodes_count
|
||||||
self.num_nodes = num_nodes
|
self.num_nodes = num_nodes
|
||||||
self.mninfo = []
|
self.mninfo = []
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.is_network_split = False
|
self.is_network_split = False
|
||||||
# additional args
|
# additional args
|
||||||
|
if extra_args is None:
|
||||||
|
extra_args = [[]] * num_nodes
|
||||||
|
assert_equal(len(extra_args), num_nodes)
|
||||||
self.extra_args = extra_args
|
self.extra_args = extra_args
|
||||||
|
self.extra_args[0] += ["-sporkkey=cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK"]
|
||||||
self.extra_args += ["-sporkkey=cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK"]
|
|
||||||
|
|
||||||
self.fast_dip3_enforcement = fast_dip3_enforcement
|
self.fast_dip3_enforcement = fast_dip3_enforcement
|
||||||
if fast_dip3_enforcement:
|
if fast_dip3_enforcement:
|
||||||
self.extra_args += ["-dip3params=30:50"]
|
for i in range(0, num_nodes):
|
||||||
|
self.extra_args[i] += ["-dip3params=30:50"]
|
||||||
|
|
||||||
def create_simple_node(self):
|
def create_simple_node(self):
|
||||||
idx = len(self.nodes)
|
idx = len(self.nodes)
|
||||||
self.add_nodes(1, extra_args=[self.extra_args])
|
self.add_nodes(1, extra_args=[self.extra_args[idx]])
|
||||||
self.start_node(idx)
|
self.start_node(idx)
|
||||||
for i in range(0, idx):
|
for i in range(0, idx):
|
||||||
connect_nodes(self.nodes[i], idx)
|
connect_nodes(self.nodes[i], idx)
|
||||||
@ -574,7 +576,7 @@ class DashTestFramework(BitcoinTestFramework):
|
|||||||
executor = ThreadPoolExecutor(max_workers=20)
|
executor = ThreadPoolExecutor(max_workers=20)
|
||||||
|
|
||||||
def do_start(idx):
|
def do_start(idx):
|
||||||
args = ['-masternodeblsprivkey=%s' % self.mninfo[idx].keyOperator] + self.extra_args
|
args = ['-masternodeblsprivkey=%s' % self.mninfo[idx].keyOperator] + self.extra_args[idx + start_idx]
|
||||||
self.start_node(idx + start_idx, extra_args=args)
|
self.start_node(idx + start_idx, extra_args=args)
|
||||||
self.mninfo[idx].nodeIdx = idx + start_idx
|
self.mninfo[idx].nodeIdx = idx + start_idx
|
||||||
self.mninfo[idx].node = self.nodes[idx + start_idx]
|
self.mninfo[idx].node = self.nodes[idx + start_idx]
|
||||||
@ -608,7 +610,7 @@ class DashTestFramework(BitcoinTestFramework):
|
|||||||
|
|
||||||
def setup_network(self):
|
def setup_network(self):
|
||||||
self.log.info("Creating and starting controller node")
|
self.log.info("Creating and starting controller node")
|
||||||
self.add_nodes(1, extra_args=[self.extra_args])
|
self.add_nodes(1, extra_args=[self.extra_args[0]])
|
||||||
self.start_node(0)
|
self.start_node(0)
|
||||||
required_balance = MASTERNODE_COLLATERAL * self.mn_count + 1
|
required_balance = MASTERNODE_COLLATERAL * self.mn_count + 1
|
||||||
self.log.info("Generating %d coins" % required_balance)
|
self.log.info("Generating %d coins" % required_balance)
|
||||||
|
Loading…
Reference in New Issue
Block a user