Skip to content

Commit

Permalink
Add checks for status zone support
Browse files Browse the repository at this point in the history
  • Loading branch information
tellet committed Sep 18, 2019
1 parent 6b1130d commit 0bd357b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
"-nginx-status-allow-cidrs=0.0.0.0/0"]},
{"example": "virtual-server-route-dynamic-configuration"})],
indirect=True)
class TestVSRDynamicConfiguration:
def test_nginx_plus_api_response(self, kube_apis,
ingress_controller_endpoint,
crd_ingress_controller,
v_s_route_setup,
v_s_route_app_setup):
class TestVSRNginxPlusApi:
def test_dynamic_configuration(self, kube_apis,
ingress_controller_endpoint, crd_ingress_controller,
v_s_route_setup, v_s_route_app_setup):
req_url = f"http://{ingress_controller_endpoint.public_ip}:{ingress_controller_endpoint.api_port}"
vsr_s_upstream = f"vs_{v_s_route_setup.namespace}_{v_s_route_setup.vs_name}_" \
f"vsr_{v_s_route_setup.route_s.namespace}_{v_s_route_setup.route_s.name}_backend2"
Expand Down Expand Up @@ -48,3 +46,11 @@ def test_nginx_plus_api_response(self, kube_apis,
assert resp[0]['max_fails'] is 25
assert resp[0]['fail_timeout'] == '15s'
assert resp[0]['slow_start'] == '10s'

def test_status_zone_support(self, kube_apis,
ingress_controller_endpoint, crd_ingress_controller,
v_s_route_setup, v_s_route_app_setup):
req_url = f"http://{ingress_controller_endpoint.public_ip}:{ingress_controller_endpoint.api_port}"
status_zone_url = f"{req_url}/api/{NGINX_API_VERSION}/http/server_zones"
resp = json.loads(requests.get(status_zone_url).text)
assert resp[f"{v_s_route_setup.vs_host}"]
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"-nginx-status-allow-cidrs=0.0.0.0/0"]},
{"example": "virtual-server-dynamic-configuration", "app_type": "simple"})],
indirect=True)
class TestVSDynamicConfiguration:
def test_nginx_plus_api_response(self, kube_apis, ingress_controller_endpoint,
crd_ingress_controller, virtual_server_setup):
class TestVSNginxPlusApi:
def test_dynamic_configuration(self, kube_apis, ingress_controller_endpoint,
crd_ingress_controller, virtual_server_setup):
req_url = f"http://{ingress_controller_endpoint.public_ip}:{ingress_controller_endpoint.api_port}"
vs_upstream = f"vs_{virtual_server_setup.namespace}_{virtual_server_setup.vs_name}_backend2"
initial_reloads_count = get_nginx_generation_value(req_url)
Expand All @@ -35,3 +35,10 @@ def test_nginx_plus_api_response(self, kube_apis, ingress_controller_endpoint,
assert resp[0]['max_fails'] is 25
assert resp[0]['fail_timeout'] == '15s'
assert resp[0]['slow_start'] == '10s'

def test_status_zone_support(self, kube_apis, crd_ingress_controller, virtual_server_setup):
req_url = f"http://" \
f"{virtual_server_setup.public_endpoint.public_ip}:{virtual_server_setup.public_endpoint.api_port}"
status_zone_url = f"{req_url}/api/{NGINX_API_VERSION}/http/server_zones"
resp = json.loads(requests.get(status_zone_url).text)
assert resp[f"{virtual_server_setup.vs_host}"]

0 comments on commit 0bd357b

Please sign in to comment.