Skip to content

Commit 65c2058

Browse files
committed
Merge #8066: [qa] test_framework: Use different rpc_auth_pair for each node
fad1845 [qa] test_framework: Use different rpc_auth_pair for each node (MarcoFalke)
2 parents 12a541e + fad1845 commit 65c2058

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
@@ -156,17 +156,22 @@ def initialize_datadir(dirname, n):
156156
datadir = os.path.join(dirname, "node"+str(n))
157157
if not os.path.isdir(datadir):
158158
os.makedirs(datadir)
159+
rpc_u, rpc_p = rpc_auth_pair(n)
159160
with open(os.path.join(datadir, "bitcoin.conf"), 'w') as f:
160161
f.write("regtest=1\n")
161-
f.write("rpcuser=rt\n")
162-
f.write("rpcpassword=rt\n")
162+
f.write("rpcuser=" + rpc_u + "\n")
163+
f.write("rpcpassword=" + rpc_p + "\n")
163164
f.write("port="+str(p2p_port(n))+"\n")
164165
f.write("rpcport="+str(rpc_port(n))+"\n")
165166
f.write("listenonion=0\n")
166167
return datadir
167168

169+
def rpc_auth_pair(n):
170+
return 'rpcuser💻' + str(n), 'rpcpass🔑' + str(n)
171+
168172
def rpc_url(i, rpchost=None):
169-
return "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i))
173+
rpc_u, rpc_p = rpc_auth_pair(i)
174+
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, rpchost or '127.0.0.1', rpc_port(i))
170175

171176
def wait_for_bitcoind_start(process, url, i):
172177
'''

0 commit comments

Comments
 (0)