mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Fix golint in test/e2e/windows/hybrid_network.go
This commit is contained in:
parent
1187936c18
commit
a60365e67b
@ -25,8 +25,8 @@ import (
|
|||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
"github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
"github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -42,27 +42,27 @@ var (
|
|||||||
var _ = SIGDescribe("Hybrid cluster network", func() {
|
var _ = SIGDescribe("Hybrid cluster network", func() {
|
||||||
f := framework.NewDefaultFramework("hybrid-network")
|
f := framework.NewDefaultFramework("hybrid-network")
|
||||||
|
|
||||||
BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
framework.SkipUnlessNodeOSDistroIs("windows")
|
framework.SkipUnlessNodeOSDistroIs("windows")
|
||||||
})
|
})
|
||||||
|
|
||||||
Context("for all supported CNIs", func() {
|
ginkgo.Context("for all supported CNIs", func() {
|
||||||
|
|
||||||
It("should have stable networking for Linux and Windows pods", func() {
|
ginkgo.It("should have stable networking for Linux and Windows pods", func() {
|
||||||
By("creating linux and windows pods")
|
ginkgo.By("creating linux and windows pods")
|
||||||
linuxPod := createTestPod(f, linuxBusyBoxImage, linuxOS)
|
linuxPod := createTestPod(f, linuxBusyBoxImage, linuxOS)
|
||||||
windowsPod := createTestPod(f, windowsBusyBoximage, windowsOS)
|
windowsPod := createTestPod(f, windowsBusyBoximage, windowsOS)
|
||||||
|
|
||||||
By("checking connectivity to 8.8.8.8 53 (google.com) from Linux")
|
ginkgo.By("checking connectivity to 8.8.8.8 53 (google.com) from Linux")
|
||||||
assertConsistentConnectivity(f, linuxPod.ObjectMeta.Name, linuxOS, linuxCheck("8.8.8.8", 53))
|
assertConsistentConnectivity(f, linuxPod.ObjectMeta.Name, linuxOS, linuxCheck("8.8.8.8", 53))
|
||||||
|
|
||||||
By("checking connectivity to www.google.com from Windows")
|
ginkgo.By("checking connectivity to www.google.com from Windows")
|
||||||
assertConsistentConnectivity(f, windowsPod.ObjectMeta.Name, windowsOS, windowsCheck("www.google.com"))
|
assertConsistentConnectivity(f, windowsPod.ObjectMeta.Name, windowsOS, windowsCheck("www.google.com"))
|
||||||
|
|
||||||
By("checking connectivity from Linux to Windows")
|
ginkgo.By("checking connectivity from Linux to Windows")
|
||||||
assertConsistentConnectivity(f, linuxPod.ObjectMeta.Name, linuxOS, linuxCheck(windowsPod.Status.PodIP, 80))
|
assertConsistentConnectivity(f, linuxPod.ObjectMeta.Name, linuxOS, linuxCheck(windowsPod.Status.PodIP, 80))
|
||||||
|
|
||||||
By("checking connectivity from Windows to Linux")
|
ginkgo.By("checking connectivity from Windows to Linux")
|
||||||
assertConsistentConnectivity(f, windowsPod.ObjectMeta.Name, windowsOS, windowsCheck(linuxPod.Status.PodIP))
|
assertConsistentConnectivity(f, windowsPod.ObjectMeta.Name, windowsOS, windowsCheck(linuxPod.Status.PodIP))
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -77,11 +77,11 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func assertConsistentConnectivity(f *framework.Framework, podName string, os string, cmd []string) {
|
func assertConsistentConnectivity(f *framework.Framework, podName string, os string, cmd []string) {
|
||||||
Consistently(func() error {
|
gomega.Consistently(func() error {
|
||||||
By(fmt.Sprintf("checking connectivity of %s-container in %s", os, podName))
|
ginkgo.By(fmt.Sprintf("checking connectivity of %s-container in %s", os, podName))
|
||||||
_, _, err := f.ExecCommandInContainerWithFullOutput(podName, os+"-container", cmd...)
|
_, _, err := f.ExecCommandInContainerWithFullOutput(podName, os+"-container", cmd...)
|
||||||
return err
|
return err
|
||||||
}, duration, pollInterval).ShouldNot(HaveOccurred())
|
}, duration, pollInterval).ShouldNot(gomega.HaveOccurred())
|
||||||
}
|
}
|
||||||
|
|
||||||
func linuxCheck(address string, port int) []string {
|
func linuxCheck(address string, port int) []string {
|
||||||
|
Loading…
Reference in New Issue
Block a user