Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@


class TestDNSServer:
"""
End to end tests of our DNS server implementation.
These tests use the `example.org` and `example.com` domains for testing, and also tests the fallback to the public DNS
Changes in the upstream name resolution of those domains might lead to test failures.

TODO we should investigate creating our own test domain with a fixed behavior to avoid potential test failures

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is localstack.cloud something we could use? Unfortunately, creating an additional test domain would cost money, and the associated yearly management of keeping the domain alive.

"""

@pytest.fixture
def dns_server(self):
dns_port = get_free_udp_port()
Expand Down Expand Up @@ -176,12 +184,11 @@ def test_dns_server_soa_record_suffix_matching(self, dns_server, query_dns):
assert "something.org." in answer.to_text()
assert "noc.something.org." in answer.to_text()

@pytest.mark.skip(reason="failing as of 2025-12-11")
def test_dns_server_subdomain_of_route(self, dns_server, query_dns):
"""Test querying a subdomain of a record entry without a wildcard"""
# add ipv4 host
dns_server.add_host("example.org", TargetRecord("127.0.0.1", RecordType.A))
answer = query_dns("nonexistent.example.org", "A")
dns_server.add_host("example.com", TargetRecord("127.0.0.1", RecordType.A))
answer = query_dns("nonexistent.example.com", "A")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually doesn't work for me. It's because nonexistent.example.com returns SERVFAIL rather than NXDOMAIN (although that might be temporary?)

Expected :<Rcode.NXDOMAIN: 3>
Actual   :<Rcode.SERVFAIL: 2>

assert not answer.answer
# should still have authority section
# TODO uncomment once it is clear why in CI the authority section is missing
Expand Down
Loading