multi-queue, tests: assuret we can request a VM with a single vCPU
@@ -35,6 +35,7 @@ import (
"kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
"kubevirt.io/kubevirt/tests"
cd "kubevirt.io/kubevirt/tests/containerdisk"
+ "kubevirt.io/kubevirt/tests/libvmi"
)
var _ = Describe("[Serial]MultiQueue", func() {
@@ -123,5 +124,31 @@ var _ = Describe("[Serial]MultiQueue", func() {
}
})
+ It("should be able to create a multi-queue VMI when requesting a single vCPU", func() {
+ vmi := libvmi.NewCirros()
+
+ multiQueue := true
+ vmi.Spec.Domain.CPU = &v1.CPU{Cores: 1, Sockets: 1, Threads: 1}
+ vmi.Spec.Domain.Devices.NetworkInterfaceMultiQueue = &multiQueue
+
+ By("Creating and starting the VMI")
+ vmi, err := virtClient.VirtualMachineInstance(tests.NamespaceTestDefault).Create(vmi)
+ Expect(err).ToNot(HaveOccurred())
+ tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 360)
+
+ By("Fetching Domain XML from running pod")
+ domain, err := tests.GetRunningVirtualMachineInstanceDomainXML(virtClient, vmi)
+ Expect(err).ToNot(HaveOccurred())
+ domSpec := &api.DomainSpec{}
+ Expect(xml.Unmarshal([]byte(domain), domSpec)).To(Succeed())
+
+ for i, iface := range domSpec.Devices.Interfaces {
+ expectedIfaceName := fmt.Sprintf("tap%d", i)
+
+ Expect(iface.Target.Device).To(Equal(expectedIfaceName), fmt.Sprintf("the target name should be %s", expectedIfaceName))
+ Expect(iface.Target.Managed).To(Equal("no"), "we should instruct libvirt not to configure the tap device")
+ }
+ })
+
})
})
