aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_config_args.py
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2019-11-15 16:26:23 -0500
committerRussell Yanofsky <russ@yanofsky.org>2020-09-02 08:14:34 -0500
commitff44cae279bef7997f76db18deb1e41b39f05cb6 (patch)
tree8e4ff40db52a473ba4e5fe94139e0a2a8c743b63 /test/functional/feature_config_args.py
parentc157a50694545090cb1c7e69123fe4709bd5a279 (diff)
downloadbitcoin-ff44cae279bef7997f76db18deb1e41b39f05cb6.tar.xz
test: Change feature_config_args.py not to rely on strange regtest=0 behavior
Update test to simply generate a normal mainnet configuration file instead of using a crazy setup where a regtest=1 config file using an includeconf in the [regtest] section includes another config file that specifies regtest=0, retroactively switching the network to mainnet. This setup was fragile and only worked because the triggered InitError happened early enough that none of the ignored [regtest] options mattered (only affecting log output).
Diffstat (limited to 'test/functional/feature_config_args.py')
-rwxr-xr-xtest/functional/feature_config_args.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py
index 34e856c1ba..72a424e88e 100755
--- a/test/functional/feature_config_args.py
+++ b/test/functional/feature_config_args.py
@@ -7,6 +7,7 @@
import os
from test_framework.test_framework import BitcoinTestFramework
+from test_framework import util
class ConfArgsTest(BitcoinTestFramework):
@@ -41,10 +42,11 @@ class ConfArgsTest(BitcoinTestFramework):
conf.write("wallet=foo\n")
self.nodes[0].assert_start_raises_init_error(expected_msg='Error: Config setting for -wallet only applied on %s network when in [%s] section.' % (self.chain, self.chain))
+ main_conf_file_path = os.path.join(self.options.tmpdir, 'node0', 'bitcoin_main.conf')
+ util.write_config(main_conf_file_path, n=0, chain='', extra_config='includeconf={}\n'.format(inc_conf_file_path))
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
- conf.write('regtest=0\n') # mainnet
conf.write('acceptnonstdtxn=1\n')
- self.nodes[0].assert_start_raises_init_error(expected_msg='Error: acceptnonstdtxn is not currently supported for main chain')
+ self.nodes[0].assert_start_raises_init_error(extra_args=["-conf={}".format(main_conf_file_path)], expected_msg='Error: acceptnonstdtxn is not currently supported for main chain')
with open(inc_conf_file_path, 'w', encoding='utf-8') as conf:
conf.write('nono\n')