Fix start_/stop_node-s

This commit is contained in:
UdjinM6 2019-07-04 17:48:01 +03:00 committed by Pasta
parent 493f4336a3
commit 6c0b5053bc
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE
12 changed files with 33 additions and 34 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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

View File

@ -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())

View File

@ -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",

View File

@ -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):

View File

@ -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)

View File

@ -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]))

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)