tests, network, primary-pod: Use libvmi for bridge binding
@@ -113,7 +113,13 @@ var _ = SIGDescribe("Primary Pod Network", func() {
var vmi *v1.VirtualMachineInstance
BeforeEach(func() {
- vmi = setupVMI(virtClient, vmiWithBridgeBinding())
+ vmi = setupVMI(
+ virtClient,
+ libvmi.NewAlpine(
+ libvmi.WithInterface(*v1.DefaultBridgeNetworkInterface()),
+ libvmi.WithNetwork(v1.DefaultPodNetwork()),
+ ),
+ )
})
It("should report PodIP as its own on interface status", func() { AssertReportedIP(vmi) })
@@ -173,13 +179,6 @@ func setupVMI(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance)
return vmi
}
-func vmiWithBridgeBinding() *v1.VirtualMachineInstance {
- vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
- vmi.Spec.Domain.Devices.Interfaces = []v1.Interface{*v1.DefaultBridgeNetworkInterface()}
- vmi.Spec.Networks = []v1.Network{*v1.DefaultPodNetwork()}
- return vmi
-}
-
func vmiWithMasqueradeBinding() *v1.VirtualMachineInstance {
vmi := tests.NewRandomVMIWithEphemeralDisk(cd.ContainerDiskFor(cd.ContainerDiskAlpine))
vmi.Spec.Domain.Devices.Interfaces = []v1.Interface{*v1.DefaultMasqueradeNetworkInterface()}
