mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
Merge bitcoin/bitcoin#24381: test: Run symlink regression tests on Windows
fad7ddf9e3
test: Run symlink regression tests on Windows (MarcoFalke) Pull request description: Seems odd to add tests, but not run them on the platform that needs them most. ACKs for top commit: laanwj: Code review ACKfad7ddf9e3
ryanofsky: Code review ACKfad7ddf9e3
, just removing new test. Would be nice if the test could be added later, of course. Tree-SHA512: 64b235967a38c2eb90657e8d7a0447bcc8ce81d1b75a275b6c48bd42efd9ea7e7939257e484f297ee84598def3738eaeb289561aeba1dd6a99b258d389995139
This commit is contained in:
commit
358fe779cb
@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(rename)
|
|||||||
fs::remove(path2);
|
fs::remove(path2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef __MINGW64__ // no symlinks on mingw
|
||||||
BOOST_AUTO_TEST_CASE(create_directories)
|
BOOST_AUTO_TEST_CASE(create_directories)
|
||||||
{
|
{
|
||||||
// Test fs::create_directories workaround.
|
// Test fs::create_directories workaround.
|
||||||
@ -174,6 +174,6 @@ BOOST_AUTO_TEST_CASE(create_directories)
|
|||||||
fs::remove(symlink);
|
fs::remove(symlink);
|
||||||
fs::remove(dir);
|
fs::remove(dir);
|
||||||
}
|
}
|
||||||
#endif // WIN32
|
#endif // __MINGW64__
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
from test_framework.test_framework import BitcoinTestFramework, SkipTest
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
|
|
||||||
|
|
||||||
def rename_and_link(*, from_name, to_name):
|
def rename_and_link(*, from_name, to_name):
|
||||||
@ -16,24 +15,27 @@ def rename_and_link(*, from_name, to_name):
|
|||||||
os.symlink(to_name, from_name)
|
os.symlink(to_name, from_name)
|
||||||
assert os.path.islink(from_name) and os.path.isdir(from_name)
|
assert os.path.islink(from_name) and os.path.isdir(from_name)
|
||||||
|
|
||||||
class SymlinkTest(BitcoinTestFramework):
|
|
||||||
def skip_test_if_missing_module(self):
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
raise SkipTest("Symlinks test skipped on Windows")
|
|
||||||
|
|
||||||
|
class SymlinkTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
dir_new_blocks = self.nodes[0].chain_path / "new_blocks"
|
||||||
|
dir_new_chainstate = self.nodes[0].chain_path / "new_chainstate"
|
||||||
self.stop_node(0)
|
self.stop_node(0)
|
||||||
|
|
||||||
rename_and_link(from_name=os.path.join(self.nodes[0].datadir, self.chain, "blocks"),
|
rename_and_link(
|
||||||
to_name=os.path.join(self.nodes[0].datadir, self.chain, "newblocks"))
|
from_name=self.nodes[0].chain_path / "blocks",
|
||||||
rename_and_link(from_name=os.path.join(self.nodes[0].datadir, self.chain, "chainstate"),
|
to_name=dir_new_blocks,
|
||||||
to_name=os.path.join(self.nodes[0].datadir, self.chain, "newchainstate"))
|
)
|
||||||
|
rename_and_link(
|
||||||
|
from_name=self.nodes[0].chain_path / "chainstate",
|
||||||
|
to_name=dir_new_chainstate,
|
||||||
|
)
|
||||||
|
|
||||||
self.start_node(0)
|
self.start_node(0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
SymlinkTest().main()
|
SymlinkTest().main()
|
||||||
|
Loading…
Reference in New Issue
Block a user