Skip to content

Commit

Permalink
fix vars and add test desc
Browse files Browse the repository at this point in the history
  • Loading branch information
vepatel committed Jan 15, 2024
1 parent ca17f63 commit a76e052
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/suite/test_rl_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def annotations_setup(
ingress_controller,
test_namespace,
) -> AnnotationsSetup:
print("------------------------- Deploy Ingress with rate-limit annotaions -----------------------------------")
print("------------------------- Deploy Ingress with rate-limit annotations -----------------------------------")
src = f"{TEST_DATA}/rate-limit/ingress/{request.param}/annotations-rl-ingress.yaml"
create_items_from_yaml(kube_apis, src, test_namespace)
ingress_name = get_name_from_yaml(src)
Expand Down Expand Up @@ -103,6 +103,9 @@ def fin():
@pytest.mark.parametrize("annotations_setup", ["standard", "mergeable"], indirect=True)
class TestRateLimitIngress:
def test_ingress_rate_limit(self, kube_apis, annotations_setup, ingress_controller_prerequisites, test_namespace):
"""
Test if rate-limit applies with 1rps for standard and mergeable ingresses
"""
ensure_response_from_backend(annotations_setup.request_url, annotations_setup.ingress_host, check404=True)
print("----------------------- Send request ----------------------")
counter = []
Expand Down
3 changes: 1 addition & 2 deletions tests/suite/utils/dos_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import subprocess
import time

from kubernetes.client import CoreV1Api
from kubernetes.stream import stream
Expand Down Expand Up @@ -60,7 +59,7 @@ def check_learning_status_with_admd_s(kube_apis, syslog_pod, namespace, time):
admd_s_dic = admd_s_content_to_dic(admd_contents)
if "name.info.learning" not in admd_s_dic:
print("name.info.learning not found in admd_s_dic")
time.sleep(retry_time)
wait_before_test(retry_time)
continue
learn = admd_s_dic["name.info.learning"].replace("[", "").replace("]", "").split(",")
learning_sas = float(learn[0])
Expand Down

0 comments on commit a76e052

Please sign in to comment.