Skip to content

Commit

Permalink
Re-add back in affinity group test. Was commented out because it was …
Browse files Browse the repository at this point in the history
…slow.
  • Loading branch information
Joshua Reed committed May 25, 2022
1 parent 37d6643 commit e314aae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 273 deletions.
251 changes: 0 additions & 251 deletions acs.yaml

This file was deleted.

44 changes: 22 additions & 22 deletions test/unit/cloud/affinity_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,28 @@ var _ = Describe("The AffinityGroup interface", func() {
It("creates an affinity group.", func() {
Ω(client.GetOrCreateAffinityGroup(dummies.AffinityGroup)).Should(Succeed())
})
// Context("with an existing VM", func() {
// BeforeEach(func() {
// Ω(client.ResolveZone(dummies.CSZone1)).Should(Succeed())
// Ω(dummies.CSZone1.Spec.ID).ShouldNot(BeEmpty())
// dummies.CSMachine1.Status.ZoneID = dummies.CSZone1.Spec.ID
// dummies.CSMachine1.Spec.DiskOffering.Name = ""
// dummies.CSCluster.Spec.ControlPlaneEndpoint.Host = ""
// Ω(client.GetOrCreateIsolatedNetwork(dummies.CSZone1, dummies.CSISONet1, dummies.CSCluster)).Should(Succeed())
// dummies.CSZone1.Spec.Network.ID = dummies.CSISONet1.Spec.ID
// Ω(client.GetOrCreateVMInstance(
// dummies.CSMachine1, dummies.CAPIMachine, dummies.CSCluster, dummies.CSZone1, dummies.CSAffinityGroup, "",
// )).Should(Succeed())
// })
// AfterEach(func() {
// Ω(client.DestroyVMInstance(dummies.CSMachine1)).Should(MatchError("VM deletion in progress"))
// })
// It("associates an affinity group and disassociates it", func() {
// Ω(client.GetOrCreateAffinityGroup(dummies.AffinityGroup)).Should(Succeed())
// Ω(client.AssociateAffinityGroup(dummies.CSMachine1, *dummies.AffinityGroup)).Should(Succeed())
// Ω(client.DisassociateAffinityGroup(dummies.CSMachine1, *dummies.AffinityGroup)).Should(Succeed())
// })
// })
Context("with an existing VM", func() {
BeforeEach(func() {
Ω(client.ResolveZone(dummies.CSZone1)).Should(Succeed())
Ω(dummies.CSZone1.Spec.ID).ShouldNot(BeEmpty())
dummies.CSMachine1.Status.ZoneID = dummies.CSZone1.Spec.ID
dummies.CSMachine1.Spec.DiskOffering.Name = ""
dummies.CSCluster.Spec.ControlPlaneEndpoint.Host = ""
Ω(client.GetOrCreateIsolatedNetwork(dummies.CSZone1, dummies.CSISONet1, dummies.CSCluster)).Should(Succeed())
dummies.CSZone1.Spec.Network.ID = dummies.CSISONet1.Spec.ID
Ω(client.GetOrCreateVMInstance(
dummies.CSMachine1, dummies.CAPIMachine, dummies.CSCluster, dummies.CSZone1, dummies.CSAffinityGroup, "",
)).Should(Succeed())
})
AfterEach(func() {
Ω(client.DestroyVMInstance(dummies.CSMachine1)).Should(MatchError("VM deletion in progress"))
})
It("associates an affinity group and disassociates it", func() {
Ω(client.GetOrCreateAffinityGroup(dummies.AffinityGroup)).Should(Succeed())
Ω(client.AssociateAffinityGroup(dummies.CSMachine1, *dummies.AffinityGroup)).Should(Succeed())
Ω(client.DisassociateAffinityGroup(dummies.CSMachine1, *dummies.AffinityGroup)).Should(Succeed())
})
})
It("deletes an affinity group.", func() {
Ω(client.DeleteAffinityGroup(dummies.AffinityGroup)).Should(Succeed())
Ω(client.FetchAffinityGroup(dummies.AffinityGroup)).ShouldNot(Succeed())
Expand Down

0 comments on commit e314aae

Please sign in to comment.