Skip to content

Conversation

@fabikova
Copy link
Contributor

Description

This PR implements the test scenarios defined in issue #811 to verify the new DNS Endpoint Provider functionality.

It validates the aggregation workflow where multiple "Source" DNSRecords (acting as endpoint feeders) merge their endpoints into a single central "Destination" DNSRecord (acting as a Zone), which then propagates the records to an upstream provider (e.g., AWS).

Scenarios covered:

  1. Creation of a Destination DNSRecord pointing to a real provider (AWS) with the required zone label.
  2. Creation of multiple Source DNSRecords pointing to the endpoint provider.
  3. Verification that source endpoints are correctly merged into the destination record by the operator.
  4. Verification that the merged records are successfully resolved via external DNS.

Closes #811

Changes

  • New Test: Added testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py which implements the test cases specified in the issue.
  • Helper Methods: Updated DNSRecord class in testsuite/kuadrant/policy/dns.py with:
    • wait_for_endpoints_merged
    • wait_until_resolves

@fabikova fabikova force-pushed the feature/issue-811-dns-endpoint-provider-tests branch from ef5e5db to 25cd7db Compare December 16, 2025 12:18
@fabikova fabikova requested a review from averevki December 16, 2025 12:20
@fabikova fabikova self-assigned this Dec 16, 2025
@fabikova fabikova moved this to Ready For Review in Kuadrant Dec 16, 2025
Signed-off-by: Martina Fabikova <[email protected]>
@fabikova fabikova force-pushed the feature/issue-811-dns-endpoint-provider-tests branch from 1d9fab1 to a9ed4ad Compare January 20, 2026 14:55
delegate=False,
labels={"app": module_label, "kuadrant.io/zone-record": "true"},
)
record.model["spec"]["providerRef"] = {"name": dns_provider_secret}
Copy link
Contributor

Choose a reason for hiding this comment

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

Add provider ref as a parameter to dns record class. Try to add reusable testsuite actions into methods, which might be also useful for the future tests

@pytest.fixture(scope="module")
def endpoint_provider_secret(request, cluster, module_label, blame):
"""Creates a fresh endpoint provider secret in the test namespace"""
secret_data = {"AWS_ACCESS_KEY_ID": "DUMMYACCESSKEY", "AWS_SECRET_ACCESS_KEY": "DUMMYSECRETKEY"}
Copy link
Contributor

Choose a reason for hiding this comment

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

What you need these secret values for? afaik only ENDPOINT_GVR and ENDPOINT_ZONE_RECORD_LABEL variables available for endpoint provider secret


import backoff
import openshift_client as oc

Copy link
Contributor

Choose a reason for hiding this comment

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

python imports usually separated into 3 groups: preinstalled python packages, external packages (the ones we add through the poetry), and internal testsuite packages. They are separated with empty lines to make it easier to manage and traverse imports

Comment on lines +97 to +98
assert SOURCE_IP1 in {r.address for r in dns.resolver.resolve(f"src1.{hostname.hostname}")}
assert SOURCE_IP2 in {r.address for r in dns.resolver.resolve(f"src2.{hostname.hostname}")}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also assert if there is only a single IP returned from each hostname

@pytest.fixture(scope="module")
def destination_dnsrecord(cluster, blame, hostname, dns_provider_secret, module_label):
"""Destination Record acting as the Zone"""
dummy_endpoint = DNSRecordEndpoint(dnsName=hostname.hostname, recordType="A", recordTTL=300, targets=[DUMMY_IP])
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't see you use this endpoint for anything inside the test. You should be able to configure dns record without any endpoints, with rootHost and providerRef filled only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

Add tests for the dns endpoint provider

2 participants