Skip to content

Commit

Permalink
SKIP TestUPNP_DDWRT test if device is (IGDv2-IP1) non dd-wrt
Browse files Browse the repository at this point in the history
  • Loading branch information
iquidus committed Oct 22, 2020
1 parent 0d28b80 commit 00e9a56
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions p2p/nat/natupnp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00e9a56

Please sign in to comment.