Skip to content

Commit 0648854

Browse files
committed
Enhanced multi NIC tests and reverted the revert
1 parent 3872d9d commit 0648854

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

test/e2e/vsphere/machines.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
machineReadyTimeout = time.Minute * 6
2424
)
2525

26-
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiDisk][platform:vsphere] Managed cluster should", func() {
26+
var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiDisk][platform:vsphere] Managed cluster should", Label("Conformance"), func() {
2727
defer GinkgoRecover()
2828
ctx := context.Background()
2929

@@ -46,7 +46,7 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiDisk][platf
4646
Expect(err).NotTo(HaveOccurred())
4747
})
4848

49-
It("create machines with data disks [apigroup:machine.openshift.io]", func() {
49+
It("create machines with data disks [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", func() {
5050
machineName := "machine-multi-test"
5151
dataDisks := []v1beta1.VSphereDisk{
5252
{
@@ -156,28 +156,28 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiDisk][platf
156156
err = mc.MachineSets(util.MachineAPINamespace).Delete(ctx, ddMachineSet.Name, metav1.DeleteOptions{})
157157
Expect(err).NotTo(HaveOccurred())
158158
},
159-
Entry("with thin data disk [apigroup:machine.openshift.io]", "ms-thin-test", []v1beta1.VSphereDisk{
159+
Entry("with thin data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-thin-test", []v1beta1.VSphereDisk{
160160
{
161161
Name: "thickDataDisk",
162162
SizeGiB: 1,
163163
ProvisioningMode: v1beta1.ProvisioningModeThick,
164164
},
165165
}),
166-
Entry("with thick data disk [apigroup:machine.openshift.io]", "ms-thick-test", []v1beta1.VSphereDisk{
166+
Entry("with thick data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-thick-test", []v1beta1.VSphereDisk{
167167
{
168168
Name: "thickDataDisk",
169169
SizeGiB: 1,
170170
ProvisioningMode: v1beta1.ProvisioningModeThick,
171171
},
172172
}),
173-
Entry("with eagerly zeroed data disk [apigroup:machine.openshift.io]", "ms-zeroed-test", []v1beta1.VSphereDisk{
173+
Entry("with eagerly zeroed data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-zeroed-test", []v1beta1.VSphereDisk{
174174
{
175175
Name: "zeroedDataDisk",
176176
SizeGiB: 1,
177177
ProvisioningMode: v1beta1.ProvisioningModeEagerlyZeroed,
178178
},
179179
}),
180-
Entry("with a data disk using each provisioning mode [apigroup:machine.openshift.io]", "ms-multi-test", []v1beta1.VSphereDisk{
180+
Entry("with a data disk using each provisioning mode [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-multi-test", []v1beta1.VSphereDisk{
181181
{
182182
Name: "thinDataDisk",
183183
SizeGiB: 1,

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)