Skip to content

Commit

Permalink
check external-dns pod status before fetching logs (#5165)
Browse files Browse the repository at this point in the history
  • Loading branch information
vepatel authored Feb 26, 2024
1 parent 2afee89 commit 30f95c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/suite/test_virtual_server_externaldns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from settings import TEST_DATA
from suite.utils.custom_assertions import assert_event, assert_event_not_present
from suite.utils.custom_resources_utils import is_dnsendpoint_present, read_custom_resource
from suite.utils.resources_utils import get_events, patch_namespace_with_label, wait_before_test
from suite.utils.resources_utils import (
get_events,
patch_namespace_with_label,
wait_before_test,
wait_until_all_pods_are_ready,
)
from suite.utils.vs_vsr_resources_utils import patch_virtual_server_from_yaml
from suite.utils.yaml_utils import get_name_from_yaml, get_namespace_from_yaml

Expand Down Expand Up @@ -39,6 +44,7 @@ def test_responses_after_setup(
assert dep is True
print("\nStep 2: Verify external-dns picked up the record")
pod_ns = get_namespace_from_yaml(f"{TEST_DATA}/virtual-server-external-dns/external-dns.yaml")
wait_until_all_pods_are_ready(kube_apis.v1, pod_ns)
pod_name = kube_apis.v1.list_namespaced_pod(pod_ns).items[0].metadata.name
log_contents = kube_apis.v1.read_namespaced_pod_log(pod_name, pod_ns)
wanted_string = "CREATE: virtual-server.example.com 0 IN A"
Expand Down Expand Up @@ -140,6 +146,7 @@ def test_responses_after_setup(
assert dep is True
print("\nStep 2: Verify external-dns picked up the record")
pod_ns = get_namespace_from_yaml(f"{TEST_DATA}/virtual-server-external-dns/external-dns.yaml")
wait_until_all_pods_are_ready(kube_apis.v1, pod_ns)
pod_name = kube_apis.v1.list_namespaced_pod(pod_ns).items[0].metadata.name
log_contents = kube_apis.v1.read_namespaced_pod_log(pod_name, pod_ns)
wanted_string = "CREATE: virtual-server.example.com 0 IN A"
Expand Down

0 comments on commit 30f95c0

Please sign in to comment.