diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2021-05-24 17:08:54 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2021-07-30 11:15:49 -0700 |
commit | 26d0ffe4f2573e0297c9b0e095c2a0868929b08b (patch) | |
tree | a2de6f3fcaa1f0e210987b206ee6281368cde509 /test/functional/p2p_dns_seeds.py | |
parent | 35851450a928ffacca240fadbf1747a42d5ba256 (diff) |
[test] Test -forcednsseed causes querying DNS seeds
Diffstat (limited to 'test/functional/p2p_dns_seeds.py')
-rwxr-xr-x | test/functional/p2p_dns_seeds.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/p2p_dns_seeds.py b/test/functional/p2p_dns_seeds.py index 213741f3a8..4714de64dc 100755 --- a/test/functional/p2p_dns_seeds.py +++ b/test/functional/p2p_dns_seeds.py @@ -18,6 +18,7 @@ class P2PDNSSeeds(BitcoinTestFramework): self.init_arg_tests() self.existing_outbound_connections_test() self.existing_block_relay_connections_test() + self.force_dns_test() def init_arg_tests(self): fakeaddr = "fakenodeaddr.fakedomain.invalid." @@ -60,6 +61,17 @@ class P2PDNSSeeds(BitcoinTestFramework): for i in range(2): self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=i, connection_type="block-relay-only") + def force_dns_test(self): + self.log.info("Check that we query DNS seeds if -forcednsseed param is set") + + with self.nodes[0].assert_debug_log(expected_msgs=["Loading addresses from DNS seed"], timeout=12): + # -dnsseed defaults to 1 in bitcoind, but 0 in the test framework, + # so pass it explicitly here + self.restart_node(0, ["-forcednsseed", "-dnsseed=1"]) + + # Restore default for subsequent tests + self.restart_node(0) + if __name__ == '__main__': P2PDNSSeeds().main() |