Skip to content

Commit 77b39ed

Browse files
committed
ovn-k, virt, preconfigured-udn-addrs: Test MAC conflict detection
Verify KubeVirt VMs with preconfigured MAC address retain a requested MAC address before and after another VM is created requesting the same MAC address. And verify the other VM requesting the same MAC address get the appropriate address conflict error event. Signed-off-by: Or Mergi <[email protected]>
1 parent f43feb8 commit 77b39ed

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

test/extended/networking/livemigration.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,20 @@ var _ = Describe("[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][F
328328
preconfiguredIPs: []string{"203.203.0.100", "2014:100:200::100"},
329329
},
330330
),
331+
Entry(
332+
"[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured MAC address is created when the address is already taken",
333+
networkAttachmentConfigParams{
334+
name: nadName,
335+
topology: "layer2",
336+
role: "primary",
337+
allowPersistentIPs: true,
338+
},
339+
kubevirt.FedoraVMWithPreconfiguredPrimaryUDNAttachment,
340+
duplicateVM,
341+
workloadNetworkConfig{
342+
preconfiguredMAC: "aa:bb:cc:dd:ee:ff",
343+
},
344+
),
331345
)
332346
},
333347
Entry("NetworkAttachmentDefinitions", func(c networkAttachmentConfigParams) networkAttachmentConfig {
@@ -586,6 +600,21 @@ func duplicateVM(cli *kubevirt.Client, vmNamespace, vmName string) {
586600
)
587601
})
588602
}
603+
604+
mac, err := cli.GetJSONPath("vmi", vmName, "{.spec.domain.devices.interfaces[0].macAddress}")
605+
Expect(err).NotTo(HaveOccurred())
606+
if len(mac) > 0 {
607+
vmiExpectations = append(vmiExpectations, func() {
608+
waitForVMPodEventWithMessage(
609+
cli,
610+
vmNamespace,
611+
duplicateVMName,
612+
"MAC address already in use",
613+
2*time.Minute,
614+
)
615+
})
616+
}
617+
589618
Expect(cli.CreateVMIFromSpec(vmNamespace, duplicateVMName, vmiSpec, vmiCreationOptions...)).To(Succeed())
590619
for _, expectation := range vmiExpectations {
591620
expectation()

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zz_generated.manifests/test-reporting.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,12 @@ spec:
972972
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
973973
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
974974
IPs attached to a primary UDN is restarted'
975+
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
976+
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
977+
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]
978+
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
979+
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
980+
MAC address is created when the address is already taken'
975981
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
976982
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
977983
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]
@@ -1026,6 +1032,12 @@ spec:
10261032
networks and persistent ips configured created using NetworkAttachmentDefinitions
10271033
[Suite:openshift/network/virtualization] should keep ip [OCPFeatureGate:PreconfiguredUDNAddresses]
10281034
when the VM with preconfigured IPs attached to a primary UDN is restarted'
1035+
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
1036+
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
1037+
networks and persistent ips configured created using NetworkAttachmentDefinitions
1038+
[Suite:openshift/network/virtualization] should keep ip [OCPFeatureGate:PreconfiguredUDNAddresses]
1039+
when the VM with preconfigured MAC address is created when the address is
1040+
already taken'
10291041
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
10301042
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
10311043
networks and persistent ips configured created using NetworkAttachmentDefinitions
@@ -1076,6 +1088,12 @@ spec:
10761088
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
10771089
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
10781090
IPs attached to a primary UDN is restarted'
1091+
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
1092+
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
1093+
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]
1094+
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
1095+
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
1096+
MAC address is created when the address is already taken'
10791097
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
10801098
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
10811099
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]
@@ -1159,6 +1177,12 @@ spec:
11591177
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
11601178
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
11611179
IPs attached to a primary UDN is restarted'
1180+
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
1181+
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
1182+
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]
1183+
UserDefinedNetwork [Suite:openshift/network/virtualization] should keep ip
1184+
[OCPFeatureGate:PreconfiguredUDNAddresses] when the VM with preconfigured
1185+
MAC address is created when the address is already taken'
11621186
- testName: '[sig-network][OCPFeatureGate:PersistentIPsForVirtualization][Feature:Layer2LiveMigration]
11631187
Kubevirt Virtual Machines when using openshift ovn-kubernetes with user defined
11641188
networks and persistent ips configured created using [OCPFeatureGate:NetworkSegmentation]

0 commit comments

Comments
 (0)