Skip to content

Commit

Permalink
Merge pull request Kuadrant#182 from azgabur/httproute_delete
Browse files Browse the repository at this point in the history
Add tests for HTTPRoute delete reconciliation
  • Loading branch information
pehala authored Mar 20, 2023
2 parents ea4bfa8 + e02d6bc commit 4c63218
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Tests that AuthPolicy is reconciled after HTTPRoute deletion."""
import pytest


@pytest.mark.issue("https://github.com/Kuadrant/kuadrant-operator/issues/124")
def test_delete(client, authorization, resilient_request):
"""
Tests that after deleting HTTPRoute, status.conditions shows it missing:
* Test that that client works
* Delete associated HTTPRoute
* Test that client now does not work
* AuthPolicy cache refresh
* Test that status.conditions of AuthPolicy detects missing HTTPRoute
"""

response = client.get("/get")
assert response.status_code == 200

authorization.route.delete()

response = resilient_request("/get", http_client=client, expected_status=404)
assert response.status_code == 404, "Removing HTTPRoute was not reconciled"

authorization.refresh()
condition = authorization.model.status.conditions[0]
assert condition.status == "False"
assert "not found" in condition.message

0 comments on commit 4c63218

Please sign in to comment.