File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,8 @@ def main(self):
125
125
self .add_options (parser )
126
126
(self .options , self .args ) = parser .parse_args ()
127
127
128
- self .options .tmpdir += '/' + str (self .options .port_seed )
128
+ # backup dir variable for removal at cleanup
129
+ self .options .root , self .options .tmpdir = self .options .tmpdir , self .options .tmpdir + '/' + str (self .options .port_seed )
129
130
130
131
if self .options .trace_rpc :
131
132
logging .basicConfig (level = logging .DEBUG , stream = sys .stdout )
@@ -176,6 +177,8 @@ def main(self):
176
177
if not self .options .nocleanup and not self .options .noshutdown and success :
177
178
print ("Cleaning up" )
178
179
shutil .rmtree (self .options .tmpdir )
180
+ if not os .listdir (self .options .root ):
181
+ os .rmdir (self .options .root )
179
182
else :
180
183
print ("Not cleaning up dir %s" % self .options .tmpdir )
181
184
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ def run_test (self):
39
39
self .nodes [1 ].importprivkey (self .nodes [0 ].dumpprivkey (non_hd_add ))
40
40
41
41
# This should be enough to keep the master key and the non-HD key
42
- self .nodes [1 ].backupwallet (tmpdir + "hd.bak" )
43
- #self.nodes[1].dumpwallet(tmpdir + "hd.dump")
42
+ self .nodes [1 ].backupwallet (tmpdir + "/ hd.bak" )
43
+ #self.nodes[1].dumpwallet(tmpdir + "/ hd.dump")
44
44
45
45
# Derive some HD addresses and remember the last
46
46
# Also send funds to each add
@@ -63,7 +63,7 @@ def run_test (self):
63
63
print ("Restore backup ..." )
64
64
self .stop_node (1 )
65
65
os .remove (self .options .tmpdir + "/node1/regtest/wallet.dat" )
66
- shutil .copyfile (tmpdir + "hd.bak" , tmpdir + "/node1/regtest/wallet.dat" )
66
+ shutil .copyfile (tmpdir + "/ hd.bak" , tmpdir + "/node1/regtest/wallet.dat" )
67
67
self .nodes [1 ] = start_node (1 , self .options .tmpdir , self .node_args [1 ])
68
68
#connect_nodes_bi(self.nodes, 0, 1)
69
69
You can’t perform that action at this time.
0 commit comments