aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorChun Kuan Lee <ken2812221@gmail.com>2018-11-24 02:32:38 +0800
committerChun Kuan Lee <ken2812221@gmail.com>2018-11-24 02:32:38 +0800
commitd6b3790d1a41030f4ac83556fdbe9f019b9b4e59 (patch)
tree35c6633e402295f6b279f27aa9538fd5189257ee /test/functional
parent2607c38fc5170409dd13f3061ba5e5fa2de6438d (diff)
tests: check readability of cookie file
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/test_framework/util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index b355816d8b..d0a78d8dfd 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -326,7 +326,7 @@ def get_auth_cookie(datadir):
if line.startswith("rpcpassword="):
assert password is None # Ensure that there is only one rpcpassword line
password = line.split("=")[1].strip("\n")
- if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")):
+ if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")) and os.access(os.path.join(datadir, "regtest", ".cookie"), os.R_OK):
with open(os.path.join(datadir, "regtest", ".cookie"), 'r', encoding="ascii") as f:
userpass = f.read()
split_userpass = userpass.split(':')