Skip to content

Commit

Permalink
Merge pull request #621 from averevki/fix-multicluster-tests
Browse files Browse the repository at this point in the history
Fix unsynced objects in multicluster tests
  • Loading branch information
trepel authored Jan 21, 2025
2 parents e6c9afe + 4265635 commit 9606102
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ def test_change_default_geo(hostname, gateway, gateway2, dns_policy, dns_policy2

assert resolver.resolve(hostname.hostname)[0].address == gateway.external_ip().split(":")[0]

dns_policy.model.spec.loadBalancing.defaultGeo = False
dns_policy.apply()
dns_policy.refresh().model.spec.loadBalancing.defaultGeo = False
res = dns_policy.apply()
assert res.status() == 0, res.err()
dns_policy.wait_for_ready()

dns_policy2.model.spec.loadBalancing.defaultGeo = True
dns_policy2.apply()
dns_policy2.refresh().model.spec.loadBalancing.defaultGeo = True
res2 = dns_policy2.apply()
assert res2.status() == 0, res2.err()
dns_policy2.wait_for_ready()

sleep(300) # wait for DNS propagation on providers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def test_change_lb_strategy(hostname, gateway, gateway2, dns_policy2, dns_server
resolver.nameservers = [dns_server2["address"]]
assert resolver.resolve(hostname.hostname)[0].address == gateway2.external_ip().split(":")[0]

dns_policy2.model.spec.pop("loadBalancing")
dns_policy2.apply()
dns_policy2.refresh().model.spec.pop("loadBalancing")
res = dns_policy2.apply()
assert res.status() == 0, res.err()
assert dns_policy2.wait_until(
has_record_condition(
"Ready",
Expand All @@ -29,7 +30,7 @@ def test_change_lb_strategy(hostname, gateway, gateway2, dns_policy2, dns_server
"The DNS provider failed to ensure the record: record type conflict, cannot update endpoint "
f"'{wildcard_domain}' with record type 'A' when endpoint already exists with record type 'CNAME'",
)
)
), f"DNSPolicy did not reach expected record status, instead it was: {dns_policy2.model.status.recordConditions}"

sleep(300) # wait for DNS propagation on providers
assert resolver.resolve(hostname.hostname)[0].address == gateway.external_ip().split(":")[0]
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

def test_unsupported_geocode(dns_policy2):
"""Change default geocode to not existent one and verify that policy became not enforced"""
dns_policy2.model.spec.loadBalancing.geo = "XX"
dns_policy2.apply()
dns_policy2.refresh().model.spec.loadBalancing.geo = "XX"
res = dns_policy2.apply()
assert res.status() == 0, res.err()

assert dns_policy2.wait_until(has_condition("Enforced", "False"))
assert dns_policy2.wait_until(
Expand Down

0 comments on commit 9606102

Please sign in to comment.