From 0488d3fa7faf1f2cf170cc0df43827617bf350e0 Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Fri, 8 Nov 2024 15:51:13 +0100 Subject: [PATCH] Remove IPv6-only on IPv6 only infra test (#768) --- .github/workflows/integration-informing.yaml | 4 -- .github/workflows/integration.yaml | 5 ++ tests/integration/tests/test_networking.py | 74 -------------------- 3 files changed, 5 insertions(+), 78 deletions(-) diff --git a/.github/workflows/integration-informing.yaml b/.github/workflows/integration-informing.yaml index f0eec21b8..49c0b46ee 100644 --- a/.github/workflows/integration-informing.yaml +++ b/.github/workflows/integration-informing.yaml @@ -92,10 +92,6 @@ jobs: TEST_FLAVOR: ${{ matrix.patch }} TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports run: | - # IPv6-only is only supported on moonray - if [[ "${{ matrix.patch }}" == "moonray" ]]; then - export TEST_IPV6_ONLY="true" - fi cd tests/integration && sg lxd -c 'tox -e integration' - name: Prepare inspection reports if: failure() diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index be291b991..3214f1645 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -102,6 +102,11 @@ jobs: TEST_SUBSTRATE: lxd TEST_LXD_IMAGE: ${{ matrix.os }} TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports + # Test the latest (up to) 6 releases for the flavour + # TODO(ben): upgrade nightly to run all flavours + TEST_VERSION_UPGRADE_CHANNELS: "recent 6 classic" + # Upgrading from 1.30 is not supported. + TEST_VERSION_UPGRADE_MIN_RELEASE: "1.31" run: | cd tests/integration && sg lxd -c 'tox -e integration' - name: Prepare inspection reports diff --git a/tests/integration/tests/test_networking.py b/tests/integration/tests/test_networking.py index af6449471..1804ab1fa 100644 --- a/tests/integration/tests/test_networking.py +++ b/tests/integration/tests/test_networking.py @@ -2,7 +2,6 @@ # Copyright 2024 Canonical, Ltd. # import logging -import os from ipaddress import IPv4Address, IPv6Address, ip_address from typing import List @@ -62,10 +61,6 @@ def test_dualstack(instances: List[harness.Instance]): @pytest.mark.node_count(3) @pytest.mark.disable_k8s_bootstrapping() @pytest.mark.network_type("dualstack") -@pytest.mark.skipif( - os.getenv("TEST_IPV6_ONLY") in ["false", None], - reason="IPv6 is currently only supported for moonray/calico", -) def test_ipv6_only_on_dualstack_infra(instances: List[harness.Instance]): main = instances[0] joining_cp = instances[1] @@ -126,72 +121,3 @@ def test_ipv6_only_on_dualstack_infra(instances: List[harness.Instance]): util.stubbornly(retries=config.DEFAULT_WAIT_RETRIES, delay_s=20).until( util.ready_nodes(main) == 3 ) - - -@pytest.mark.node_count(3) -@pytest.mark.disable_k8s_bootstrapping() -@pytest.mark.network_type("ipv6") -@pytest.mark.skipif( - os.getenv("TEST_IPV6_ONLY") in ["false", None], - reason="IPv6 is currently only supported for moonray/calico", -) -def test_ipv6_only_on_ipv6_infra(instances: List[harness.Instance]): - main = instances[0] - joining_cp = instances[1] - joining_worker = instances[2] - - ipv6_bootstrap_config = ( - config.MANIFESTS_DIR / "bootstrap-ipv6-only.yaml" - ).read_text() - - main.exec( - ["k8s", "bootstrap", "--file", "-"], - input=str.encode(ipv6_bootstrap_config), - ) - - join_token = util.get_join_token(main, joining_cp) - joining_cp.exec(["k8s", "join-cluster", join_token]) - - join_token_worker = util.get_join_token(main, joining_worker, "--worker") - joining_worker.exec(["k8s", "join-cluster", join_token_worker]) - - # Deploy nginx with ipv6 service - ipv6_config = (config.MANIFESTS_DIR / "nginx-ipv6-only.yaml").read_text() - main.exec(["k8s", "kubectl", "apply", "-f", "-"], input=str.encode(ipv6_config)) - addresses = ( - util.stubbornly(retries=5, delay_s=3) - .on(main) - .exec( - [ - "k8s", - "kubectl", - "get", - "svc", - "nginx-ipv6", - "-o", - "jsonpath='{.spec.clusterIPs[*]}'", - ], - text=True, - capture_output=True, - ) - .stdout - ) - - for ip in addresses.split(): - addr = ip_address(ip.strip("'")) - if isinstance(addr, IPv6Address): - address = f"http://[{str(addr)}]" - elif isinstance(addr, IPv4Address): - assert False, "IPv4 address found in IPv6-only cluster" - else: - pytest.fail(f"Unknown IP address type: {addr}") - - # need to shell out otherwise this runs into permission errors - util.stubbornly(retries=3, delay_s=1).on(main).exec( - ["curl", address], shell=True - ) - - # This might take a while - util.stubbornly(retries=config.DEFAULT_WAIT_RETRIES, delay_s=20).until( - util.ready_nodes(main) == 3 - )