diff --git a/p2p/nat/natupnp_test.go b/p2p/nat/natupnp_test.go index 79f6d25ae8..836243e0ee 100644 --- a/p2p/nat/natupnp_test.go +++ b/p2p/nat/natupnp_test.go @@ -164,14 +164,18 @@ func TestUPNP_DDWRT(t *testing.T) { if discovered == nil { t.Fatalf("not discovered") } + upnp, _ := discovered.(*upnp) - if upnp.service != "IGDv1-IP1" { + if upnp.service == "IGDv1-IP1" { + wantURL := "http://" + dev.listener.Addr().String() + "/InternetGatewayDevice.xml" + if upnp.dev.URLBaseStr != wantURL { + t.Errorf("upnp.dev.URLBaseStr mismatch: got %q, want %q", upnp.dev.URLBaseStr, wantURL) + } + } else if upnp.service == "IGDv2-IP1" { + t.Skipf("disabled: non dd-wrt IGDv2-IP1 detected") + } else { t.Errorf("upnp.service mismatch: got %q, want %q", upnp.service, "IGDv1-IP1") } - wantURL := "http://" + dev.listener.Addr().String() + "/InternetGatewayDevice.xml" - if upnp.dev.URLBaseStr != wantURL { - t.Errorf("upnp.dev.URLBaseStr mismatch: got %q, want %q", upnp.dev.URLBaseStr, wantURL) - } } // fakeIGD presents itself as a discoverable UPnP device which sends