aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-05-28 13:38:46 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2021-07-30 11:15:49 -0700
commit6395c8ed5689ea72e9a1618f14551775246f6361 (patch)
treef8f08b38a17bc51c4abf1c0b5c0c70884d3ba0cf
parent6f6b7df6bdcf863af160c0426e3a22028ca8259a (diff)
[test] Test the interactions between -forcednsseed and -dnsseed
Test that passing conflicting parameters for the two causes a startup error. This logic also impacts -connect, which soft sets -dnsseed, so add a test for that too.
-rwxr-xr-xtest/functional/p2p_dns_seeds.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/p2p_dns_seeds.py b/test/functional/p2p_dns_seeds.py
index 4714de64dc..d9977dccee 100755
--- a/test/functional/p2p_dns_seeds.py
+++ b/test/functional/p2p_dns_seeds.py
@@ -32,6 +32,24 @@ class P2PDNSSeeds(BitcoinTestFramework):
with self.nodes[0].assert_debug_log(expected_msgs=["Loading addresses from DNS seed"], timeout=12):
self.restart_node(0, [f"-connect={fakeaddr}", "-dnsseed=1"])
+ self.log.info("Check that running -forcednsseed and -dnsseed=0 throws an error.")
+ self.nodes[0].stop_node()
+ self.nodes[0].assert_start_raises_init_error(
+ expected_msg="Error: Cannot set -forcednsseed to true when setting -dnsseed to false.",
+ extra_args=["-forcednsseed=1", "-dnsseed=0"],
+ )
+
+ self.log.info("Check that running -forcednsseed and -connect throws an error.")
+ # -connect soft sets -dnsseed to false, so throws the same error
+ self.nodes[0].stop_node()
+ self.nodes[0].assert_start_raises_init_error(
+ expected_msg="Error: Cannot set -forcednsseed to true when setting -dnsseed to false.",
+ extra_args=["-forcednsseed=1", f"-connect={fakeaddr}"],
+ )
+
+ # Restore default bitcoind settings
+ self.restart_node(0)
+
def existing_outbound_connections_test(self):
# Make sure addrman is populated to enter the conditional where we
# delay and potentially skip DNS seeding.