forked from Kuadrant/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Kuadrant#182 from azgabur/httproute_delete
Add tests for HTTPRoute delete reconciliation
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |