From 81d3dace51ef6bbd31126e50775e2caf872e1cb1 Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Tue, 5 Nov 2024 10:26:44 +0100 Subject: [PATCH 1/3] Enable IPv6 tests on main branch Initially, those tests were skipped on main because of Cilium LB limitations. We now moved to Metallb for this and therefore can enable it everywhere. --- .github/workflows/integration-informing.yaml | 4 ---- tests/integration/tests/test_networking.py | 9 --------- 2 files changed, 13 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/tests/integration/tests/test_networking.py b/tests/integration/tests/test_networking.py index af6449471..e2894b9be 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] @@ -131,10 +126,6 @@ def test_ipv6_only_on_dualstack_infra(instances: List[harness.Instance]): @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] From adca07fb089de0a30fcfe6c4f7c8d2f42b4e6b38 Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Fri, 8 Nov 2024 12:25:38 +0100 Subject: [PATCH 2/3] add tmate debugging --- .github/workflows/integration.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index be291b991..0e141b2f6 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,6 +79,10 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + with: + detached: true - name: Setup Python uses: actions/setup-python@v5 with: From 049793983230106a8dbcf191aa224fff3f3bc15d Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Fri, 8 Nov 2024 13:23:53 +0100 Subject: [PATCH 3/3] remove ipv6 test for ip6 only infra --- .github/workflows/integration.yaml | 9 +-- tests/integration/tests/test_networking.py | 65 ---------------------- 2 files changed, 5 insertions(+), 69 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 0e141b2f6..3214f1645 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,10 +79,6 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - with: - detached: true - name: Setup Python uses: actions/setup-python@v5 with: @@ -106,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 e2894b9be..1804ab1fa 100644 --- a/tests/integration/tests/test_networking.py +++ b/tests/integration/tests/test_networking.py @@ -121,68 +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") -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 - )