Skip to content

Commit 96394c8

Browse files
Merge pull request #1358 from vr4manta/OCPBUGS-55424
OCPBUGS-55424: Added skip for when config not multi nic
2 parents fca6b41 + f2313fa commit 96394c8

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

test/e2e/vsphere/machines.go

Lines changed: 16 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
{
@@ -151,33 +151,43 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiDisk][platf
151151
err = util.ScaleMachineSet(cfg, ddMachineSet.Name, 0)
152152
Expect(err).NotTo(HaveOccurred())
153153

154+
// Verify / wait for machine is removed
155+
By("verifying machine is destroyed")
156+
Eventually(func() (int32, error) {
157+
ms, err := mc.MachineSets(util.MachineAPINamespace).Get(ctx, ddMachineSet.Name, metav1.GetOptions{})
158+
if err != nil {
159+
return -1, err
160+
}
161+
return ms.Status.ReadyReplicas, nil
162+
}, machineReadyTimeout).Should(BeEquivalentTo(0))
163+
154164
// Delete machineset
155165
By("deleting the machineset")
156166
err = mc.MachineSets(util.MachineAPINamespace).Delete(ctx, ddMachineSet.Name, metav1.DeleteOptions{})
157167
Expect(err).NotTo(HaveOccurred())
158168
},
159-
Entry("with thin data disk [apigroup:machine.openshift.io]", "ms-thin-test", []v1beta1.VSphereDisk{
169+
Entry("with thin data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-thin-test", []v1beta1.VSphereDisk{
160170
{
161171
Name: "thickDataDisk",
162172
SizeGiB: 1,
163173
ProvisioningMode: v1beta1.ProvisioningModeThick,
164174
},
165175
}),
166-
Entry("with thick data disk [apigroup:machine.openshift.io]", "ms-thick-test", []v1beta1.VSphereDisk{
176+
Entry("with thick data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-thick-test", []v1beta1.VSphereDisk{
167177
{
168178
Name: "thickDataDisk",
169179
SizeGiB: 1,
170180
ProvisioningMode: v1beta1.ProvisioningModeThick,
171181
},
172182
}),
173-
Entry("with eagerly zeroed data disk [apigroup:machine.openshift.io]", "ms-zeroed-test", []v1beta1.VSphereDisk{
183+
Entry("with eagerly zeroed data disk [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-zeroed-test", []v1beta1.VSphereDisk{
174184
{
175185
Name: "zeroedDataDisk",
176186
SizeGiB: 1,
177187
ProvisioningMode: v1beta1.ProvisioningModeEagerlyZeroed,
178188
},
179189
}),
180-
Entry("with a data disk using each provisioning mode [apigroup:machine.openshift.io]", "ms-multi-test", []v1beta1.VSphereDisk{
190+
Entry("with a data disk using each provisioning mode [apigroup:machine.openshift.io][Suite:openshift/conformance/parallel]", "ms-multi-test", []v1beta1.VSphereDisk{
181191
{
182192
Name: "thinDataDisk",
183193
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)