Skip to content

Commit

Permalink
tests: Enable Macvtap feature in tests only
Browse files Browse the repository at this point in the history
Macvtap feature gate is enabled before the test suite start
regardless of what test is executed.

Signed-off-by: Or Mergi <[email protected]>
  • Loading branch information
ormergi committed Feb 5, 2024
1 parent adfcd1a commit feedeb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion tests/network/macvtap.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import (
v1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"

"kubevirt.io/kubevirt/pkg/virt-config/deprecation"

"kubevirt.io/kubevirt/tests"
"kubevirt.io/kubevirt/tests/console"
"kubevirt.io/kubevirt/tests/framework/checks"
Expand All @@ -49,7 +51,7 @@ import (
"kubevirt.io/kubevirt/tests/testsuite"
)

var _ = SIGDescribe("Macvtap", decorators.Macvtap, func() {
var _ = SIGDescribe("Macvtap", decorators.Macvtap, Serial, func() {
const (
macvtapLowerDevice = "eth0"
macvtapNetworkName = "net1"
Expand All @@ -61,6 +63,10 @@ var _ = SIGDescribe("Macvtap", decorators.Macvtap, func() {
virtClient = kubevirt.Client()
})

BeforeEach(func() {
tests.EnableFeatureGate(deprecation.MacvtapGate)
})

BeforeEach(func() {
ns := testsuite.GetTestNamespace(nil)
Expect(libnet.CreateMacvtapNetworkAttachmentDefinition(ns, macvtapNetworkName, macvtapLowerDevice)).To(Succeed(),
Expand Down
2 changes: 0 additions & 2 deletions tests/testsuite/kubevirtresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"kubevirt.io/client-go/kubecli"

virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
"kubevirt.io/kubevirt/pkg/virt-config/deprecation"
"kubevirt.io/kubevirt/tests/flags"
"kubevirt.io/kubevirt/tests/framework/checks"
"kubevirt.io/kubevirt/tests/util"
Expand Down Expand Up @@ -103,7 +102,6 @@ func AdjustKubeVirtResource() {
virtconfig.HotplugVolumesGate,
virtconfig.DownwardMetricsFeatureGate,
virtconfig.NUMAFeatureGate,
deprecation.MacvtapGate,
virtconfig.ExpandDisksGate,
virtconfig.WorkloadEncryptionSEV,
virtconfig.VMExportGate,
Expand Down

0 comments on commit feedeb2

Please sign in to comment.