Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_users.py
Show All 29 Lines | def setup_chain(self): | ||||
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144" | rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144" | ||||
rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e" | rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e" | ||||
rpcuser = "rpcuser=rpcuser💻" | rpcuser = "rpcuser=rpcuser💻" | ||||
rpcpassword = "rpcpassword=rpcpassword🔑" | rpcpassword = "rpcpassword=rpcpassword🔑" | ||||
self.user = ''.join(SystemRandom().choice( | self.user = ''.join(SystemRandom().choice( | ||||
string.ascii_letters + string.digits) for _ in range(10)) | string.ascii_letters + string.digits) for _ in range(10)) | ||||
config = configparser.ConfigParser() | config = configparser.ConfigParser() | ||||
config.read_file(open(self.options.configfile)) | config.read_file(open(self.options.configfile, encoding='utf-8')) | ||||
gen_rpcauth = config['environment']['RPCAUTH'] | gen_rpcauth = config['environment']['RPCAUTH'] | ||||
p = subprocess.Popen([gen_rpcauth, self.user], | p = subprocess.Popen([gen_rpcauth, self.user], | ||||
stdout=subprocess.PIPE, universal_newlines=True) | stdout=subprocess.PIPE, universal_newlines=True) | ||||
lines = p.stdout.read().splitlines() | lines = p.stdout.read().splitlines() | ||||
rpcauth3 = lines[1] | rpcauth3 = lines[1] | ||||
self.password = lines[3] | self.password = lines[3] | ||||
with open(os.path.join(get_datadir_path(self.options.tmpdir, 0), "bitcoin.conf"), 'a', encoding='utf8') as f: | with open(os.path.join(get_datadir_path(self.options.tmpdir, 0), "bitcoin.conf"), 'a', encoding='utf8') as f: | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |