Skip to content

Commit 9b49083

Browse files
committed
Fixed NIC tests and added parallel suite
1 parent e668700 commit 9b49083

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

test/e2e/vsphere/multi-nic.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,21 @@ func failIfIncorrectPortgroupsAttachedToVMs(
8282
}
8383

8484
func failIfNodeNetworkingInconsistentWithMachineNetwork(infra configv1.PlatformSpec, machineNetworks []string) {
85+
// This can happen in scenarios where multinetwork is not enabled.
86+
if len(infra.VSphere.NodeNetworking.External.NetworkSubnetCIDR) == 0 ||
87+
len(infra.VSphere.NodeNetworking.Internal.NetworkSubnetCIDR) == 0 {
88+
Skip("skipping test due to incomplete config")
89+
}
90+
8591
internalNodeNetworking := infra.VSphere.NodeNetworking.Internal
8692
externalNodeNetworking := infra.VSphere.NodeNetworking.External
8793

94+
// machineNetworks contain the VIPs now so we'll need to check each network to see if we find one that matches internal/external.
8895
By("comparing nodeNetworking slices to the machine network")
8996
for _, nodeNetworkingSpec := range []configv1.VSpherePlatformNodeNetworkingSpec{internalNodeNetworking, externalNodeNetworking} {
90-
slices.Sort(nodeNetworkingSpec.NetworkSubnetCIDR)
91-
Expect(slices.Equal(nodeNetworkingSpec.NetworkSubnetCIDR, machineNetworks)).To(BeTrue())
97+
for _, network := range nodeNetworkingSpec.NetworkSubnetCIDR {
98+
Expect(slices.Contains(machineNetworks, network)).To(BeTrue())
99+
}
92100
}
93101
}
94102

@@ -126,7 +134,7 @@ func failIfMachineDoesNotHaveAllPortgroups(machine machinev1beta1.Machine, failu
126134
Expect(slices.Equal(expectedPortgroups, portgroups)).To(BeTrue())
127135
}
128136

129-
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][platform:vsphere] Managed cluster should", func() {
137+
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][platform:vsphere] Managed cluster should", Label("Conformance"), func() {
130138
defer GinkgoRecover()
131139
ctx := context.Background()
132140

@@ -190,24 +198,24 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
190198
}
191199
})
192200

193-
It("node addresses should be correlated with the machine network", func() {
201+
It("node addresses should be correlated with the machine network [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
194202
By("checking for correlation between node internal/external IPs and the machine network")
195203
failIfNodeNotInMachineNetwork(*nodes, machineNetworks)
196204
})
197205

198-
It("machine network should be correlated with node networking", func() {
206+
It("machine network should be correlated with node networking [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
199207
failIfNodeNetworkingInconsistentWithMachineNetwork(infra.Spec.PlatformSpec, machineNetworks)
200208
})
201209

202-
It("machines should have all specified portgroup associated with their failure domain", func() {
210+
It("machines should have all specified portgroup associated with their failure domain [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
203211
failIfMachinesDoNotHaveAllPortgroups(infra.Spec.PlatformSpec, machines)
204212
})
205213

206-
It("node VMs should have all specified portgroups attached which are associated with their failure domain", func() {
214+
It("node VMs should have all specified portgroups attached which are associated with their failure domain [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
207215
failIfIncorrectPortgroupsAttachedToVMs(ctx, infra.Spec.PlatformSpec, nodes, vsphereCreds)
208216
})
209217

210-
It("new machines should pass multi network tests", func() {
218+
It("new machines should pass multi network tests [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
211219
machineSets, err := e2eutil.GetMachineSets(cfg)
212220
Expect(err).NotTo(HaveOccurred())
213221

0 commit comments

Comments
 (0)