mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 22:33:34 +00:00
Merge pull request #12706 from smarterclayton/test_fails_on_no_ipv6
Unit test fails when ipv6 is not available
This commit is contained in:
commit
c5cfc1b83c
@ -24,6 +24,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -258,6 +259,10 @@ func TestGetListener(t *testing.T) {
|
|||||||
for i, testCase := range testCases {
|
for i, testCase := range testCases {
|
||||||
expectedListenerPort := "12345"
|
expectedListenerPort := "12345"
|
||||||
listener, err := pf.getListener(testCase.Protocol, testCase.Hostname, &ForwardedPort{12345, 12345})
|
listener, err := pf.getListener(testCase.Protocol, testCase.Hostname, &ForwardedPort{12345, 12345})
|
||||||
|
if err != nil && strings.Contains(err.Error(), "cannot assign requested address") {
|
||||||
|
t.Logf("Can't test #%d: %v", i, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
errorRaised := err != nil
|
errorRaised := err != nil
|
||||||
|
|
||||||
if testCase.ShouldRaiseError != errorRaised {
|
if testCase.ShouldRaiseError != errorRaised {
|
||||||
|
Loading…
Reference in New Issue
Block a user