From 0cba9df3f1c45ed03e28d511539dabe7df7d0643 Mon Sep 17 00:00:00 2001 From: Artem Glazychev Date: Tue, 1 Nov 2022 11:31:41 +0700 Subject: [PATCH] Add IPv6 single cluster Signed-off-by: Artem Glazychev --- .github/workflows/ci.yaml | 68 +++++++++++++++++-- cluster-config-ipv6.yaml | 9 +++ cluster-config-old.yaml | 17 ----- go.mod | 2 +- go.sum | 4 +- calico_test.go => test_calico/calico_test.go | 12 ++-- .../interdomain_test.go | 3 +- main_test.go => test_single/main_test.go | 16 ++--- test_single_ipv6/main_test.go | 34 ++++++++++ 9 files changed, 122 insertions(+), 43 deletions(-) create mode 100644 cluster-config-ipv6.yaml delete mode 100644 cluster-config-old.yaml rename calico_test.go => test_calico/calico_test.go (88%) rename interdomain_test.go => test_interdomain/interdomain_test.go (98%) rename main_test.go => test_single/main_test.go (82%) create mode 100644 test_single_ipv6/main_test.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4295276d9..d0c781752 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,6 +65,8 @@ jobs: run: | git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false ) git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false ) + + ### SINGLE CLUSTER kind: runs-on: ubuntu-latest strategy: @@ -96,7 +98,7 @@ jobs: path: ${{ github.workspace }}/src/github.com/${{ github.repository }} - uses: engineerd/setup-kind@v0.5.0 with: - config: src/github.com/${{ github.repository }}/${{matrix.image <= 'v1.19.11' && 'cluster-config-old.yaml' || 'cluster-config.yaml'}} + config: src/github.com/${{ github.repository }}/cluster-config.yaml version: v0.13.0 image: kindest/node:${{ matrix.image }} - name: Check kind cluster @@ -112,7 +114,7 @@ jobs: echo CLUSTER_CIDR="172.18.1.128/25" >> $GITHUB_ENV - name: Integration tests run: | - go test -count 1 -timeout 1h55m -race -v -run Single + go test -count 1 -timeout 1h55m -race -v ./test_single env: ARTIFACTS_DIR: ${{ matrix.image }}-logs/${{ matrix.image }} working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} @@ -121,7 +123,57 @@ jobs: uses: actions/upload-artifact@v2 with: name: Single logs - path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/${{ matrix.image }}-logs + path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/test_single/${{ matrix.image }}-logs + + ### SINGLE IPv6 CLUSTER + kind-ipv6: + runs-on: ubuntu-latest + env: + KUBERNETES_VERSION: "v1.25.0" + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ github.token }} + - uses: actions/setup-go@v1 + with: + go-version: 1.16 + github-token: ${{ github.token }} + - name: Set go env + run: | + echo GOPATH=$GITHUB_WORKSPACE >> $GITHUB_ENV + echo GO111MODULE=on >> $GITHUB_ENV + echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH + - uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/src/github.com/${{ github.repository }} + - uses: engineerd/setup-kind@v0.5.0 + with: + config: src/github.com/${{ github.repository }}/cluster-config-ipv6.yaml + version: v0.13.0 + image: kindest/node:${{ env.KUBERNETES_VERSION }} + - name: Check kind cluster + run: | + kubectl version + kubectl get pods -A -o wide + working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} + - name: Set loadbalancer CIDR + run: | + echo CLUSTER_CIDR="fc00:f853:ccd:e793:1::/80" >> $GITHUB_ENV + - name: Integration tests + run: | + go test -count 1 -timeout 1h55m -race -v ./test_single_ipv6 + env: + ARTIFACTS_DIR: ipv6-logs/${{ env.KUBERNETES_VERSION }} + working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} + - name: Upload artifacts + if: ${{ success() || failure() || cancelled() }} + uses: actions/upload-artifact@v2 + with: + name: Single IPv6 logs + path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/test_single_ipv6/ipv6-logs + + ### SINGLE CALICO CLUSTER calico-kind: runs-on: ubuntu-latest env: @@ -171,7 +223,7 @@ jobs: - name: Integration tests continue-on-error: true run: | - go test -count 1 -timeout 1h30m -race -v -run Calico + go test -count 1 -timeout 1h30m -race -v ./test_calico env: ARTIFACTS_DIR: calico-logs/${{ env.KUBERNETES_VERSION }} working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} @@ -180,7 +232,9 @@ jobs: uses: actions/upload-artifact@v2 with: name: Calico logs - path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/calico-logs + path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/test_calico/calico-logs + + ### INTERDOMAIN CLUSTER interdomain-kind: runs-on: ubuntu-latest env: @@ -219,7 +273,7 @@ jobs: working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} - name: Interdomain tests run: | - go test -count 1 -timeout 1h -race -v -run Interdomain + go test -count 1 -timeout 1h -race -v ./test_interdomain env: ARTIFACTS_DIR: interdomain-logs working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }} @@ -231,4 +285,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: Interdomain logs - path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/interdomain-logs + path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/test_interdomain/interdomain-logs diff --git a/cluster-config-ipv6.yaml b/cluster-config-ipv6.yaml new file mode 100644 index 000000000..f832d10a1 --- /dev/null +++ b/cluster-config-ipv6.yaml @@ -0,0 +1,9 @@ +--- +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +networking: + ipFamily: ipv6 +nodes: + - role: control-plane + - role: worker + - role: worker diff --git a/cluster-config-old.yaml b/cluster-config-old.yaml deleted file mode 100644 index 63ffef3b2..000000000 --- a/cluster-config-old.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -kubeadmConfigPatches: - - | - apiVersion: kubeadm.k8s.io/v1beta2 - kind: ClusterConfiguration - metadata: - name: config - apiServer: - extraArgs: - "service-account-issuer": "kubernetes.default.svc" - "service-account-signing-key-file": "/etc/kubernetes/pki/sa.key" -nodes: - - role: control-plane - - role: worker - - role: worker diff --git a/go.mod b/go.mod index ca9e066e0..b4391f97b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/googleapis/gnostic v0.5.1 // indirect - github.com/networkservicemesh/integration-tests v0.0.0-20221023172725-a239c379e3bd + github.com/networkservicemesh/integration-tests v0.0.0-20221031134456-995be482ed4f github.com/stretchr/testify v1.7.0 gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index d6aa87ba4..5cebcb8af 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/networkservicemesh/gotestmd v0.0.0-20220628095933-eabbdc09e0dc h1:1L/OisEFsOyhwaqeJpYmM1nlJ2dBusUMiszPDBlUip0= github.com/networkservicemesh/gotestmd v0.0.0-20220628095933-eabbdc09e0dc/go.mod h1:8EWnekTRNX+NxBdTFE24WqUoM7SgJHbiafDBrIIdOmQ= -github.com/networkservicemesh/integration-tests v0.0.0-20221023172725-a239c379e3bd h1:Tj3omiENebPFKr2bASNEeDBGTtxblcRum9U79uXzfPA= -github.com/networkservicemesh/integration-tests v0.0.0-20221023172725-a239c379e3bd/go.mod h1:FiN76Emti1ZyhWMIG6vg6kXG//0wSCoKokBvp6i8bjM= +github.com/networkservicemesh/integration-tests v0.0.0-20221031134456-995be482ed4f h1:goudmK+rs0ERD0tFxinRz4W20W5PVtpEFH1OeTwZ1/4= +github.com/networkservicemesh/integration-tests v0.0.0-20221031134456-995be482ed4f/go.mod h1:FiN76Emti1ZyhWMIG6vg6kXG//0wSCoKokBvp6i8bjM= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= diff --git a/calico_test.go b/test_calico/calico_test.go similarity index 88% rename from calico_test.go rename to test_calico/calico_test.go index 7eed3d3e3..2abd4644d 100644 --- a/calico_test.go +++ b/test_calico/calico_test.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main_test import ( "testing" @@ -28,19 +28,19 @@ import ( "github.com/networkservicemesh/integration-tests/suites/observability" ) -func TestRunHealSuiteCalico(t *testing.T) { +func TestRunHealSuite(t *testing.T) { suite.Run(t, new(heal.Suite)) } -func TestRunBasicSuiteCalico(t *testing.T) { +func TestRunBasicSuite(t *testing.T) { suite.Run(t, new(basic.Suite)) } -func TestRunMemorySuiteCalico(t *testing.T) { +func TestRunMemorySuite(t *testing.T) { suite.Run(t, new(memory.Suite)) } -func TestRunObservabilitySuiteCalico(t *testing.T) { +func TestRunObservabilitySuite(t *testing.T) { suite.Run(t, new(observability.Suite)) } @@ -65,6 +65,6 @@ func (s *featuresSuite) BeforeTest(suiteName, testName string) { s.Suite.BeforeTest(suiteName, testName) } -func TestRunFeatureSuiteCalico(t *testing.T) { +func TestRunFeatureSuite(t *testing.T) { suite.Run(t, new(featuresSuite)) } diff --git a/interdomain_test.go b/test_interdomain/interdomain_test.go similarity index 98% rename from interdomain_test.go rename to test_interdomain/interdomain_test.go index b2cd1a1cb..3dfd8197c 100644 --- a/interdomain_test.go +++ b/test_interdomain/interdomain_test.go @@ -16,7 +16,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main_test import ( "testing" @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/networkservicemesh/integration-tests/suites/floating_interdomain" - "github.com/networkservicemesh/integration-tests/suites/interdomain" ) diff --git a/main_test.go b/test_single/main_test.go similarity index 82% rename from main_test.go rename to test_single/main_test.go index fcb7e5b68..4c532e2fd 100644 --- a/main_test.go +++ b/test_single/main_test.go @@ -17,7 +17,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package main_test import ( "testing" @@ -33,30 +33,30 @@ import ( "github.com/networkservicemesh/integration-tests/suites/remotevlan" ) -func TestRunHealSuiteSingle(t *testing.T) { +func TestRunHealSuite(t *testing.T) { suite.Run(t, new(heal.Suite)) } -func TestRunFeatureSuiteSingle(t *testing.T) { +func TestRunFeatureSuite(t *testing.T) { suite.Run(t, new(features.Suite)) } -func TestRunBasicSuiteSingle(t *testing.T) { +func TestRunBasicSuite(t *testing.T) { suite.Run(t, new(basic.Suite)) } -func TestRunMemorySuiteSingle(t *testing.T) { +func TestRunMemorySuite(t *testing.T) { suite.Run(t, new(memory.Suite)) } -func TestRunRvlanSuiteSingle(t *testing.T) { +func TestRunRvlanSuite(t *testing.T) { suite.Run(t, new(remotevlan.Suite)) } -func TestRunObservabilitySuiteSingle(t *testing.T) { +func TestRunObservabilitySuite(t *testing.T) { suite.Run(t, new(observability.Suite)) } -func TestK8sMonolithSuiteSingle(t *testing.T) { +func TestK8sMonolithSuite(t *testing.T) { suite.Run(t, new(k8s_monolith.Suite)) } diff --git a/test_single_ipv6/main_test.go b/test_single_ipv6/main_test.go new file mode 100644 index 000000000..31e4c8d9b --- /dev/null +++ b/test_single_ipv6/main_test.go @@ -0,0 +1,34 @@ +// Copyright (c) 2022 Cisco and/or its affiliates. +// +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + "github.com/networkservicemesh/integration-tests/suites/basic" + "github.com/networkservicemesh/integration-tests/suites/memory" +) + +func TestRunBasicSuite(t *testing.T) { + suite.Run(t, new(basic.Suite)) +} + +func TestRunMemorySuite(t *testing.T) { + suite.Run(t, new(memory.Suite)) +}