File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121 "sync/atomic"
2222 "testing"
2323 "time"
24+ "os"
2425
2526 libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
2627
@@ -116,6 +117,19 @@ func selfSignedTLSConfig(t *testing.T) *tls.Config {
116117 return tlsConfig
117118}
118119
120+ func isWebRTCIPv6Supported () bool {
121+ if os .Getenv ("CI" ) != "" || os .Getenv ("GITHUB_ACTIONS" ) != "" {
122+ return false
123+ }
124+
125+ conn , err := net .Dial ("tcp6" , "[::1]:0" )
126+ if err != nil {
127+ return false
128+ }
129+ conn .Close ()
130+ return true
131+ }
132+
119133var transportsToTest = []TransportTestCase {
120134 {
121135 Name : "TCP / Noise / Yamux" ,
@@ -577,6 +591,9 @@ var transportsToTest = []TransportTestCase{
577591 {
578592 Name : "WebRTC (IPv6)" ,
579593 HostGenerator : func (t * testing.T , opts TransportTestCaseOpts ) host.Host {
594+ if ! isWebRTCIPv6Supported () {
595+ t .Skip ("WebRTC IPv6 not supported in this environment" )
596+ }
580597 libp2pOpts := transformOpts (opts )
581598 libp2pOpts = append (libp2pOpts , libp2p .Transport (libp2pwebrtc .New ))
582599 if opts .NoListen {
You can’t perform that action at this time.
0 commit comments