Skip to content

Commit fad1845

Browse files
author
MarcoFalke
committed
[qa] test_framework: Use different rpc_auth_pair for each node
1 parent e2bf830 commit fad1845

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

qa/rpc-tests/test_framework/util.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,22 @@ def initialize_datadir(dirname, n):
150150
datadir = os.path.join(dirname, "node"+str(n))
151151
if not os.path.isdir(datadir):
152152
os.makedirs(datadir)
153+
rpc_u, rpc_p = rpc_auth_pair(n)
153154
with open(os.path.join(datadir, "bitcoin.conf"), 'w') as f:
154155
f.write("regtest=1\n")
155-
f.write("rpcuser=rt\n")
156-
f.write("rpcpassword=rt\n")
156+
f.write("rpcuser=" + rpc_u + "\n")
157+
f.write("rpcpassword=" + rpc_p + "\n")
157158
f.write("port="+str(p2p_port(n))+"\n")
158159
f.write("rpcport="+str(rpc_port(n))+"\n")
159160
f.write("listenonion=0\n")
160161
return datadir
161162

163+
def rpc_auth_pair(n):
164+
return 'rpcuser💻' + str(n), 'rpcpass🔑' + str(n)
165+
162166
def rpc_url(i, rpchost=None):
163-
return "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i))
167+
rpc_u, rpc_p = rpc_auth_pair(i)
168+
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, rpchost or '127.0.0.1', rpc_port(i))
164169

165170
def wait_for_bitcoind_start(process, url, i):
166171
'''

0 commit comments

Comments
 (0)