Add virtio-transitional e2e test
Ensure that all components with virtio model are set to
virto-transitional if requested and that the VM can still boot
successfully.
@@ -27,8 +27,6 @@ import (
"strings"
"time"
- "kubevirt.io/kubevirt/pkg/util/cluster"
-
expect "github.com/google/goexpect"
. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
@@ -39,15 +37,17 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
-
- "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
+ "k8s.io/utils/pointer"
v1 "kubevirt.io/client-go/api/v1"
"kubevirt.io/client-go/kubecli"
"kubevirt.io/client-go/log"
kubevirt_hooks_v1alpha2 "kubevirt.io/kubevirt/pkg/hooks/v1alpha2"
+ "kubevirt.io/kubevirt/pkg/testutils"
+ "kubevirt.io/kubevirt/pkg/util/cluster"
hw_utils "kubevirt.io/kubevirt/pkg/util/hardware"
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
+ "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
"kubevirt.io/kubevirt/tests"
"kubevirt.io/kubevirt/tests/console"
cd "kubevirt.io/kubevirt/tests/containerdisk"
@@ -90,7 +90,21 @@ var _ = Describe("Configurations", func() {
}
Expect(rootPortController).To(HaveLen(0), "libvirt should not add additional buses to the root one")
})
+ })
+ Context("when requesting virtio-transitional models", func() {
+ It("should start and run the guest", func() {
+ vmi := tests.NewRandomVMIWithEphemeralDiskAndUserdata(cd.ContainerDiskFor(cd.ContainerDiskCirros), "#!/bin/bash\necho 'hello'\n")
+ vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
+ vmi.Spec.Domain.Devices.Inputs = []v1.Input{{Name: "tablet", Bus: "virtio", Type: "tablet"}, {Name: "tablet1", Bus: "usb", Type: "tablet"}}
+ vmi.Spec.Domain.Devices.Watchdog = &v1.Watchdog{Name: "watchdog", WatchdogDevice: v1.WatchdogDevice{I6300ESB: &v1.I6300ESBWatchdog{Action: v1.WatchdogActionPoweroff}}}
+ vmi.Spec.Domain.Devices.UseVirtioTransitional = pointer.BoolPtr(true)
+ vmi = tests.RunVMIAndExpectLaunch(vmi, 60)
+ Expect(libnet.WithIPv6(console.LoginToCirros)(vmi)).To(Succeed())
+ domSpec, err := tests.GetRunningVMIDomainSpec(vmi)
+ Expect(err).ToNot(HaveOccurred())
+ testutils.ExpectVirtioTransitionalOnly(domSpec)
+ })
})
Context("[rfe_id:897][crit:medium][vendor:cnv-qe@redhat.com][level:component]for CPU and memory limits should", func() {
