Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 788 Lines • ▼ Show 20 Lines | def _initialize_chain(self): | ||||
self.nodes = [] | self.nodes = [] | ||||
def cache_path(*paths): | def cache_path(*paths): | ||||
return os.path.join(cache_node_dir, self.chain, *paths) | return os.path.join(cache_node_dir, self.chain, *paths) | ||||
# Remove empty wallets dir | # Remove empty wallets dir | ||||
os.rmdir(cache_path('wallets')) | os.rmdir(cache_path('wallets')) | ||||
for entry in os.listdir(cache_path()): | for entry in os.listdir(cache_path()): | ||||
# Only keep chainstate and blocks folder | # Only keep indexes, chainstate and blocks folders | ||||
if entry not in ['chainstate', 'blocks']: | if entry not in ['chainstate', 'blocks', 'indexes']: | ||||
os.remove(cache_path(entry)) | os.remove(cache_path(entry)) | ||||
for i in range(self.num_nodes): | for i in range(self.num_nodes): | ||||
self.log.debug( | self.log.debug( | ||||
"Copy cache directory {} to node {}".format( | "Copy cache directory {} to node {}".format( | ||||
cache_node_dir, i)) | cache_node_dir, i)) | ||||
to_dir = get_datadir_path(self.options.tmpdir, i) | to_dir = get_datadir_path(self.options.tmpdir, i) | ||||
shutil.copytree(cache_node_dir, to_dir) | shutil.copytree(cache_node_dir, to_dir) | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |