e2e tests need a ping6 test for IPv6-only clusters
e2e tests provide only an (IPv4) ping test for external connectivity. We need a way to conditionally run a ping6 external connectivity check, and disable the (IPv4) ping-based external connectivity check, for end-to-end testing on IPv6-only clusters. This feature will be needed for creating gating IPv6 CI tests. fixes #53383
This commit is contained in:
@@ -4503,15 +4503,22 @@ func LaunchWebserverPod(f *Framework, podName, nodeName string) (ip string) {
|
||||
return
|
||||
}
|
||||
|
||||
type PingCommand string
|
||||
|
||||
const (
|
||||
IPv4PingCommand PingCommand = "ping"
|
||||
IPv6PingCommand PingCommand = "ping6"
|
||||
)
|
||||
|
||||
// CheckConnectivityToHost launches a pod to test connectivity to the specified
|
||||
// host. An error will be returned if the host is not reachable from the pod.
|
||||
//
|
||||
// An empty nodeName will use the schedule to choose where the pod is executed.
|
||||
func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeout int) error {
|
||||
func CheckConnectivityToHost(f *Framework, nodeName, podName, host string, pingCmd PingCommand, timeout int) error {
|
||||
contName := fmt.Sprintf("%s-container", podName)
|
||||
|
||||
command := []string{
|
||||
"ping",
|
||||
string(pingCmd),
|
||||
"-c", "3", // send 3 pings
|
||||
"-W", "2", // wait at most 2 seconds for a reply
|
||||
"-w", strconv.Itoa(timeout),
|
||||
|
||||
Reference in New Issue
Block a user