aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2019-07-03 14:56:28 -0400
committerCarl Dong <contact@carldong.me>2019-07-08 16:13:34 -0400
commit830dc2dd0fccb7f3ec49ff7233a188d92c541e7e (patch)
treec53422d54408ac46f790c3c2c32f886f1c452d09 /test
parentc73d871799982ca29c29cef90e1a78814cf34019 (diff)
test: rpc_users: Also test rpcauth.py with specified password.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_users.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py
index be21c837f4..2d06c95497 100755
--- a/test/functional/rpc_users.py
+++ b/test/functional/rpc_users.py
@@ -40,14 +40,21 @@ class HTTPBasicsTest(BitcoinTestFramework):
super().setup_chain()
#Append rpcauth to bitcoin.conf before initialization
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
- rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e"
rpcuser = "rpcuser=rpcuser💻"
rpcpassword = "rpcpassword=rpcpassword🔑"
- self.user = ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10))
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
gen_rpcauth = config['environment']['RPCAUTH']
+
+ # Generate RPCAUTH with specified password
+ self.rt2password = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI="
+ p = subprocess.Popen([sys.executable, gen_rpcauth, 'rt2', self.rt2password], stdout=subprocess.PIPE, universal_newlines=True)
+ lines = p.stdout.read().splitlines()
+ rpcauth2 = lines[1]
+
+ # Generate RPCAUTH without specifying password
+ self.user = ''.join(SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(10))
p = subprocess.Popen([sys.executable, gen_rpcauth, self.user], stdout=subprocess.PIPE, universal_newlines=True)
lines = p.stdout.read().splitlines()
rpcauth3 = lines[1]
@@ -82,11 +89,10 @@ class HTTPBasicsTest(BitcoinTestFramework):
url = urllib.parse.urlparse(self.nodes[0].url)
password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
- password2 = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI="
self.test_auth(self.nodes[0], url.username, url.password)
self.test_auth(self.nodes[0], 'rt', password)
- self.test_auth(self.nodes[0], 'rt2', password2)
+ self.test_auth(self.nodes[0], 'rt2', self.rt2password)
self.test_auth(self.nodes[0], self.user, self.password)
###############################################################