mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 19:28:16 +00:00
Improve checks for test/e2e/network and test/e2e/network/netpol (#106655)
This commit is contained in:
@@ -64,7 +64,9 @@ var _ = common.SIGDescribe("[Feature:IPv6DualStack]", func() {
|
||||
|
||||
framework.ExpectEqual(len(internalIPs), 2)
|
||||
// assert 2 ips belong to different families
|
||||
framework.ExpectEqual(netutils.IsIPv4String(internalIPs[0]) != netutils.IsIPv4String(internalIPs[1]), true)
|
||||
if netutils.IsIPv4String(internalIPs[0]) == netutils.IsIPv4String(internalIPs[1]) {
|
||||
framework.Failf("both internalIPs %s and %s belong to the same families", internalIPs[0], internalIPs[1])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -97,7 +99,9 @@ var _ = common.SIGDescribe("[Feature:IPv6DualStack]", func() {
|
||||
// validate first ip in PodIPs is same as PodIP
|
||||
framework.ExpectEqual(p.Status.PodIP, p.Status.PodIPs[0].IP)
|
||||
// assert 2 pod ips belong to different families
|
||||
framework.ExpectEqual(netutils.IsIPv4String(p.Status.PodIPs[0].IP) != netutils.IsIPv4String(p.Status.PodIPs[1].IP), true)
|
||||
if netutils.IsIPv4String(p.Status.PodIPs[0].IP) == netutils.IsIPv4String(p.Status.PodIPs[1].IP) {
|
||||
framework.Failf("both internalIPs %s and %s belong to the same families", p.Status.PodIPs[0].IP, p.Status.PodIPs[1].IP)
|
||||
}
|
||||
|
||||
ginkgo.By("deleting the pod")
|
||||
err := podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(30))
|
||||
|
||||
Reference in New Issue
Block a user