device_test.go 372 B

1234567891011121314151617
  1. package upnp
  2. import (
  3. "testing"
  4. ip_helper2 "github.com/IceWhaleTech/CasaOS/pkg/utils/ip_helper"
  5. )
  6. func TestGetCtrlUrl(t *testing.T) {
  7. upnp, err := Gateway()
  8. if err == nil {
  9. upnp.CtrlUrl = GetCtrlUrl(upnp.GatewayHost, upnp.DeviceDescUrl)
  10. upnp.LocalHost = ip_helper2.GetLoclIp()
  11. upnp.AddPortMapping(8090, 8090, "TCP")
  12. //upnp.DelPortMapping(9999, "TCP")
  13. }
  14. }