Skip to content

Commit

Permalink
[test] Run ovs kernel mechanism test
Browse files Browse the repository at this point in the history
Related issue: networkservicemesh/deployments-k8s#9778

Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
  • Loading branch information
ljkiraly committed Feb 7, 2024
1 parent c2ea3df commit f68ac99
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 297 deletions.
302 changes: 7 additions & 295 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,119 +21,8 @@ jobs:
checkgomod:
uses: networkservicemesh/.github/.github/workflows/checkgomod.yaml@main

### SINGLE CLUSTER
kind:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- v1.28.0
- v1.27.2
- v1.26.4
- v1.25.11
- v1.24.15
- v1.23.17
- v1.22.17
- v1.21.14
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.20.5
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.yaml
version: v0.13.0
image: kindest/node:${{ matrix.image }}
- name: Check kind cluster
run: |
kubectl version
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Set loadbalancer CIDR
run: |
echo CLUSTER_CIDR="172.18.1.128/25" >> $GITHUB_ENV
- name: Integration tests
run: |
go test -count 1 -timeout 2h30m -race -v ./tests_single -parallel 4
env:
ARTIFACTS_DIR: ${{ matrix.image }}-logs/${{ matrix.image }}
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Upload artifacts
if: ${{ success() || failure() || cancelled() }}
uses: actions/upload-artifact@v2
with:
name: Single logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_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.20.5
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 2h10m -race -v \
./tests_single/basic_test.go \
./tests_single/memory_test.go -parallel 4
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 }}/tests_single/ipv6-logs

### AF_XDP SUITE
kind-afxdp:
### EXTENDED OVS SUITE
kind-ovs-extra:
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: "v1.25.0"
Expand Down Expand Up @@ -166,193 +55,16 @@ jobs:
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Integration tests
run: |
go test -count 1 -timeout 1h -race -v ./tests_afxdp -parallel 4
go test -count 1 -timeout 1h -race -v ./tests_ovs_extended -parallel 4
env:
ARTIFACTS_DIR: afxdp-logs/${{ env.KUBERNETES_VERSION }}
ARTIFACTS_DIR: ovs_extra-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: afxdp logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_afxdp/afxdp-logs
name: ovs_extra logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_ovs_extended/ovs_extra-logs

### SINGLE CALICO CLUSTER
calico-kind:
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: ${{ secrets.NSM_KUBERNETES_VERSION }}
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.20.5
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
- name: Set kubernetes version
run: |
if [[ $KUBERNETES_VERSION=="" ]]; then
echo "KUBERNETES_VERSION=v1.22.1" >> $GITHUB_ENV
fi
- 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-calico.yaml
version: v0.11.1
image: kindest/node:${{ env.KUBERNETES_VERSION }}
wait: 0s
- name: Setup external CNI plugin
shell: bash {0}
run: |
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml
for i in {1..5}; do
kubectl wait --for condition=established --timeout=1s crd/installations.operator.tigera.io
result=$?
if [ $result -eq 0 ]; then
break
fi
sleep 1s
done
kubectl create -f https://raw.githubusercontent.com/projectcalico/vpp-dataplane/ba374a0583d8ab7938d0e46056c148563ee911ec/yaml/calico/installation-default.yaml
kubectl apply -k ${{ github.workspace }}/src/github.com/${{ github.repository }}/calico
kubectl rollout status -n calico-vpp-dataplane ds/calico-vpp-node --timeout=5m
- name: Check kind cluster
run: |
kubectl version
kubectl cluster-info
kubectl get pods --all-namespaces
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Integration tests
continue-on-error: true
run: |
go test -count 1 -timeout 1h30m -race -v \
./tests_single/basic_test.go \
./tests_single/heal_test.go \
./tests_single/memory_test.go \
./tests_single/observability_test.go \
./tests_single/feature_test.go \
-calico -parallel 4
env:
ARTIFACTS_DIR: calico-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: Calico logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_single/calico-logs

### HEAL EXTENDED SUITE
kind-heal-extended:
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: "v1.28.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.20.11
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.yaml
version: v0.20.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: Integration tests
run: |
go test -count 1 -timeout 1h -race -v ./tests_heal_ext -parallel 4
env:
ARTIFACTS_DIR: heal-ext-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: heal-ext logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_heal_ext/heal-ext-logs

### INTERDOMAIN CLUSTER
interdomain-kind:
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: ${{ secrets.NSM_KUBERNETES_VERSION }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- name: Remove unnecessary files
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- uses: actions/setup-go@v1
with:
go-version: 1.20.5
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 }}
- name: Get kind
run: go install sigs.k8s.io/kind@v0.11.1
- name: Create kind clusters
run: |
if [[ $KUBERNETES_VERSION=="" ]]; then
KUBERNETES_VERSION="v1.22.1"
fi
for (( i = 1; i <= 3; i++ )); do
kind create cluster --name "kind-${i}" --config cluster-config-interdomain.yaml --image="kindest/node:$KUBERNETES_VERSION"
configPath=${{ github.workspace }}/src/github.com/${{ github.repository }}/config${i}
kind get kubeconfig --name "kind-${i}" > ${configPath}
echo KUBECONFIG${i}=${configPath} >> $GITHUB_ENV
echo CLUSTER${i}_CIDR="172.18.${i}.128/25" >> $GITHUB_ENV
done
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Interdomain tests
run: |
go test -count 1 -timeout 1h -race -v ./tests_interdomain -parallel 4
env:
ARTIFACTS_DIR: interdomain-logs
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Cleanup resources
if: ${{ success() || failure() || cancelled() }}
run: kind delete clusters $(kind get clusters)
- name: Upload artifacts
if: ${{ success() || failure() || cancelled() }}
uses: actions/upload-artifact@v2
with:
name: Interdomain logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_interdomain/interdomain-logs

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ require (
golang.org/x/sys v0.15.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/networkservicemesh/integration-tests => github.com/Nordix/integration-tests v0.0.0-20240206122050-5b98d2fb9c1b
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/Nordix/integration-tests v0.0.0-20240206122050-5b98d2fb9c1b h1:SO7KuR5igRKFmjL2gXksgQUtNe0cBJ/ENhK5f/s1VLY=
github.com/Nordix/integration-tests v0.0.0-20240206122050-5b98d2fb9c1b/go.mod h1:WLpOEldvahZQkJSdU3kspIS4tB1x1hDnWP08B/nCTjM=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -14,8 +16,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
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-20240206140551-8ef18eb96777 h1:ryzMbo5Wpjb3k6eZTeJLLPh1/tF76N0cr1KdLTyYKVk=
github.com/networkservicemesh/integration-tests v0.0.0-20240206140551-8ef18eb96777/go.mod h1:WLpOEldvahZQkJSdU3kspIS4tB1x1hDnWP08B/nCTjM=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
47 changes: 47 additions & 0 deletions tests_ovs_extended/feature_ovs_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2023 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 ovs_extended

import (
"flag"
"testing"

"github.com/networkservicemesh/integration-tests/extensions/parallel"
"github.com/networkservicemesh/integration-tests/suites/features_ovs"
)

var smartVFFlag = flag.Bool("smart", false, "selects smartVF tests")

// Disabled tests for kind:
// SmartVF to SmartVF Connection - ../features/webhook-smartvf
type kindFeatOvsSuite struct {
features_ovs.Suite
}

func (s *kindFeatOvsSuite) BeforeTest(suiteName, testName string) {
if testName == "TestWebhook_smartvf" {
s.T().Skip()
}
}

func TestRunFeatureOvsSuite(t *testing.T) {
if !*smartVFFlag {
parallel.Run(t, new(kindFeatOvsSuite), "TestScale_from_zero", "TestNse_composition", "TestSelect_forwarder")
} else {
parallel.Run(t, new(features_ovs.Suite), "TestScale_from_zero", "TestNse_composition", "TestSelect_forwarder")
}
}
Loading

0 comments on commit f68ac99

Please sign in to comment.