Skip to content

Commit

Permalink
fix re-apply test #2243 (#108)
Browse files Browse the repository at this point in the history
Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi authored Mar 31, 2020
1 parent 3cc670d commit 41b341e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/virtual_machines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ var _ = Describe("Virtual Machines", func() {
}, timeout, pollingInterval).Should(HaveOccurred())
})
})
//2243 test postponed due to issue: https://github.com/k8snetworkplumbingwg/kubemacpool/issues/102
PContext("When we re-apply a VM yaml", func() {
//2243
Context("When we re-apply a VM yaml", func() {
It("should assign to the VM the same MAC addresses as before the re-apply, and not return an error", func() {
err := setRange(rangeStart, rangeEnd)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -313,11 +313,13 @@ var _ = Describe("Virtual Machines", func() {
_, err = net.ParseMAC(vm1.Spec.Template.Spec.Domain.Devices.Interfaces[index].MacAddress)
Expect(err).ToNot(HaveOccurred())
}
err = testClient.VirtClient.Get(context.TODO(), client.ObjectKey{Namespace: updateObject.Namespace, Name: updateObject.Name}, updateObject)
Expect(err).ToNot(HaveOccurred())

err = retry.RetryOnConflict( retry.DefaultRetry, func() error {
err = testClient.VirtClient.Update(context.TODO(), updateObject)
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {

err = testClient.VirtClient.Get(context.TODO(), client.ObjectKey{Namespace: updateObject.Namespace, Name: updateObject.Name}, updateObject)
Expect(err).ToNot(HaveOccurred())

err = testClient.VirtClient.Update(context.TODO(), updateObject)
return err
})
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 41b341e

Please sign in to comment.