From 6c0b5053bcc58b5518bd699c8fb2938fbce14b6b Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 4 Jul 2019 17:48:01 +0300 Subject: [PATCH] Fix start_/stop_node-s --- test/functional/addressindex.py | 8 ++++---- test/functional/dip3-deterministicmns.py | 2 +- test/functional/fundrawtransaction-hd.py | 6 +++--- test/functional/llmq-chainlocks.py | 2 +- test/functional/multikeysporks.py | 10 +++++----- test/functional/p2p-fingerprint.py | 3 +-- test/functional/spentindex.py | 8 ++++---- test/functional/sporks.py | 4 ++-- test/functional/test_framework/test_framework.py | 6 +++--- test/functional/timestampindex.py | 8 ++++---- test/functional/txindex.py | 8 ++++---- test/functional/wallet-hd.py | 2 +- 12 files changed, 33 insertions(+), 34 deletions(-) diff --git a/test/functional/addressindex.py b/test/functional/addressindex.py index fdf4c39349..9cabdfa31f 100755 --- a/test/functional/addressindex.py +++ b/test/functional/addressindex.py @@ -23,11 +23,11 @@ class AddressIndexTest(BitcoinTestFramework): def setup_network(self): self.nodes = [] # Nodes 0/1 are "wallet" nodes - self.nodes.append(start_node(0, self.options.tmpdir, ["-relaypriority=0"])) - self.nodes.append(start_node(1, self.options.tmpdir, ["-addressindex"])) + self.nodes.append(self.start_node(0, self.options.tmpdir, ["-relaypriority=0"])) + self.nodes.append(self.start_node(1, self.options.tmpdir, ["-addressindex"])) # Nodes 2/3 are used for testing - self.nodes.append(start_node(2, self.options.tmpdir, ["-addressindex", "-relaypriority=0"])) - self.nodes.append(start_node(3, self.options.tmpdir, ["-addressindex"])) + self.nodes.append(self.start_node(2, self.options.tmpdir, ["-addressindex", "-relaypriority=0"])) + self.nodes.append(self.start_node(3, self.options.tmpdir, ["-addressindex"])) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) diff --git a/test/functional/dip3-deterministicmns.py b/test/functional/dip3-deterministicmns.py index 4f980a8f67..99403686d7 100755 --- a/test/functional/dip3-deterministicmns.py +++ b/test/functional/dip3-deterministicmns.py @@ -45,7 +45,7 @@ class DIP3Test(BitcoinTestFramework): def stop_controller_node(self): self.log.info("stopping controller node") - self.stop_node(self.nodes[0], 0) + self.stop_node(0) def restart_controller_node(self): self.stop_controller_node() diff --git a/test/functional/fundrawtransaction-hd.py b/test/functional/fundrawtransaction-hd.py index 4880d1c8a7..2e50c0cd54 100755 --- a/test/functional/fundrawtransaction-hd.py +++ b/test/functional/fundrawtransaction-hd.py @@ -437,11 +437,11 @@ class RawTransactionsTest(BitcoinTestFramework): ############################################################ # locked wallet test + self.stop_node(0) + self.stop_node(2) + self.stop_node(3) self.nodes[1].encryptwallet("test") self.nodes.pop(1) - self.stop_node(self.nodes[0], 0) - self.stop_node(self.nodes[1], 2) - self.stop_node(self.nodes[2], 3) self.nodes = self.start_nodes(4, self.options.tmpdir, [['-usehd=1']] * self.num_nodes, stderr=sys.stdout) # This test is not meant to test fee estimation and we'd like diff --git a/test/functional/llmq-chainlocks.py b/test/functional/llmq-chainlocks.py index ab85a9d747..cca1f90741 100755 --- a/test/functional/llmq-chainlocks.py +++ b/test/functional/llmq-chainlocks.py @@ -71,7 +71,7 @@ class LLMQChainLocksTest(DashTestFramework): # Keep node connected and let it try to reorg the chain good_tip = self.nodes[0].getbestblockhash() # Restart it so that it forgets all the chainlocks from the past - self.stop_node(self.nodes[0], 0) + self.stop_node(0) self.nodes[0] = self.start_node(0, self.options.tmpdir, self.extra_args) connect_nodes(self.nodes[0], 1) self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) diff --git a/test/functional/multikeysporks.py b/test/functional/multikeysporks.py index e6bb77eb19..df1764b060 100755 --- a/test/functional/multikeysporks.py +++ b/test/functional/multikeysporks.py @@ -50,7 +50,7 @@ class MultiKeySporkTest(BitcoinTestFramework): # keyid(hex): 1d1098b2b1f759b678a0a7a098637a9b898adcac # address(base58): yc5TGfcHYoLCrcbVy4umsiDjsYUn39vLui - self.nodes.append(start_node(0, self.options.tmpdir, + self.nodes.append(self.start_node(0, self.options.tmpdir, ["-sporkkey=931wyuRNVYvhg18Uu9bky5Qg1z4QbxaJ7fefNBzjBPiLRqcd33F", "-sporkaddr=ygcG5S2pQz2U1UAaHvU6EznKZW7yapKMA7", "-sporkaddr=yfLSXFfipnkgYioD6L8aUNyfRgEBuJv48h", @@ -58,7 +58,7 @@ class MultiKeySporkTest(BitcoinTestFramework): "-sporkaddr=ycbRQWbovrhQMTuxg9p4LAuW5SCMAKqPrn", "-sporkaddr=yc5TGfcHYoLCrcbVy4umsiDjsYUn39vLui", "-minsporkkeys=3"])) - self.nodes.append(start_node(1, self.options.tmpdir, + self.nodes.append(self.start_node(1, self.options.tmpdir, ["-sporkkey=91vbXGMSWKGHom62986XtL1q2mQDA12ngcuUNNe5NfMSj44j7g3", "-sporkaddr=ygcG5S2pQz2U1UAaHvU6EznKZW7yapKMA7", "-sporkaddr=yfLSXFfipnkgYioD6L8aUNyfRgEBuJv48h", @@ -66,7 +66,7 @@ class MultiKeySporkTest(BitcoinTestFramework): "-sporkaddr=ycbRQWbovrhQMTuxg9p4LAuW5SCMAKqPrn", "-sporkaddr=yc5TGfcHYoLCrcbVy4umsiDjsYUn39vLui", "-minsporkkeys=3"])) - self.nodes.append(start_node(2, self.options.tmpdir, + self.nodes.append(self.start_node(2, self.options.tmpdir, ["-sporkkey=92bxUjPT5AhgXuXJwfGGXqhomY2SdQ55MYjXyx9DZNxCABCSsRH", "-sporkaddr=ygcG5S2pQz2U1UAaHvU6EznKZW7yapKMA7", "-sporkaddr=yfLSXFfipnkgYioD6L8aUNyfRgEBuJv48h", @@ -74,7 +74,7 @@ class MultiKeySporkTest(BitcoinTestFramework): "-sporkaddr=ycbRQWbovrhQMTuxg9p4LAuW5SCMAKqPrn", "-sporkaddr=yc5TGfcHYoLCrcbVy4umsiDjsYUn39vLui", "-minsporkkeys=3"])) - self.nodes.append(start_node(3, self.options.tmpdir, + self.nodes.append(self.start_node(3, self.options.tmpdir, ["-sporkkey=934yPXiVGf4RCY2qTs2Bt5k3TEtAiAg12sMxCt8yVWbSU7p3fuD", "-sporkaddr=ygcG5S2pQz2U1UAaHvU6EznKZW7yapKMA7", "-sporkaddr=yfLSXFfipnkgYioD6L8aUNyfRgEBuJv48h", @@ -82,7 +82,7 @@ class MultiKeySporkTest(BitcoinTestFramework): "-sporkaddr=ycbRQWbovrhQMTuxg9p4LAuW5SCMAKqPrn", "-sporkaddr=yc5TGfcHYoLCrcbVy4umsiDjsYUn39vLui", "-minsporkkeys=3"])) - self.nodes.append(start_node(4, self.options.tmpdir, + self.nodes.append(self.start_node(4, self.options.tmpdir, ["-sporkkey=92Cxwia363Wg2qGF1fE5z4GKi8u7r1nrWQXdtsj2ACZqaDPSihD", "-sporkaddr=ygcG5S2pQz2U1UAaHvU6EznKZW7yapKMA7", "-sporkaddr=yfLSXFfipnkgYioD6L8aUNyfRgEBuJv48h", diff --git a/test/functional/p2p-fingerprint.py b/test/functional/p2p-fingerprint.py index aae51ea5d3..1e4a86bb7f 100755 --- a/test/functional/p2p-fingerprint.py +++ b/test/functional/p2p-fingerprint.py @@ -26,8 +26,7 @@ from test_framework.mininode import ( from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, - p2p_port, - start_nodes) + p2p_port) class P2PFingerprintTest(BitcoinTestFramework): def __init__(self): diff --git a/test/functional/spentindex.py b/test/functional/spentindex.py index 5147f275b1..57be6f6ba4 100755 --- a/test/functional/spentindex.py +++ b/test/functional/spentindex.py @@ -23,11 +23,11 @@ class SpentIndexTest(BitcoinTestFramework): def setup_network(self): self.nodes = [] # Nodes 0/1 are "wallet" nodes - self.nodes.append(start_node(0, self.options.tmpdir)) - self.nodes.append(start_node(1, self.options.tmpdir, ["-spentindex"])) + self.nodes.append(self.start_node(0, self.options.tmpdir)) + self.nodes.append(self.start_node(1, self.options.tmpdir, ["-spentindex"])) # Nodes 2/3 are used for testing - self.nodes.append(start_node(2, self.options.tmpdir, ["-spentindex"])) - self.nodes.append(start_node(3, self.options.tmpdir, ["-spentindex", "-txindex"])) + self.nodes.append(self.start_node(2, self.options.tmpdir, ["-spentindex"])) + self.nodes.append(self.start_node(3, self.options.tmpdir, ["-spentindex", "-txindex"])) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) diff --git a/test/functional/sporks.py b/test/functional/sporks.py index e6918f2009..b72045bfc1 100755 --- a/test/functional/sporks.py +++ b/test/functional/sporks.py @@ -57,8 +57,8 @@ class SporkTest(BitcoinTestFramework): assert(sent) # restart nodes to check spork persistence - self.stop_node(self.nodes[0], 0) - self.stop_node(self.nodes[1], 1) + self.stop_node(0) + self.stop_node(1) self.nodes[0] = self.start_node(0, self.options.tmpdir) self.nodes[1] = self.start_node(1, self.options.tmpdir) assert(not self.get_test_spork_state(self.nodes[0])) diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 56b4471055..7d6f94cad4 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -407,7 +407,7 @@ class DashTestFramework(BitcoinTestFramework): def create_simple_node(self): idx = len(self.nodes) args = self.extra_args - self.nodes.append(start_node(idx, self.options.tmpdir, args)) + self.nodes.append(self.start_node(idx, self.options.tmpdir, args)) for i in range(0, idx): connect_nodes(self.nodes[i], idx) @@ -458,7 +458,7 @@ class DashTestFramework(BitcoinTestFramework): def prepare_datadirs(self): # stop faucet node so that we can copy the datadir - self.stop_node(self.nodes[0], 0) + self.stop_node(0) start_idx = len(self.nodes) for idx in range(0, self.mn_count): @@ -514,7 +514,7 @@ class DashTestFramework(BitcoinTestFramework): def setup_network(self): self.nodes = [] # create faucet node for collateral and transactions - self.nodes.append(start_node(0, self.options.tmpdir, self.extra_args)) + self.nodes.append(self.start_node(0, self.options.tmpdir, self.extra_args)) required_balance = MASTERNODE_COLLATERAL * self.mn_count + 1 while self.nodes[0].getbalance() < required_balance: set_mocktime(get_mocktime() + 1) diff --git a/test/functional/timestampindex.py b/test/functional/timestampindex.py index 5f615008d8..74db7573b2 100755 --- a/test/functional/timestampindex.py +++ b/test/functional/timestampindex.py @@ -21,11 +21,11 @@ class TimestampIndexTest(BitcoinTestFramework): def setup_network(self): self.nodes = [] # Nodes 0/1 are "wallet" nodes - self.nodes.append(start_node(0, self.options.tmpdir)) - self.nodes.append(start_node(1, self.options.tmpdir, ["-timestampindex"])) + self.nodes.append(self.start_node(0, self.options.tmpdir)) + self.nodes.append(self.start_node(1, self.options.tmpdir, ["-timestampindex"])) # Nodes 2/3 are used for testing - self.nodes.append(start_node(2, self.options.tmpdir)) - self.nodes.append(start_node(3, self.options.tmpdir, ["-timestampindex"])) + self.nodes.append(self.start_node(2, self.options.tmpdir)) + self.nodes.append(self.start_node(3, self.options.tmpdir, ["-timestampindex"])) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) diff --git a/test/functional/txindex.py b/test/functional/txindex.py index 889d2eefc3..f3dc4f211c 100755 --- a/test/functional/txindex.py +++ b/test/functional/txindex.py @@ -23,11 +23,11 @@ class TxIndexTest(BitcoinTestFramework): def setup_network(self): self.nodes = [] # Nodes 0/1 are "wallet" nodes - self.nodes.append(start_node(0, self.options.tmpdir)) - self.nodes.append(start_node(1, self.options.tmpdir, ["-txindex"])) + self.nodes.append(self.start_node(0, self.options.tmpdir)) + self.nodes.append(self.start_node(1, self.options.tmpdir, ["-txindex"])) # Nodes 2/3 are used for testing - self.nodes.append(start_node(2, self.options.tmpdir, ["-txindex"])) - self.nodes.append(start_node(3, self.options.tmpdir, ["-txindex"])) + self.nodes.append(self.start_node(2, self.options.tmpdir, ["-txindex"])) + self.nodes.append(self.start_node(3, self.options.tmpdir, ["-txindex"])) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) diff --git a/test/functional/wallet-hd.py b/test/functional/wallet-hd.py index 40cad94733..292040162a 100755 --- a/test/functional/wallet-hd.py +++ b/test/functional/wallet-hd.py @@ -68,7 +68,7 @@ class WalletHDTest(BitcoinTestFramework): assert_equal(self.nodes[1].getbalance(), num_hd_adds + 1) self.log.info("Restore backup ...") - self.stop_node(self.nodes[1],1) + self.stop_node(1) os.remove(self.options.tmpdir + "/node1/regtest/wallet.dat") shutil.copyfile(tmpdir + "/hd.bak", tmpdir + "/node1/regtest/wallet.dat") self.nodes[1] = self.start_node(1, self.options.tmpdir, self.extra_args[1], stderr=sys.stdout)