@@ -24,6 +24,9 @@ import (
24
24
)
25
25
26
26
func failIfNodeNotInMachineNetwork (nodes corev1.NodeList , machineNetworks []string ) {
27
+
28
+ By ("checking if nodes are in the machine network" )
29
+
27
30
for _ , node := range nodes .Items {
28
31
for _ , address := range node .Status .Addresses {
29
32
if address .Type != "InternalIP" && address .Type != "ExternalIP" {
@@ -41,6 +44,9 @@ func failIfIncorrectPortgroupsAttachedToVMs(
41
44
infra configv1.PlatformSpec ,
42
45
nodeList * corev1.NodeList ,
43
46
vsphereCreds * corev1.Secret ) {
47
+
48
+ By ("checking if VMs have the correct portgroups attached" )
49
+
44
50
for _ , failureDomain := range infra .VSphere .FailureDomains {
45
51
nodes , err := getNodesInFailureDomain (infra .VSphere , failureDomain , nodeList )
46
52
fmt .Printf ("nodes: %d" , len (nodes ))
@@ -87,6 +93,9 @@ func failIfNodeNetworkingInconsistentWithMachineNetwork(infra configv1.PlatformS
87
93
}
88
94
89
95
func failIfMachinesDoNotHaveAllPortgroups (platformSpec configv1.PlatformSpec , machines * machinev1beta1.MachineList ) {
96
+
97
+ By ("checking to see if machines have all portgroups" )
98
+
90
99
for _ , failureDomain := range platformSpec .VSphere .FailureDomains {
91
100
machinesInFailureDomain , err := getMachinesInFailureDomain (platformSpec .VSphere , failureDomain , machines )
92
101
Expect (err ).NotTo (HaveOccurred ())
@@ -98,6 +107,9 @@ func failIfMachinesDoNotHaveAllPortgroups(platformSpec configv1.PlatformSpec, ma
98
107
}
99
108
100
109
func failIfMachineDoesNotHaveAllPortgroups (machine machinev1beta1.Machine , failureDomain configv1.VSpherePlatformFailureDomainSpec ) {
110
+
111
+ By ("checking to see if machine has all portgroups" )
112
+
101
113
spec , err := vsphere .ProviderSpecFromRawExtension (machine .Spec .ProviderSpec .Value )
102
114
Expect (err ).NotTo (HaveOccurred ())
103
115
@@ -204,6 +216,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
204
216
machineSet := machineSets .Items [0 ]
205
217
206
218
// scale up new machine and wait for scale up to complete
219
+ By ("scaling up a new machineset which should have multiple NICs" )
207
220
err = e2eutil .ScaleMachineSet (cfg , machineSet .Name , int (* machineSet .Spec .Replicas )+ 1 )
208
221
Expect (err ).NotTo (HaveOccurred ())
209
222
@@ -213,6 +226,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
213
226
machines , err = mc .Machines ("openshift-machine-api" ).List (ctx , v1.ListOptions {})
214
227
Expect (err ).NotTo (HaveOccurred ())
215
228
229
+ By ("determining common port groups among machines" )
216
230
portGroups := make (map [string ]any )
217
231
for _ , machine := range machines .Items {
218
232
providerSpec , err := vsphere .ProviderSpecFromRawExtension (machine .Spec .ProviderSpec .Value )
@@ -232,5 +246,4 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
232
246
failIfMachinesDoNotHaveAllPortgroups (infra .Spec .PlatformSpec , machines )
233
247
failIfIncorrectPortgroupsAttachedToVMs (ctx , infra .Spec .PlatformSpec , nodes , vsphereCreds )
234
248
})
235
-
236
249
})
0 commit comments