diff options
author | Suhas Daftuar <sdaftuar@gmail.com> | 2018-04-09 14:07:47 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2018-04-09 14:35:09 -0400 |
commit | 75d0e4c5444249f0cf81ed0494e2c2717170b695 (patch) | |
tree | ff787d226b0b904a08bef79e3d5af3ff3420ec7c /test/functional/test_framework/test_node.py | |
parent | 2b54155a459c235626fddc4495bb681b93d3dbc5 (diff) | |
download | bitcoin-75d0e4c5444249f0cf81ed0494e2c2717170b695.tar.xz |
[qa] Delete cookie file before starting node
If a cookie file exists in a datadir prior to node startup, it must have
been leftover from a prior unclean shutdown. As bitcoind will overwrite
it anyway, delete it before starting up to prevent the test framework
from inadvertently trying to connect using stale credentials.
Diffstat (limited to 'test/functional/test_framework/test_node.py')
-rwxr-xr-x | test/functional/test_framework/test_node.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 4a4ab046c5..9436ae0d3a 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -20,6 +20,7 @@ from .authproxy import JSONRPCException from .util import ( append_config, assert_equal, + delete_cookie_file, get_rpc_proxy, rpc_url, wait_until, @@ -105,6 +106,10 @@ class TestNode(): extra_args = self.extra_args if stderr is None: stderr = self.stderr + # Delete any existing cookie file -- if such a file exists (eg due to + # unclean shutdown), it will get overwritten anyway by bitcoind, and + # potentially interfere with our attempt to authenticate + delete_cookie_file(self.datadir) self.process = subprocess.Popen(self.args + extra_args, stderr=stderr, *args, **kwargs) self.running = True self.log.debug("bitcoind started, waiting for RPC to come up") |