Skip to content

Commit 830dc2d

Browse files
committed
test: rpc_users: Also test rpcauth.py with specified password.
1 parent c73d871 commit 830dc2d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/functional/rpc_users.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,21 @@ def setup_chain(self):
4040
super().setup_chain()
4141
#Append rpcauth to bitcoin.conf before initialization
4242
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
43-
rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e"
4443
rpcuser = "rpcuser=rpcuser💻"
4544
rpcpassword = "rpcpassword=rpcpassword🔑"
4645

47-
self.user = ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10))
4846
config = configparser.ConfigParser()
4947
config.read_file(open(self.options.configfile))
5048
gen_rpcauth = config['environment']['RPCAUTH']
49+
50+
# Generate RPCAUTH with specified password
51+
self.rt2password = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI="
52+
p = subprocess.Popen([sys.executable, gen_rpcauth, 'rt2', self.rt2password], stdout=subprocess.PIPE, universal_newlines=True)
53+
lines = p.stdout.read().splitlines()
54+
rpcauth2 = lines[1]
55+
56+
# Generate RPCAUTH without specifying password
57+
self.user = ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10))
5158
p = subprocess.Popen([sys.executable, gen_rpcauth, self.user], stdout=subprocess.PIPE, universal_newlines=True)
5259
lines = p.stdout.read().splitlines()
5360
rpcauth3 = lines[1]
@@ -82,11 +89,10 @@ def run_test(self):
8289
url = urllib.parse.urlparse(self.nodes[0].url)
8390

8491
password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
85-
password2 = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI="
8692

8793
self.test_auth(self.nodes[0], url.username, url.password)
8894
self.test_auth(self.nodes[0], 'rt', password)
89-
self.test_auth(self.nodes[0], 'rt2', password2)
95+
self.test_auth(self.nodes[0], 'rt2', self.rt2password)
9096
self.test_auth(self.nodes[0], self.user, self.password)
9197

9298
###############################################################

0 commit comments

Comments
 (0)