diff options
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-x | test/functional/test_framework/mininode.py | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 2 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 12 |
3 files changed, 12 insertions, 4 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 779863df79..166438cf70 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -111,7 +111,7 @@ class P2PConnection(asyncio.Protocol): def is_connected(self): return self._transport is not None - def peer_connect(self, dstaddr, dstport, net="regtest"): + def peer_connect(self, dstaddr, dstport, *, net): assert not self.is_connected self.dstaddr = dstaddr self.dstport = dstport diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index df027397d2..16553367a7 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -480,7 +480,7 @@ class TestNode(): if 'dstaddr' not in kwargs: kwargs['dstaddr'] = '127.0.0.1' - p2p_conn.peer_connect(**kwargs)() + p2p_conn.peer_connect(**kwargs, net=self.chain)() self.p2ps.append(p2p_conn) if wait_for_verack: p2p_conn.wait_for_verack() diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 3d9be0d0a6..7e8020cceb 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -283,14 +283,22 @@ def initialize_datadir(dirname, n, chain): datadir = get_datadir_path(dirname, n) if not os.path.isdir(datadir): os.makedirs(datadir) + # Translate chain name to config name + if chain == 'testnet3': + chain_name_conf_arg = 'testnet' + chain_name_conf_section = 'test' + else: + chain_name_conf_arg = chain + chain_name_conf_section = chain with open(os.path.join(datadir, "bitcoin.conf"), 'w', encoding='utf8') as f: - f.write("{}=1\n".format(chain)) - f.write("[{}]\n".format(chain)) + f.write("{}=1\n".format(chain_name_conf_arg)) + f.write("[{}]\n".format(chain_name_conf_section)) f.write("port=" + str(p2p_port(n)) + "\n") f.write("rpcport=" + str(rpc_port(n)) + "\n") f.write("server=1\n") f.write("keypool=1\n") f.write("discover=0\n") + f.write("dnsseed=0\n") f.write("listenonion=0\n") f.write("printtoconsole=0\n") os.makedirs(os.path.join(datadir, 'stderr'), exist_ok=True) |