Skip to content

Commit

Permalink
Merge pull request kubevirt#12569 from orelmisan/net-e2e-rm-iface-wit…
Browse files Browse the repository at this point in the history
…h-custom-pci

net, e2e: Rm VMI with custom PCI address
  • Loading branch information
kubevirt-bot authored Aug 12, 2024
2 parents 1185d7d + 03f3b98 commit dbaea25
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions tests/network/vmi_networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,29 +389,6 @@ var _ = SIGDescribe("[rfe_id:694][crit:medium][vendor:[email protected]][level:c
})
})

Context("VirtualMachineInstance with custom PCI address", func() {
checkPciAddress := func(vmi *v1.VirtualMachineInstance, expectedPciAddress string) {
err := console.SafeExpectBatch(vmi, []expect.Batcher{
&expect.BSnd{S: "\n"},
&expect.BExp{R: console.PromptExpression},
&expect.BSnd{S: "ls /sys/bus/pci/devices/" + expectedPciAddress + "/virtio0/net\n"},
&expect.BExp{R: "eth0"},
}, 15)
Expect(err).ToNot(HaveOccurred())
}

It("[test_id:1776]should configure custom Pci address", func() {
By("checking eth0 Pci address")
testVMI := libvmifact.NewAlpine(libnet.WithMasqueradeNetworking())
testVMI.Spec.Domain.Devices.Interfaces[0].PciAddress = "0000:01:00.0"
testVMI, err = virtClient.VirtualMachineInstance(testsuite.GetTestNamespace(nil)).Create(context.Background(), testVMI, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())

libwait.WaitUntilVMIReady(testVMI, console.LoginToAlpine)
checkPciAddress(testVMI, testVMI.Spec.Domain.Devices.Interfaces[0].PciAddress)
})
})

It("VMI with an interface that has ACPI Index set", func() {
const acpiIndex = 101
const pciAddress = "0000:01:00.0"
Expand All @@ -430,6 +407,8 @@ var _ = SIGDescribe("[rfe_id:694][crit:medium][vendor:[email protected]][level:c
err := console.SafeExpectBatch(testVMI, []expect.Batcher{
&expect.BSnd{S: "\n"},
&expect.BExp{R: console.PromptExpression},
&expect.BSnd{S: "ls /sys/bus/pci/devices/" + pciAddress + "/virtio0/net\n"},
&expect.BExp{R: "eth0"},
&expect.BSnd{S: "cat /sys/bus/pci/devices/" + pciAddress + "/acpi_index\n"},
&expect.BExp{R: strconv.Itoa(acpiIndex)},
}, 15)
Expand Down

0 comments on commit dbaea25

Please sign in to comment.