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 9, 2024
1 parent 49b355a commit fd4a2a7
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,48 @@ jobs:
with:
name: Interdomain logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_interdomain/interdomain-logs

### EXTENDED OVS SUITE
kind-ovs-extra:
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@v4
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@v4
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:${{ 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 25m -race -v ./tests_ovs_extended -parallel 4
env:
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@v3
with:
name: ovs_extra logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/tests_ovs_extended/ovs_extra-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-20240208162402-1172908e6311
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-20240208162402-1172908e6311 h1:sm5MsStI7vTIZ9tiiRYus3ZczjRkyiKAxLgoRsygEbs=
github.com/Nordix/integration-tests v0.0.0-20240208162402-1172908e6311/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-20240207113858-2d34e18235e6 h1:aIzQjfyUIX9yt1je8bX2igKAivDeXPqhEBtvwACNKeY=
github.com/networkservicemesh/integration-tests v0.0.0-20240207113858-2d34e18235e6/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) 2024 Nordix 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 ovsextra_test

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")
}
}
29 changes: 29 additions & 0 deletions tests_ovs_extended/heal_ovs_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2024 Nordix 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 ovsextra_test

import (
"testing"

"github.com/stretchr/testify/suite"

"github.com/networkservicemesh/integration-tests/suites/heal_ovs"
)

func TestRunHealOvsSuite(t *testing.T) {
suite.Run(t, new(heal_ovs.Suite))
}
52 changes: 52 additions & 0 deletions tests_single/ovs_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2023-2024 Nordix Foundation.
//
// 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 single

import (
"flag"
"testing"

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

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

// Disabled tests:
// SmartVF to SmartVF Connection - ../use-cases/SmartVF2SmartVF
// Temporary disabled tests:
// Kernel to Kernel Connection over VLAN Trunking - ../use-cases/Kernel2KernelVLAN
type kindOvsSuite struct {
ovs.Suite
}

func (s *kindOvsSuite) BeforeTest(suiteName, testName string) {
switch testName {
case
"TestSmartVF2SmartVF",
"TestKernel2KernelVLAN":
s.T().Skip()
}
}

func TestRunOvsSuite(t *testing.T) {
if !*smartVFFlag {
parallel.Run(t, new(kindOvsSuite))
} else {
parallel.Run(t, new(ovs.Suite))
}
}

0 comments on commit fd4a2a7

Please sign in to comment.