Change:
The test uses port 80, which is often in use on clusters (in our case, masters have an ingress controller listening on 80). The test should use something in the high range that is unlikely to conflict or use a smarter algorithm for finding a port to validate. fails in openshift
I am looking into it.
I looked into the test and it seems that another option would be for the test to not use 127.0.0.1 to avoid such conflict with infra (or any other important) pods on 127.0.0.1. As the test is using 127.0.0.1 and 127.0.0.2, I think we could just use 127.0.0.2 and 127.0.0.3 instead.
so it seems there are following options we can use: 127.0.0.2 and 127.0.0.3 instead of 127.0.0.1 and 127.0.0.2. pick some high random port number. something like following to pick unused port: and then extract random port from it.
with option 1 as it seems safer than 2 to me. Let me know if there is any concern, or if we would want to go with 2 or 3 option or something else.

Discussion:
framework.ExpectNodeHasLabel(cs, nodeName, k, v) defer framework.RemoveLabelOffNode(cs, nodeName, k) <del> By("Trying to create a pod(pod1) with hostport 80 and hostIP 127.0.0.1 and expect scheduled") creatHostPortPodOnNode(f, "pod1", ns, "127.0.0.1", v1.ProtocolTCP, nodeSelector, true) </del> <ins> port := int32(54321) By(fmt.Sprintf("Trying to create a pod(pod1) with hostport %v and hostIP 127.0.0.1 and expect scheduled", port)) creatHostPortPodOnNode(f, "pod1", ns, "127.0.0.1", port, v1.ProtocolTCP, nodeSelector, true) </ins> <del> By("Trying to create another pod(pod2) with hostport 80 but hostIP 127.0.0.2 on the node which pod1 resides and expect scheduled") creatHostPortPodOnNode(f, "pod2", ns, "127.0.0.2", v1.ProtocolTCP, nodeSelector, true) </del> <ins> By(fmt.Sprintf("Trying to create another pod(pod2) with hostport %v but hostIP 127.0.0.2 on the node which pod1 resides and expect scheduled", port)) creatHostPortPodOnNode(f, "pod2", ns, "127.0.0.2", port, v1.ProtocolTCP, nodeSelector, true) </ins> <del> By("Trying to create a third pod(pod3) with hostport 80, hostIP 127.0.0.2 but use UDP protocol on the node which pod2 resides") creatHostPortPodOnNode(f, "pod3", ns, "127.0.0.2", v1.ProtocolUDP, nodeSelector, true) </del> <ins> By(fmt.Sprintf("Trying to create a third pod(pod3) with hostport %v, hostIP 127.0.0.2 but use UDP protocol on the node which pod2 resides", port)) creatHostPortPodOnNode(f, "pod3", ns, "127.0.0.2", port, v1.ProtocolUDP, nodeSelector, true) </ins> }) It("validates that there exists conflict between pods with same hostPort and protocol but one using 0.0.0.0 hostIP", func() {

framework.ExpectNodeHasLabel(cs, nodeName, k, v) defer framework.RemoveLabelOffNode(cs, nodeName, k) <del> By("Trying to create a pod(pod4) with hostport 80 and hostIP 0.0.0.0(empty string here) and expect scheduled") creatHostPortPodOnNode(f, "pod4", ns, "", v1.ProtocolTCP, nodeSelector, true) </del> <ins> port := int32(54322) By(fmt.Sprintf("Trying to create a pod(pod4) with hostport %v and hostIP 0.0.0.0(empty string here) and expect scheduled", port)) creatHostPortPodOnNode(f, "pod4", ns, "", port, v1.ProtocolTCP, nodeSelector, true) </ins> <del> By("Trying to create another pod(pod5) with hostport 80 but hostIP 127.0.0.1 on the node which pod4 resides and expect not scheduled") creatHostPortPodOnNode(f, "pod5", ns, "127.0.0.1", v1.ProtocolTCP, nodeSelector, false) </del> <ins> By(fmt.Sprintf("Trying to create another pod(pod5) with hostport %v but hostIP 127.0.0.1 on the node which pod4 resides and expect not scheduled", port)) creatHostPortPodOnNode(f, "pod5", ns, "127.0.0.1", port, v1.ProtocolTCP, nodeSelector, false) </ins> }) })

} // create pod which using hostport on the specified node according to the nodeSelector <del> func creatHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string, protocol v1.Protocol, nodeSelector map[string]string, expectScheduled bool) { </del> <ins> func creatHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string, port int32, protocol v1.Protocol, nodeSelector map[string]string, expectScheduled bool) { </ins> createPausePod(f, pausePodConfig{ Name: podName, Ports: []v1.ContainerPort{ { <del> HostPort:      80, </del> <ins> HostPort:      port, </ins> ContainerPort: 80, Protocol:      protocol, HostIP:        hostIP,