Skip to content

Commit

Permalink
check pod ips instead of annotation
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Apr 12, 2024
1 parent ab65690 commit e7e9cea
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/e2e/kubevirt/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var _ = framework.Describe("[group:kubevirt]", func() {
framework.ExpectHaveKeyWithValue(pod.Annotations, util.AllocatedAnnotation, "true")
framework.ExpectHaveKeyWithValue(pod.Annotations, util.RoutedAnnotation, "true")
framework.ExpectHaveKeyWithValue(pod.Annotations, util.VMAnnotation, vmName)
ipAddr := pod.Annotations[util.IPAddressAnnotation]
ips := pod.Status.PodIPs

ginkgo.By("Deleting pod " + pod.Name)
podClient.DeleteSync(pod.Name)
Expand All @@ -97,8 +97,7 @@ var _ = framework.Describe("[group:kubevirt]", func() {
framework.ExpectHaveKeyWithValue(pod.Annotations, util.VMAnnotation, vmName)

ginkgo.By("Checking whether pod ips are changed")
ipNewAddr := pod.Annotations[util.IPAddressAnnotation]
framework.ExpectEqual(ipAddr, ipNewAddr)
framework.ExpectConsistOf(ips, pod.Status.PodIPs)
})

framework.ConformanceIt("should be able to keep pod ips after the vm is restarted", func() {
Expand All @@ -115,7 +114,7 @@ var _ = framework.Describe("[group:kubevirt]", func() {
framework.ExpectHaveKeyWithValue(pod.Annotations, util.AllocatedAnnotation, "true")
framework.ExpectHaveKeyWithValue(pod.Annotations, util.RoutedAnnotation, "true")
framework.ExpectHaveKeyWithValue(pod.Annotations, util.VMAnnotation, vmName)
ipAddr := pod.Annotations[util.IPAddressAnnotation]
ips := pod.Status.PodIPs

ginkgo.By("Stopping vm " + vmName)
vmClient.StopSync(vmName)
Expand All @@ -139,7 +138,6 @@ var _ = framework.Describe("[group:kubevirt]", func() {
framework.ExpectHaveKeyWithValue(pod.Annotations, util.VMAnnotation, vmName)

ginkgo.By("Checking whether pod ips are changed")
ipNewAddr := pod.Annotations[util.IPAddressAnnotation]
framework.ExpectEqual(ipAddr, ipNewAddr)
framework.ExpectConsistOf(ips, pod.Status.PodIPs)
})
})

0 comments on commit e7e9cea

Please sign in to comment.