Merge pull request #12706 from smarterclayton/test_fails_on_no_ipv6

Unit test fails when ipv6 is not available
This commit is contained in:
Brendan Burns
2015-08-14 20:26:40 -07:00

View File

@@ -24,6 +24,7 @@ import (
"net"
"net/http"
"reflect"
"strings"
"sync"
"testing"
"time"
@@ -258,6 +259,10 @@ func TestGetListener(t *testing.T) {
for i, testCase := range testCases {
expectedListenerPort := "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
if testCase.ShouldRaiseError != errorRaised {