Skip to content

Commit

Permalink
net, multus annotations, test: Add missing suite file
Browse files Browse the repository at this point in the history
Following PR kubevirt#12480, the code responsible for Multus'
low-level annotation generation was moved under `pkg/network/multus`.

Add the missing suite file that causes the tests to run.
Fix the broken annotation pool test.

Signed-off-by: Orel Misan <omisan@redhat.com>
  • Loading branch information
orelmisan committed Sep 6, 2024
1 parent 06f8bcd commit 2f695d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/network/multus/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ go_test(
name = "go_default_test",
srcs = [
"annotation_test.go",
"multus_suite_test.go",
"nad_test.go",
],
deps = [
":go_default_library",
"//pkg/testutils:go_default_library",
"//pkg/virt-config:go_default_library",
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/client-go/testutils:go_default_library",
"//vendor/github.com/onsi/ginkgo/v2:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/multus/annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var _ = Describe("Multus annotations", func() {

Context("a multus annotation pool with elements", func() {
BeforeEach(func() {
multusAnnotationPool := multus.NetworkAnnotationPool{}
multusAnnotationPool = multus.NetworkAnnotationPool{}
multusAnnotationPool.Add(multus.NewAnnotationData(vmi.Namespace, vmi.Spec.Domain.Devices.Interfaces, network, "net1"))
})

Expand Down
30 changes: 30 additions & 0 deletions pkg/network/multus/multus_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file is part of the KubeVirt project
*
* 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.
*
* Copyright 2024 The KubeVirt Authors.
*
*/

package multus_test

import (
"testing"

"kubevirt.io/client-go/testutils"
)

func TestMultus(t *testing.T) {
testutils.KubeVirtTestSuiteSetup(t)
}

0 comments on commit 2f695d4

Please sign in to comment.