aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework
diff options
context:
space:
mode:
authorwhythat <yuri.zhykin@gmail.com>2016-09-02 12:38:04 +0300
committerMarcoFalke <falke.marco@gmail.com>2016-09-16 11:28:48 +0200
commit63462c2b4bcd250402b040bc19f2ae39771a62f7 (patch)
tree51d9dea55eab1a10141702e33bec85f5ff5d3ec4 /qa/rpc-tests/test_framework
parent4731623777abfe538190e72305b315b3c251b84e (diff)
downloadbitcoin-63462c2b4bcd250402b040bc19f2ae39771a62f7.tar.xz
[qa] remove root test directory for RPC tests
Github-Pull: #8652 Rebased-From: 438e94dc330a37600ec1d86f2ba8502385b5262d c62cc4ec759a8487373f158b3cbb888efcdd753a
Diffstat (limited to 'qa/rpc-tests/test_framework')
-rwxr-xr-xqa/rpc-tests/test_framework/test_framework.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py
index 0dfece6b27..306f31102b 100755
--- a/qa/rpc-tests/test_framework/test_framework.py
+++ b/qa/rpc-tests/test_framework/test_framework.py
@@ -123,7 +123,8 @@ class BitcoinTestFramework(object):
self.add_options(parser)
(self.options, self.args) = parser.parse_args()
- self.options.tmpdir += '/' + str(self.options.port_seed)
+ # backup dir variable for removal at cleanup
+ self.options.root, self.options.tmpdir = self.options.tmpdir, self.options.tmpdir + '/' + str(self.options.port_seed)
if self.options.trace_rpc:
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
@@ -174,6 +175,8 @@ class BitcoinTestFramework(object):
if not self.options.nocleanup and not self.options.noshutdown and success:
print("Cleaning up")
shutil.rmtree(self.options.tmpdir)
+ if not os.listdir(self.options.root):
+ os.rmdir(self.options.root)
else:
print("Not cleaning up dir %s" % self.options.tmpdir)