Skip to content

Commit 3585145

Browse files
committed
[test] Test the interactions between -connect and -dnsseed
1 parent 75c05af commit 3585145

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/functional/p2p_dns_seeds.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ def set_test_params(self):
1515
self.extra_args = [["-dnsseed=1"]]
1616

1717
def run_test(self):
18+
self.init_arg_tests()
1819
self.existing_outbound_connections_test()
1920
self.existing_block_relay_connections_test()
2021

22+
def init_arg_tests(self):
23+
fakeaddr = "fakenodeaddr.fakedomain.invalid."
24+
25+
self.log.info("Check that setting -connect disables -dnsseed by default")
26+
self.nodes[0].stop_node()
27+
with self.nodes[0].assert_debug_log(expected_msgs=["DNS seeding disabled"]):
28+
self.start_node(0, [f"-connect={fakeaddr}"])
29+
30+
self.log.info("Check that running -connect and -dnsseed means DNS logic runs.")
31+
with self.nodes[0].assert_debug_log(expected_msgs=["Loading addresses from DNS seed"], timeout=12):
32+
self.restart_node(0, [f"-connect={fakeaddr}", "-dnsseed=1"])
33+
2134
def existing_outbound_connections_test(self):
2235
# Make sure addrman is populated to enter the conditional where we
2336
# delay and potentially skip DNS seeding.

0 commit comments

Comments
 (0)