-
Notifications
You must be signed in to change notification settings - Fork 23
test(dns): Verify DNS Endpoint Provider aggregation logic #830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test(dns): Verify DNS Endpoint Provider aggregation logic #830
Conversation
Signed-off-by: Martina Fabikova <[email protected]>
ef5e5db to
25cd7db
Compare
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Martina Fabikova <[email protected]>
1d9fab1 to
a9ed4ad
Compare
| delegate=False, | ||
| labels={"app": module_label, "kuadrant.io/zone-record": "true"}, | ||
| ) | ||
| record.model["spec"]["providerRef"] = {"name": dns_provider_secret} |
There was a problem hiding this comment.
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"} |
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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
| 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}")} |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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.
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:
endpointprovider.Closes #811
Changes
testsuite/tests/singlecluster/gateway/dnspolicy/dns_records/test_dns_endpoint_provider.pywhich implements the test cases specified in the issue.DNSRecordclass intestsuite/kuadrant/policy/dns.pywith:wait_for_endpoints_mergedwait_until_resolves