aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_coinstatsindex.py2
-rwxr-xr-xtest/functional/feature_pruning.py1
-rwxr-xr-xtest/functional/rpc_users.py3
-rwxr-xr-xtest/functional/test_framework/test_node.py1
-rwxr-xr-xtest/lint/lint-circular-dependencies.py16
-rwxr-xr-xtest/lint/lint-format-strings.py2
6 files changed, 14 insertions, 11 deletions
diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py
index 251aa2114b..2e21638f80 100755
--- a/test/functional/feature_coinstatsindex.py
+++ b/test/functional/feature_coinstatsindex.py
@@ -231,11 +231,13 @@ class CoinStatsIndexTest(BitcoinTestFramework):
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
+ self.stop_node(1)
self.nodes[1].assert_start_raises_init_error(
expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
extra_args=['-coinstatsindex', '-reindex-chainstate'],
)
+ self.restart_node(1, extra_args=["-coinstatsindex"])
def _test_use_index_option(self):
self.log.info("Test use_index option for nodes running the index")
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index 4110526d15..77524e85a3 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -125,6 +125,7 @@ class PruneTest(BitcoinTestFramework):
self.sync_blocks(self.nodes[0:5])
def test_invalid_command_line_options(self):
+ self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(
expected_msg='Error: Prune cannot be configured with a negative value.',
extra_args=['-prune=-1'],
diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py
index 7cedb4336b..1a35a57802 100755
--- a/test/functional/rpc_users.py
+++ b/test/functional/rpc_users.py
@@ -107,6 +107,9 @@ class HTTPBasicsTest(BitcoinTestFramework):
self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo'])
self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo:bar'])
+ self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo:bar:baz'])
+ self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo$bar:baz'])
+ self.nodes[0].assert_start_raises_init_error(expected_msg=init_error, extra_args=['-rpcauth=foo$bar$baz'])
self.log.info('Check that failure to write cookie file will abort the node gracefully')
cookie_file = os.path.join(get_datadir_path(self.options.tmpdir, 0), self.chain, '.cookie.tmp')
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index e56d4aa492..7d2db391b6 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -545,6 +545,7 @@ class TestNode():
Will throw if bitcoind starts without an error.
Will throw if an expected_msg is provided and it does not match bitcoind's stdout."""
+ assert not self.running
with tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False) as log_stderr, \
tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False) as log_stdout:
try:
diff --git a/test/lint/lint-circular-dependencies.py b/test/lint/lint-circular-dependencies.py
index e04909c0a5..7ca2ec994b 100755
--- a/test/lint/lint-circular-dependencies.py
+++ b/test/lint/lint-circular-dependencies.py
@@ -6,7 +6,6 @@
#
# Check for circular dependencies
-import glob
import os
import re
import subprocess
@@ -32,17 +31,14 @@ CODE_DIR = "src"
def main():
circular_dependencies = []
exit_code = 0
- os.chdir(
- CODE_DIR
- ) # We change dir before globbing since glob.glob's root_dir option is only available in Python 3.10
- # Using glob.glob since subprocess.run's globbing won't work without shell=True
- files = []
- for path in ["*", "*/*", "*/*/*"]:
- for extension in ["h", "cpp"]:
- files.extend(glob.glob(f"{path}.{extension}"))
+ os.chdir(CODE_DIR)
+ files = subprocess.check_output(
+ ['git', 'ls-files', '--', '*.h', '*.cpp'],
+ universal_newlines=True,
+ ).splitlines()
- command = ["python3", "../contrib/devtools/circular-dependencies.py", *files]
+ command = [sys.executable, "../contrib/devtools/circular-dependencies.py", *files]
dependencies_output = subprocess.run(
command,
stdout=subprocess.PIPE,
diff --git a/test/lint/lint-format-strings.py b/test/lint/lint-format-strings.py
index 5a36da11fd..28e7b1e4ff 100755
--- a/test/lint/lint-format-strings.py
+++ b/test/lint/lint-format-strings.py
@@ -36,7 +36,7 @@ RUN_LINT_FILE = 'test/lint/run-lint-format-strings.py'
def check_doctest():
command = [
- 'python3',
+ sys.executable,
'-m',
'doctest',
RUN_LINT_FILE,