From d3ca3084401392139074c281253f6103186b9e67 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Wed, 17 Jul 2024 12:57:05 +0300 Subject: [PATCH] Ensure main.bootstrap_from_dns() adds IPv6 addresses to the core nodes --- minode/tests/test_network.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/minode/tests/test_network.py b/minode/tests/test_network.py index bd7b60e..f1ae7df 100644 --- a/minode/tests/test_network.py +++ b/minode/tests/test_network.py @@ -1,4 +1,5 @@ """Tests for network connections""" +import ipaddress import logging import os import random @@ -78,6 +79,17 @@ class TestNetwork(unittest.TestCase): main.bootstrap_from_dns() self.assertGreaterEqual(len(shared.core_nodes), core_nodes_len) + for host, _ in shared.core_nodes: + try: + ipaddress.IPv4Address(host) + except ipaddress.AddressValueError: + try: + ipaddress.IPv6Address(host) + except ipaddress.AddressValueError: + self.fail('Found not an IP address in the core nodes') + break + else: + self.fail('No IPv6 address found in the core nodes') def test_bootstrap(self): """Start bootstrappers and check node pool"""