Skip to content

Commit

Permalink
[Tests] Cover startmasternode all option
Browse files Browse the repository at this point in the history
Adds a method to start multiple MNs with a single command, adding code
coverage to the more 'heavy-lifter' portion of the startmasternode
command.
  • Loading branch information
Fuzzbawls committed Apr 1, 2023
1 parent 189f263 commit 815bbc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,14 @@ def controller_start_masternode(self, mnOwner, masternodeAlias):
time.sleep(1)


def controller_start_masternodes(self, mnOwner, aliases=[]):
ret = mnOwner.startmasternode(set="all", lock_wallet=False, reload_conf=True)
for i in range(len(aliases)):
assert_equal(ret["detail"][i]["alias"], aliases[i])
assert_equal(ret["detail"][i]["result"], "success")
time.sleep(1)


def send_pings(self, mnodes):
for node in mnodes:
try:
Expand Down
3 changes: 1 addition & 2 deletions test/functional/tiertwo_governance_reorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def run_test(self):
mn2.initmasternode(self.mnTwoPrivkey, "127.0.0.1:"+str(remoteTwoPort))
self.stake_and_ping(self.minerAPos, 1, [])
self.wait_until_mnsync_finished()
self.controller_start_masternode(minerA, self.masternodeOneAlias)
self.controller_start_masternode(minerA, self.masternodeTwoAlias)
self.controller_start_masternodes(minerA, [self.masternodeOneAlias, self.masternodeTwoAlias])
self.wait_until_mn_preenabled(self.mnOneCollateral.hash, 40)
self.wait_until_mn_preenabled(self.mnOneCollateral.hash, 40)
self.send_3_pings([mn1, mn2])
Expand Down

0 comments on commit 815bbc2

Please sign in to comment.