Skip to content

Commit

Permalink
Fix expose tests which checks for VM restarts
Browse files Browse the repository at this point in the history
VMIs can not exist for some time when they are recreated by the VM.
  • Loading branch information
rmohr committed Apr 30, 2019
1 parent da8a690 commit 32f3e21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/expose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

v1 "kubevirt.io/kubevirt/pkg/api/v1"
Expand Down Expand Up @@ -431,6 +432,9 @@ var _ = Describe("[rfe_id:253][crit:medium][vendor:[email protected]][level:comp
By("Verifying the VMI is back up AFTER restart (in Running status with new UID).")
Eventually(func() bool {
vmi, err = virtClient.VirtualMachineInstance(vmObj.Namespace).Get(vmObj.Name, &k8smetav1.GetOptions{})
if errors.IsNotFound(err) {
return false
}
Expect(err).ToNot(HaveOccurred())
vmiUIdAfterRestart := vmi.GetObjectMeta().GetUID()
newUId := (vmiUIdAfterRestart != vmiUIdBeforeRestart)
Expand Down

0 comments on commit 32f3e21

Please sign in to comment.