@@ -39,9 +39,11 @@ def set_test_params(self):
39
39
def setup_chain (self ):
40
40
super ().setup_chain ()
41
41
#Append rpcauth to bitcoin.conf before initialization
42
+ self .rtpassword = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
42
43
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
43
- rpcuser = "rpcuser=rpcuser💻"
44
- rpcpassword = "rpcpassword=rpcpassword🔑"
44
+
45
+ self .rpcuser = "rpcuser💻"
46
+ self .rpcpassword = "rpcpassword🔑"
45
47
46
48
config = configparser .ConfigParser ()
47
49
config .read_file (open (self .options .configfile ))
@@ -65,8 +67,8 @@ def setup_chain(self):
65
67
f .write (rpcauth2 + "\n " )
66
68
f .write (rpcauth3 + "\n " )
67
69
with open (os .path .join (get_datadir_path (self .options .tmpdir , 1 ), "bitcoin.conf" ), 'a' , encoding = 'utf8' ) as f :
68
- f .write (rpcuser + " \n " )
69
- f .write (rpcpassword + " \n " )
70
+ f .write ("rpcuser={} \n ". format ( self . rpcuser ) )
71
+ f .write ("rpcpassword={} \n ". format ( self . rpcpassword ) )
70
72
71
73
def test_auth (self , node , user , password ):
72
74
self .log .info ('Correct...' )
@@ -88,10 +90,8 @@ def run_test(self):
88
90
##################################################
89
91
url = urllib .parse .urlparse (self .nodes [0 ].url )
90
92
91
- password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
92
-
93
93
self .test_auth (self .nodes [0 ], url .username , url .password )
94
- self .test_auth (self .nodes [0 ], 'rt' , password )
94
+ self .test_auth (self .nodes [0 ], 'rt' , self . rtpassword )
95
95
self .test_auth (self .nodes [0 ], 'rt2' , self .rt2password )
96
96
self .test_auth (self .nodes [0 ], self .user , self .password )
97
97
@@ -100,7 +100,7 @@ def run_test(self):
100
100
###############################################################
101
101
url = urllib .parse .urlparse (self .nodes [1 ].url )
102
102
103
- self .test_auth (self .nodes [1 ], " rpcuser💻" , " rpcpassword🔑" )
103
+ self .test_auth (self .nodes [1 ], self . rpcuser , self . rpcpassword )
104
104
105
105
if __name__ == '__main__' :
106
106
HTTPBasicsTest ().main ()
0 commit comments