Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions tests/suite/test_oidc_fclo.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,30 @@ def test_oidc(
kube_apis.v1, ingress_controller_prerequisites.namespace, "nginx-ingress-"
)

logs = kube_apis.v1.read_namespaced_pod_log(nic_pod_name, ingress_controller_prerequisites.namespace)
retry = 0
count_fclo_initiated = 0
logs = ""
expected_fclo_count = 2
while count_fclo_initiated != expected_fclo_count and retry < 10:
wait_before_test(1) # wait one second before retrying

count_get_fclo = logs.count("GET /front_channel_logout?sid=")
count_fclo_initiated = logs.count("OIDC Front-Channel Logout initiated for sid:")
logs = kube_apis.v1.read_namespaced_pod_log(nic_pod_name, ingress_controller_prerequisites.namespace)

assert (
count_get_fclo == 2
), f"nginx-ingress logs do not contain GET /front_channel_logout?sid= twice, got {count_get_fclo}"
count_fclo_initiated = logs.count("OIDC Front-Channel Logout initiated for sid:")

print(f"OIDC FCLO Initiated count in the while loop: {count_fclo_initiated}, retrying... {retry}")
retry += 1

assert (
count_fclo_initiated == 2
count_fclo_initiated == expected_fclo_count
), f"nginx-ingress logs do not contain OIDC Front-Channel Logout initiated for sid twice, got {count_fclo_initiated}"

count_get_fclo = logs.count("GET /front_channel_logout?sid=")

assert (
count_get_fclo == expected_fclo_count
), f"nginx-ingress logs do not contain GET /front_channel_logout?sid= twice, got {count_get_fclo}"

delete_secret(kube_apis.v1, secret_one_name, test_namespace)
delete_secret(kube_apis.v1, secret_two_name, test_namespace)
delete_policy(kube_apis.custom_objects, pol_one, test_namespace)
Expand Down