aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-09-08 10:39:06 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-08 18:58:31 +0200
commitfadecbd9a4d47957f42672911675c400caeaac24 (patch)
tree9385c18c6b9d291f66f33eec60bbf3e89855bd03
parent5e3380b9f59481fc18e05b9d651c3c733abe4053 (diff)
downloadbitcoin-fadecbd9a4d47957f42672911675c400caeaac24.tar.xz
test: Fix tests on Windows
-rw-r--r--build_msvc/bitcoind/bitcoind.vcxproj6
-rwxr-xr-xtest/functional/feature_config_args.py26
-rwxr-xr-xtest/functional/feature_presegwit_node_upgrade.py9
-rwxr-xr-xtest/functional/rpc_signer.py8
-rwxr-xr-xtest/functional/tool_wallet.py2
5 files changed, 36 insertions, 15 deletions
diff --git a/build_msvc/bitcoind/bitcoind.vcxproj b/build_msvc/bitcoind/bitcoind.vcxproj
index c2c32af838..d56c359fe0 100644
--- a/build_msvc/bitcoind/bitcoind.vcxproj
+++ b/build_msvc/bitcoind/bitcoind.vcxproj
@@ -58,6 +58,8 @@
<ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@PACKAGE_NAME@" By="Bitcoin Core"></ReplaceInFile>
<ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@PACKAGE_BUGREPORT@" By="https://github.com/bitcoin/bitcoin/issues"></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@abs_top_srcdir@" By="..\.." ToFullPath="true"></ReplaceInFile>
<ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@abs_top_builddir@" By="..\.." ToFullPath="true"></ReplaceInFile>
@@ -72,11 +74,15 @@
<ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@BUILD_BITCOIN_CLI_TRUE@" By=""></ReplaceInFile>
<ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@BUILD_BITCOIN_WALLET_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@BUILD_BITCOIND_TRUE@" By=""></ReplaceInFile>
<ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@ENABLE_FUZZ_TRUE@" By=""></ReplaceInFile>
<ReplaceInFile FilePath="$(ConfigIniOut)"
Replace="@ENABLE_ZMQ_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@ENABLE_EXTERNAL_SIGNER_TRUE@" By=""></ReplaceInFile>
</Target>
<Import Project="..\common.vcxproj" />
</Project>
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py
index 0daa0ba3d8..3d9d8b7441 100755
--- a/test/functional/feature_config_args.py
+++ b/test/functional/feature_config_args.py
@@ -164,11 +164,14 @@ class ConfArgsTest(BitcoinTestFramework):
# fixed seeds
assert not os.path.exists(os.path.join(default_data_dir, "peers.dat"))
start = int(time.time())
- with self.nodes[0].assert_debug_log(expected_msgs=[
- "Loaded 0 addresses from peers.dat",
- "0 addresses found from DNS seeds",
- "opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
- ]):
+ with self.nodes[0].assert_debug_log(
+ expected_msgs=[
+ "Loaded 0 addresses from peers.dat",
+ "0 addresses found from DNS seeds",
+ "opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
+ ],
+ timeout=10,
+ ):
self.start_node(0, extra_args=['-dnsseed=1', '-fixedseeds=1', f'-mocktime={start}'])
with self.nodes[0].assert_debug_log(expected_msgs=[
"Adding fixed seeds as 60 seconds have passed and addrman is empty",
@@ -206,11 +209,14 @@ class ConfArgsTest(BitcoinTestFramework):
# We expect the node will allow 60 seconds prior to using fixed seeds
assert not os.path.exists(os.path.join(default_data_dir, "peers.dat"))
start = int(time.time())
- with self.nodes[0].assert_debug_log(expected_msgs=[
- "Loaded 0 addresses from peers.dat",
- "DNS seeding disabled",
- "opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
- ]):
+ with self.nodes[0].assert_debug_log(
+ expected_msgs=[
+ "Loaded 0 addresses from peers.dat",
+ "DNS seeding disabled",
+ "opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
+ ],
+ timeout=10,
+ ):
self.start_node(0, extra_args=['-dnsseed=0', '-fixedseeds=1', '-addnode=fakenodeaddr', f'-mocktime={start}'])
with self.nodes[0].assert_debug_log(expected_msgs=[
"Adding fixed seeds as 60 seconds have passed and addrman is empty",
diff --git a/test/functional/feature_presegwit_node_upgrade.py b/test/functional/feature_presegwit_node_upgrade.py
index 0428588da3..eb4ee7f1b4 100755
--- a/test/functional/feature_presegwit_node_upgrade.py
+++ b/test/functional/feature_presegwit_node_upgrade.py
@@ -9,6 +9,8 @@ from test_framework.util import (
assert_equal,
softfork_active,
)
+import os
+
class SegwitUpgradeTest(BitcoinTestFramework):
def set_test_params(self):
@@ -35,8 +37,11 @@ class SegwitUpgradeTest(BitcoinTestFramework):
# Restarting the node (with segwit activation height set to 5) should result in a shutdown
# because the blockchain consists of 3 insufficiently validated blocks per segwit consensus rules.
node.assert_start_raises_init_error(
- extra_args=["-segwitheight=5"],
- expected_msg=": Witness data for blocks after height 5 requires validation. Please restart with -reindex..\nPlease restart with -reindex or -reindex-chainstate to recover.")
+ extra_args=["-segwitheight=5"],
+ expected_msg=": Witness data for blocks after height 5 requires "
+ f"validation. Please restart with -reindex..{os.linesep}"
+ "Please restart with -reindex or -reindex-chainstate to recover.",
+ )
# As directed, the user restarts the node with -reindex
self.start_node(0, extra_args=["-reindex", "-segwitheight=5"])
diff --git a/test/functional/rpc_signer.py b/test/functional/rpc_signer.py
index 3188763f49..9e963eba57 100755
--- a/test/functional/rpc_signer.py
+++ b/test/functional/rpc_signer.py
@@ -53,8 +53,12 @@ class RPCSignerTest(BitcoinTestFramework):
)
# Handle script missing:
- assert_raises_rpc_error(-1, 'execve failed: No such file or directory',
- self.nodes[3].enumeratesigners
+ assert_raises_rpc_error(
+ -1,
+ "CreateProcess failed: The system cannot find the file specified."
+ if platform.system() == "Windows"
+ else "execve failed: No such file or directory",
+ self.nodes[3].enumeratesigners,
)
# Handle error thrown by script
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py
index 28103793df..2f0cfb6031 100755
--- a/test/functional/tool_wallet.py
+++ b/test/functional/tool_wallet.py
@@ -344,7 +344,7 @@ class ToolWalletTest(BitcoinTestFramework):
non_exist_dump = os.path.join(self.nodes[0].datadir, "wallet.nodump")
self.assert_raises_tool_error('Unknown wallet file format "notaformat" provided. Please provide one of "bdb" or "sqlite".', '-wallet=todump', '-format=notaformat', '-dumpfile={}'.format(wallet_dump), 'createfromdump')
self.assert_raises_tool_error('Dump file {} does not exist.'.format(non_exist_dump), '-wallet=todump', '-dumpfile={}'.format(non_exist_dump), 'createfromdump')
- wallet_path = os.path.join(self.nodes[0].datadir, 'regtest/wallets/todump2')
+ wallet_path = os.path.join(self.nodes[0].datadir, 'regtest', 'wallets', 'todump2')
self.assert_raises_tool_error('Failed to create database path \'{}\'. Database already exists.'.format(wallet_path), '-wallet=todump2', '-dumpfile={}'.format(wallet_dump), 'createfromdump')
self.assert_raises_tool_error("The -descriptors option can only be used with the 'create' command.", '-descriptors', '-wallet=todump2', '-dumpfile={}'.format(wallet_dump), 'createfromdump')