Skip to content

Commit

Permalink
Added ovs kernel mechanism tests
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 20, 2024
1 parent ed1b689 commit bfd50e1
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,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
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 bfd50e1

Please sign in to comment.