diff --git a/build-scripts/patches/moonray/apply b/build-scripts/patches/moonray/apply index def5f242c..ae94208c9 100755 --- a/build-scripts/patches/moonray/apply +++ b/build-scripts/patches/moonray/apply @@ -10,10 +10,6 @@ git config user.name k8s-bot rm "${DIR}/../../../tests/integration/tests/test_cilium_e2e.py" ## TODO: restore when loadbalancer is implemented rm "${DIR}/../../../tests/integration/tests/test_loadbalancer.py" -## TODO: restore when gateway is implemented -rm "${DIR}/../../../tests/integration/tests/test_gateway.py" -## TODO: restore when ingress is implemented -rm "${DIR}/../../../tests/integration/tests/test_ingress.py" ## TODO: restore when cleanup is implemented rm "${DIR}/../../../tests/integration/tests/test_cleanup.py" ## TODO: restore when network test is fixed diff --git a/tests/integration/tests/test_gateway.py b/tests/integration/tests/test_gateway.py index 373331dd5..0dc5e49de 100644 --- a/tests/integration/tests/test_gateway.py +++ b/tests/integration/tests/test_gateway.py @@ -62,7 +62,7 @@ def test_gateway(session_instance: harness.Instance): if "my-gateway" in svc["metadata"]["name"]: LOG.info(f"Found service {svc['metadata']['name']}") for port in svc["spec"]["ports"]: - if port["name"] == "port-80": + if port["port"] == 80: gateway_http_port = port["nodePort"] break if gateway_http_port: diff --git a/tests/integration/tests/test_ingress.py b/tests/integration/tests/test_ingress.py index 2a2156980..d37d825fd 100644 --- a/tests/integration/tests/test_ingress.py +++ b/tests/integration/tests/test_ingress.py @@ -37,12 +37,15 @@ def test_ingress(session_instance: List[harness.Instance]): if "ingress" in svc["metadata"]["name"]: LOG.info(f"Found service {svc['metadata']['name']}") for port in svc["spec"]["ports"]: - if port["name"] == "port-80": - ingress_http_port = port["nodePort"] + if port["port"] == 80: + ingress_http_port = port.get("nodePort") break if ingress_http_port: break + assert ingress_http_port is not None, "No ingress nodePort found." + LOG.info(f"Found ingress nodePort: {ingress_http_port}") + manifest = MANIFESTS_DIR / "ingress-test.yaml" session_instance.exec( ["k8s", "kubectl", "apply", "-f", "-"], @@ -68,7 +71,6 @@ def test_ingress(session_instance: List[harness.Instance]): "180s", ] ) - assert ingress_http_port is not None, "No ingress nodePort found." util.stubbornly(retries=5, delay_s=5).on(session_instance).until( lambda p: "Welcome to nginx!" in p.stdout.decode()