Skip to content

Commit 438e94d

Browse files
committed
remove root test directory for RPC tests
1 parent 6f939c9 commit 438e94d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qa/rpc-tests/test_framework/test_framework.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def main(self):
125125
self.add_options(parser)
126126
(self.options, self.args) = parser.parse_args()
127127

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)
129130

130131
if self.options.trace_rpc:
131132
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
@@ -176,6 +177,8 @@ def main(self):
176177
if not self.options.nocleanup and not self.options.noshutdown and success:
177178
print("Cleaning up")
178179
shutil.rmtree(self.options.tmpdir)
180+
if not os.listdir(self.options.root):
181+
os.rmdir(self.options.root)
179182
else:
180183
print("Not cleaning up dir %s" % self.options.tmpdir)
181184

0 commit comments

Comments
 (0)