diff --git a/README.md b/README.md index 59bbbcc..be7b3d4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![codecov](https://codecov.io/gh/lbryio/txupnp/branch/master/graph/badge.svg)](https://codecov.io/gh/lbryio/txupnp) +[![codecov](https://codecov.io/gh/lbryio/aioupnp/branch/master/graph/badge.svg)](https://codecov.io/gh/lbryio/aioupnp) # UPnP for asyncio @@ -32,4 +32,3 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE). ## Contact The primary contact for this project is [@jackrobison](mailto:jack@lbry.io) - diff --git a/aioupnp/serialization/test_scpd.py b/aioupnp/serialization/test_scpd.py new file mode 100644 index 0000000..2ce4288 --- /dev/null +++ b/aioupnp/serialization/test_scpd.py @@ -0,0 +1,11 @@ +import unittest +from aioupnp.serialization.scpd import serialize_scpd_get + + +class TestSCPDSerialization(unittest.TestCase): + path, lan_address = '/InternetGatewayDevice.xml', '10.0.0.1' + expected_result = b'GET /InternetGatewayDevice.xml HTTP/1.1\r\n' \ + b'Accept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n' + + def test_serialize_get(self): + self.assertEqual(serialize_scpd_get(self.path, self.lan_address), self.expected_result) diff --git a/aioupnp/serialization/test_soap.py b/aioupnp/serialization/test_soap.py new file mode 100644 index 0000000..cc73ba1 --- /dev/null +++ b/aioupnp/serialization/test_soap.py @@ -0,0 +1,22 @@ +import unittest +from aioupnp.serialization.soap import serialize_soap_post + + +class TestSOAPSerialization(unittest.TestCase): + method, param_names, gateway_address, kwargs = "GetExternalIPAddress", [], b'10.0.0.1', {} + st, lan_address, path = b'urn:schemas-upnp-org:service:WANIPConnection:1', '10.0.0.1', b'/soap.cgi?service=WANIPConn1' + expected_result = b'POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\n' \ + b'Host: 10.0.0.1\r\nUser-Agent: python3/aioupnp, UPnP/1.0, MiniUPnPc/1.9\r\n' \ + b'Content-Length: 285\r\nContent-Type: text/xml\r\n' \ + b'SOAPAction: "urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress"\r\n' \ + b'Connection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n' \ + b'\r\n' \ + b'' \ + b'\r\n' + + + def test_serialize_get(self): + self.assertEqual(serialize_soap_post( + self.method, self.param_names, self.st, self.gateway_address, self.path, **self.kwargs + ), self.expected_result) diff --git a/tests/test_ssdp_datagram.py b/aioupnp/serialization/test_ssdp.py similarity index 94% rename from tests/test_ssdp_datagram.py rename to aioupnp/serialization/test_ssdp.py index 65bd68b..6000826 100644 --- a/tests/test_ssdp_datagram.py +++ b/aioupnp/serialization/test_ssdp.py @@ -67,6 +67,14 @@ class TestParseMSearchResponseCaseInsensitive(TestParseMSearchResponse): 'USN: uuid:00000000-0000-0000-0000-000000000000::urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1' ]).encode() + def test_get_case_insensitive(self): + packet = SSDPDatagram.decode(self.datagram) + self.assertEqual('max-age=1800', packet['Cache_Control']) + + def test_key_error(self): + packet = SSDPDatagram.decode(self.datagram) + self.assertRaises(KeyError, lambda : packet['Cache Control']) + class TestFailToParseMSearchResponseNoST(unittest.TestCase): datagram = "\r\n".join([ diff --git a/setup.py b/setup.py index 3c4ab90..aa2114d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ setup( long_description=long_description, url="https://github.com/lbryio/aioupnp", license=__license__, - packages=find_packages(exclude=['tests']), + packages=find_packages(), entry_points={'console_scripts': console_scripts}, install_requires=[ 'netifaces', diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index bd461ed..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -import logging - -log = logging.getLogger("aioupnp") -handler = logging.StreamHandler() -handler.setFormatter(logging.Formatter('%(asctime)-15s-%(filename)s:%(lineno)s->%(message)s')) -log.addHandler(handler) -log.setLevel(logging.INFO) diff --git a/tests/devices/Cisco CGA4131COM b/tests/devices/Cisco CGA4131COM deleted file mode 100644 index 9617b82..0000000 --- a/tests/devices/Cisco CGA4131COM +++ /dev/null @@ -1,244 +0,0 @@ -{ - "router_address": "10.1.10.1", - "client_address": "10.1.10.206", - "port": 49152, - "gateway_dict": { - "server": "Linux/3.14.28-Prod_17.2, UPnP/1.0, Portable SDK for UPnP devices/1.6.22", - "urlBase": "http://10.1.10.1:49152", - "location": "http://10.1.10.1:49152/IGDdevicedesc_brlan0.xml", - "specVersion": { - "major": "1", - "minor": "0" - }, - "usn": "uuid:ebf5a0a0-1dd1-11b2-a90f-603d266f9915::urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "urn": "urn:schemas-upnp-org:device:InternetGatewayDevice:1" - }, - "expected_devices": [ - { - "cache_control": "max-age=1800", - "location": "http://10.1.10.1:49152/IGDdevicedesc_brlan0.xml", - "server": "Linux/3.14.28-Prod_17.2, UPnP/1.0, Portable SDK for UPnP devices/1.6.22", - "st": "urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "usn": "uuid:ebf5a0a0-1dd1-11b2-a90f-603d266f9915::urn:schemas-upnp-org:device:InternetGatewayDevice:1" - } - ], - "commands": { - "available": { - "SetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "GetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "GetCommonLinkProperties": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "SetConnectionType": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetConnectionTypeInfo": "urn:schemas-upnp-org:service:WANIPConnection:1", - "RequestConnection": "urn:schemas-upnp-org:service:WANIPConnection:1", - "ForceTermination": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetStatusInfo": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetNATRSIPStatus": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetGenericPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetSpecificPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:1", - "AddPortMapping": "urn:schemas-upnp-org:service:WANIPConnection:1", - "DeletePortMapping": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetExternalIPAddress": "urn:schemas-upnp-org:service:WANIPConnection:1" - }, - "failed": { - "urn:schemas-upnp-org:service:WANIPConnection:1": [ - "RequestTermination" - ] - } - }, - "ssdp": { - "lan_address": "10.1.10.206", - "router_address": "10.1.10.1", - "sent": [ - "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nMAN: \"ssdp:discover\"\r\nMX: 1\r\n\r\n" - ], - "received": [ - [ - [ - "10.1.10.1", - 48344 - ], - "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=1800\r\nDATE: Thu, 04 Oct 2018 22:59:40 GMT\r\nEXT:\r\nLOCATION: http://10.1.10.1:49152/IGDdevicedesc_brlan0.xml\r\nOPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n01-NLS: 51849aee-c34d-11e8-9b33-d597ca3721d9\r\nSERVER: Linux/3.14.28-Prod_17.2, UPnP/1.0, Portable SDK for UPnP devices/1.6.22\r\nX-User-Agent: redsonic\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nUSN: uuid:ebf5a0a0-1dd1-11b2-a90f-603d266f9915::urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n\r\n" - ] - ] - }, - "scpd": { - "GET": { - "IGDdevicedesc_brlan0.xml": { - "request": "GET /IGDdevicedesc_brlan0.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.1.10.1\r\n\r\n", - "response": "\n\n\n1\n0\n\n\nurn:schemas-upnp-org:device:InternetGatewayDevice:1\nCGA4131COM\nCisco\nhttp://www.cisco.com/\nCGA4131COM\nCGA4131COM\nCGA4131COM\nhttp://www.cisco.com\n\nuuid:ebf5a0a0-1dd1-11b2-a90f-603d266f9915\nCGA4131COM\n\n\nurn:schemas-upnp-org:service:Layer3Forwarding:1\nurn:upnp-org:serviceId:L3Forwarding1\n/Layer3ForwardingSCPD.xml\n/upnp/control/Layer3Forwarding\n/upnp/event/Layer3Forwarding\n\n\n\n\nurn:schemas-upnp-org:device:WANDevice:1\nWANDevice:1\nCisco\nhttp://www.cisco.com/\nCGA4131COM\nCGA4131COM\nCGA4131COM\nhttp://www.cisco.com\n\nuuid:ebf5a0a0-1dd1-11b2-a92f-603d266f9915\nCGA4131COM\n\n\nurn:schemas-upnp-org:service:WANCommonInterfaceConfig:1\nurn:upnp-org:serviceId:WANCommonIFC1\n/WANCommonInterfaceConfigSCPD.xml\n/upnp/control/WANCommonInterfaceConfig0\n/upnp/event/WANCommonInterfaceConfig0\n\n\n\n \n urn:schemas-upnp-org:device:WANConnectionDevice:1\n WANConnectionDevice:1\n Cisco\n http://www.cisco.com/\n CGA4131COM\n CGA4131COM\n CGA4131COM\n http://www.cisco.com\n \n uuid:ebf5a0a0-1dd1-11b2-a93f-603d266f9915\n CGA4131COM\n \n \n urn:schemas-upnp-org:service:WANIPConnection:1\n urn:upnp-org:serviceId:WANIPConn1\n /WANIPConnectionServiceSCPD.xml\n /upnp/control/WANIPConnection0\n /upnp/event/WANIPConnection0\n \n \n \n\n\n\nhttp://10.1.10.1/\n" - }, - "Layer3ForwardingSCPD.xml": { - "request": "GET /Layer3ForwardingSCPD.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.1.10.1\r\n\r\n", - "response": "\n\n\n\n\n\t\n\t\t1\n\t\t0\n\t\n\t\n\t\t\n\t\tSetDefaultConnectionService\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewDefaultConnectionService\n\t\t\t\t\tin\n\t\t\t\t\tDefaultConnectionService\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\tGetDefaultConnectionService\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewDefaultConnectionService\n\t\t\t\t\tout\n\t\t\t\t\tDefaultConnectionService\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\tDefaultConnectionService\n\t\t\tstring\n\t\t\n\t\n" - }, - "WANCommonInterfaceConfigSCPD.xml": { - "request": "GET /WANCommonInterfaceConfigSCPD.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.1.10.1\r\n\r\n", - "response": "\n\n\n\n\n\t\n\t\t1\n\t\t0\n\t\n\t\n\t\t\n\t\tGetCommonLinkProperties\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewWANAccessType\n\t\t\t\t\tout\n\t\t\t\t\tWANAccessType\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewLayer1UpstreamMaxBitRate\n\t\t\t\t\tout\n\t\t\t\t\tLayer1UpstreamMaxBitRate\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewLayer1DownstreamMaxBitRate\n\t\t\t\t\tout\n\t\t\t\t\tLayer1DownstreamMaxBitRate\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewPhysicalLinkStatus\n\t\t\t\t\tout\n\t\t\t\t\tPhysicalLinkStatus\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t \n\t\tGetTotalBytesSent \n\t\t\t \n\t\t\t\t \n\t\t\t\t\tNewTotalBytesSent \n\t\t\t\t\tout \n\t\t\t\t\tTotalBytesSent \n\t\t\t\t \n\t\t\t \n\t\t \n\t\t \n\t\tGetTotalBytesReceived \n\t\t\t \n\t\t\t\t \n\t\t\t\t\tNewTotalBytesReceived \n\t\t\t\t\tout \n\t\t\t\t\tTotalBytesReceived \n\t\t\t\t \n\t\t\t \n\t\t \n\t\t \n\t\tGetTotalPacketsSent \n\t\t\t \n\t\t\t\t \n\t\t\t\t\tNewTotalPacketsSent \n\t\t\t\t\tout \n\t\t\t\t\tTotalPacketsSent \n\t\t\t\t \n\t\t\t \n\t\t \n\t\t \n\t\tGetTotalPacketsReceived \n\t\t\t \n\t\t\t\t \n\t\t\t\t\tNewTotalPacketsReceived \n\t\t\t\t\tout \n\t\t\t\t\tTotalPacketsReceived \n\t\t\t\t \n\t\t\t \n\t\t \n\t\n\t\n\t\t\n\t\tWANAccessType\n\t\tstring\n\t\t\t\n\t\t\t\tDSL\n\t\t\t\tPOTS\n\t\t\t\tCable\n\t\t\t\tEthernet\n\t\t\t\n\t\t\n\t\t\n\t\t\tLayer1UpstreamMaxBitRate\n\t\t\tui4\n\t\t\n\t\t\n\t\t\tLayer1DownstreamMaxBitRate\n\t\t\tui4\n\t\t\n\t\t\n\t\t\tPhysicalLinkStatus\n\t\t\tstring\n\t\t\t\t\n\t\t\t\t\tUp\n\t\t\t\t\tDown\n\t\t\t\t\tInitializing\n\t\t\t\t\tUnavailable\n\t\t\t\t\n\t\t\n\t\t \n\t\t\tTotalBytesSent \n\t\t\tui4 \n\t\t \n\t\t \n\t\t\tTotalBytesReceived \n\t\t\tui4 \n\t\t \n\t\t \n\t\t\tTotalPacketsSent \n\t\t\tui4 \n\t\t \n\t\t \n\t\t\tTotalPacketsReceived \n\t\t\tui4 \n\t\t \n\t\n" - }, - "WANIPConnectionServiceSCPD.xml": { - "request": "GET /WANIPConnectionServiceSCPD.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.1.10.1\r\n\r\n", - "response": "\n\n\n\n\n\n1\n0\n\n\n\nSetConnectionType\n\n\nNewConnectionType\nin\nConnectionType\n\n\n\n\nGetConnectionTypeInfo\n\n\nNewConnectionType\nout\nConnectionType\n\n\nNewPossibleConnectionTypes\nout\nPossibleConnectionTypes\n\n\n\n\nRequestConnection\n\n\nRequestTermination\n\n\nForceTermination\n\n\nGetStatusInfo\n\n\nNewConnectionStatus\nout\nConnectionStatus\n\n\nNewLastConnectionError\nout\nLastConnectionError\n\n\nNewUptime\nout\nUptime\n\n\n\n\nGetNATRSIPStatus\n\n\nNewRSIPAvailable\nout\nRSIPAvailable\n\n\nNewNATEnabled\nout\nNATEnabled\n\n\n\n\nGetGenericPortMappingEntry\n\n\nNewPortMappingIndex\nin\nPortMappingNumberOfEntries\n\n\nNewRemoteHost\nout\nRemoteHost\n\n\nNewExternalPort\nout\nExternalPort\n\n\nNewProtocol\nout\nPortMappingProtocol\n\n\nNewInternalPort\nout\nInternalPort\n\n\nNewInternalClient\nout\nInternalClient\n\n\nNewEnabled\nout\nPortMappingEnabled\n\n\nNewPortMappingDescription\nout\nPortMappingDescription\n\n\nNewLeaseDuration\nout\nPortMappingLeaseDuration\n\n\n\n\nGetSpecificPortMappingEntry\n\n\nNewRemoteHost\nin\nRemoteHost\n\n\nNewExternalPort\nin\nExternalPort\n\n\nNewProtocol\nin\nPortMappingProtocol\n\n\nNewInternalPort\nout\nInternalPort\n\n\nNewInternalClient\nout\nInternalClient\n\n\nNewEnabled\nout\nPortMappingEnabled\n\n\nNewPortMappingDescription\nout\nPortMappingDescription\n\n\nNewLeaseDuration\nout\nPortMappingLeaseDuration\n\n\n\n\nAddPortMapping\n\n\nNewRemoteHost\nin\nRemoteHost\n\n\nNewExternalPort\nin\nExternalPort\n\n\nNewProtocol\nin\nPortMappingProtocol\n\n\nNewInternalPort\nin\nInternalPort\n\n\nNewInternalClient\nin\nInternalClient\n\n\nNewEnabled\nin\nPortMappingEnabled\n\n\nNewPortMappingDescription\nin\nPortMappingDescription\n\n\nNewLeaseDuration\nin\nPortMappingLeaseDuration\n\n\n\n\nDeletePortMapping\n\n\nNewRemoteHost\nin\nRemoteHost\n\n\nNewExternalPort\nin\nExternalPort\n\n\nNewProtocol\nin\nPortMappingProtocol\n\n\n\n\nGetExternalIPAddress\n\n\nNewExternalIPAddress\nout\nExternalIPAddress\n\n\n\n\n\n\nConnectionType\nstring\n\nUnconfigured\nIP_Routed\nIP_Bridged\n\nIP_Routed\n\n\nPossibleConnectionTypes\nstring\n\n\nConnectionStatus\nstring\n\nUnconfigured\nConnecting\nConnected\nPendingDisconnect\nDisconnecting\nDisconnected\n\n\n\nUptime\nui4\n\n\nLastConnectionError\nstring\n\nERROR_NONE\n\n\n\nRSIPAvailable\nboolean\n\n\nNATEnabled\nboolean\n\n\nExternalIPAddress\nstring\n\n\nPortMappingNumberOfEntries\nui2\n\n\nPortMappingEnabled\nboolean\n\n\nPortMappingLeaseDuration\nui4\n\n0\n604800\n\n3600\n\n\nRemoteHost\nstring\n\n\nExternalPort\nui2\n\n\nInternalPort\nui2\n\n1\n65535\n\n\n\nPortMappingProtocol\nstring\n\nTCP\nUDP\n\n\n\nInternalClient\nstring\n\n\nPortMappingDescription\nstring\n\n\n" - } - }, - "POST": { - "http://10.1.10.1:49152/upnp/control/WANIPConnection0": [ - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 285\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n\r\n", - "response": "\r\n\n\r\n1.2.3.4\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\r\n\n\r\n\r\n59596\r\nTCP\r\n59596\r\n10.1.10.71\r\n1\r\nuTorrent (TCP)\r\n10800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n1\r\n", - "response": "\r\n\n\r\n\r\n59596\r\nUDP\r\n59596\r\n10.1.10.71\r\n1\r\nuTorrent (UDP)\r\n10800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n2\r\n", - "response": "\r\n\n\r\n\r\n48748\r\nUDP\r\n48748\r\n10.1.10.187\r\n1\r\nWhatsApp (1538672386) ()\r\n64800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n3\r\n", - "response": "\r\n\n\r\n\r\n3333\r\nTCP\r\n3333\r\n10.1.10.94\r\n1\r\nLBRY peer port\r\n79200\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4\r\n", - "response": "\r\n\n\r\n\r\n4444\r\nUDP\r\n4444\r\n10.1.10.94\r\n1\r\nLBRY DHT port\r\n79200\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n5\r\n", - "response": "\r\n\n\n\ns:Client\nUPnPError\n\n\n713\nSpecifiedArrayIndexInvalid\n\n\n\n\n" - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\r\n\n\r\n\r\n59596\r\nTCP\r\n59596\r\n10.1.10.71\r\n1\r\nuTorrent (TCP)\r\n10800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n1\r\n", - "response": "\r\n\n\r\n\r\n59596\r\nUDP\r\n59596\r\n10.1.10.71\r\n1\r\nuTorrent (UDP)\r\n10800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n2\r\n", - "response": "\r\n\n\r\n\r\n48748\r\nUDP\r\n48748\r\n10.1.10.187\r\n1\r\nWhatsApp (1538672386) ()\r\n64800\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n3\r\n", - "response": "\r\n\n\r\n\r\n3333\r\nTCP\r\n3333\r\n10.1.10.94\r\n1\r\nLBRY peer port\r\n79200\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4\r\n", - "response": "\r\n\n\r\n\r\n4444\r\nUDP\r\n4444\r\n10.1.10.94\r\n1\r\nLBRY DHT port\r\n79200\r\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n5\r\n", - "response": "\r\n\n\n\ns:Client\nUPnPError\n\n\n713\nSpecifiedArrayIndexInvalid\n\n\n\n\n" - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 599\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP456710.1.10.2061txupnp test mapping\r\n", - "response": "\r\n\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 379\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP\r\n", - "response": "\r\n\n\r\n " - }, - { - "request": "POST /upnp/control/WANIPConnection0 HTTP/1.1\r\nHost: 10.1.10.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 403\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetSpecificPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\nNone4567UDP\r\n", - "response": "\r\n\n\n\ns:Client\nUPnPError\n\n\n402\nPAL_UPNP_SOAP_E_INVALID_ARGS\n\n\n\n\n" - } - ] - } - }, - "soap": [ - [ - "get_external_ip", - [], - "1.2.3.4" - ], - [ - "get_redirects", - [], - [ - [ - null, - 59596, - "TCP", - 59596, - "10.1.10.71", - true, - "uTorrent (TCP)", - 10800 - ], - [ - null, - 59596, - "UDP", - 59596, - "10.1.10.71", - true, - "uTorrent (UDP)", - 10800 - ], - [ - null, - 48748, - "UDP", - 48748, - "10.1.10.187", - true, - "WhatsApp (1538672386) ()", - 64800 - ], - [ - null, - 3333, - "TCP", - 3333, - "10.1.10.94", - true, - "LBRY peer port", - 79200 - ], - [ - null, - 4444, - "UDP", - 4444, - "10.1.10.94", - true, - "LBRY DHT port", - 79200 - ] - ] - ], - [ - "get_next_mapping", - [ - 4567, - "UDP", - "txupnp test mapping" - ], - 4567 - ], - [ - "delete_port_mapping", - [ - 4567, - "UDP" - ], - [] - ], - [ - "get_specific_port_mapping", - [ - 4567, - "UDP" - ], - null - ] - ] -} \ No newline at end of file diff --git a/tests/devices/D-Link DIR-890L b/tests/devices/D-Link DIR-890L deleted file mode 100644 index a255822..0000000 --- a/tests/devices/D-Link DIR-890L +++ /dev/null @@ -1,260 +0,0 @@ -{ - "router_address": "10.0.0.1", - "client_address": "10.0.0.136", - "port": 49152, - "gateway_dict": { - "server": "Linux, UPnP/1.0, DIR-890L Ver 1.20", - "urlBase": "http://10.0.0.1:49152", - "location": "http://10.0.0.1:49152/InternetGatewayDevice.xml", - "specVersion": { - "major": "1", - "minor": "0" - }, - "usn": "uuid:81195F69-620A-380A-A9FA-908D784C0DDF::urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "urn": "urn:schemas-upnp-org:device:InternetGatewayDevice:1" - }, - "expected_devices": [ - { - "cache_control": "max-age=1800", - "location": "http://10.0.0.1:49152/InternetGatewayDevice.xml", - "server": "Linux, UPnP/1.0, DIR-890L Ver 1.20", - "st": "urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "usn": "uuid:81195F69-620A-380A-A9FA-908D784C0DDF::urn:schemas-upnp-org:device:InternetGatewayDevice:1" - } - ], - "commands": { - "available": { - "GetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "SetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "GetCommonLinkProperties": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "X_GetICSStatistics": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "SetConnectionType": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetConnectionTypeInfo": "urn:schemas-upnp-org:service:WANIPConnection:1", - "RequestConnection": "urn:schemas-upnp-org:service:WANIPConnection:1", - "ForceTermination": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetStatusInfo": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetNATRSIPStatus": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetGenericPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetSpecificPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:1", - "AddPortMapping": "urn:schemas-upnp-org:service:WANIPConnection:1", - "DeletePortMapping": "urn:schemas-upnp-org:service:WANIPConnection:1", - "GetExternalIPAddress": "urn:schemas-upnp-org:service:WANIPConnection:1" - }, - "failed": { - "urn:schemas-upnp-org:service:WANEthernetLinkConfig:1": [ - "GetEthernetLinkStatus" - ] - } - }, - "ssdp": { - "lan_address": "10.0.0.136", - "router_address": "10.0.0.1", - "sent": [ - "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nMAN: \"ssdp:discover\"\r\nMX: 1\r\n\r\n" - ], - "received": [ - [ - [ - "10.0.0.1", - 33602 - ], - "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=1800\r\nDATE: Fri, 05 Oct 2018 15:48:28 GMT\r\nEXT:\r\nLOCATION: http://10.0.0.1:49152/InternetGatewayDevice.xml\r\nSERVER: Linux, UPnP/1.0, DIR-890L Ver 1.20\r\nST: uuid:81195F69-620A-380A-A9FA-908D784C0DDF\r\nUSN: uuid:81195F69-620A-380A-A9FA-908D784C0DDF\r\n\r\n" - ], - [ - [ - "10.0.0.1", - 47062 - ], - "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=1800\r\nDATE: Fri, 05 Oct 2018 15:48:28 GMT\r\nEXT:\r\nLOCATION: http://10.0.0.1:49152/InternetGatewayDevice.xml\r\nSERVER: Linux, UPnP/1.0, DIR-890L Ver 1.20\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nUSN: uuid:81195F69-620A-380A-A9FA-908D784C0DDF::urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n\r\n" - ] - ] - }, - "scpd": { - "GET": { - "InternetGatewayDevice.xml": { - "request": "GET /InternetGatewayDevice.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\n\n\t\n\t\t1\n\t\t0\n\t\n\thttp://10.0.0.1:49152\n\t\n\t\turn:schemas-upnp-org:device:InternetGatewayDevice:1\n\t\tWireless Broadband Router\n\t\tD-Link Corporation\n\t\thttp://www.dlink.com\n\t\tD-Link Router\n\t\tD-Link Router\n\t\tDIR-890L\n\t\thttp://www.dlink.com\n\t\t120\n\t\tuuid:81195F69-620A-380A-A9FA-908D784C0DDF\n\t\t\n\t\t\t\n\t\t\t\timage/gif\n\t\t\t\t118\n\t\t\t\t119\n\t\t\t\t8\n\t\t\t\t/ligd.gif\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\turn:schemas-microsoft-com:service:OSInfo:1\n\t\t\t\turn:microsoft-com:serviceId:OSInfo1\n\t\t\t\t/soap.cgi?service=OSInfo1\n\t\t\t\t/gena.cgi?service=OSInfo1\n\t\t\t\t/OSInfo.xml\n\t\t\t\n\t\t\t\n\t\t\t\turn:schemas-upnp-org:service:Layer3Forwarding:1\n\t\t\t\turn:upnp-org:serviceId:L3Forwarding1\n\t\t\t\t/soap.cgi?service=L3Forwarding1\n\t\t\t\t/gena.cgi?service=L3Forwarding1\n\t\t\t\t/Layer3Forwarding.xml\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\turn:schemas-upnp-org:device:WANDevice:1\n\t\t\t\tWANDevice\n\t\t\t\tD-Link\n\t\t\t\thttp://www.dlink.com\n\t\t\t\tWANDevice\n\t\t\t\tDIR-890L\n\t\t\t\t1\n\t\t\t\thttp://www.dlink.com\n\t\t\t\t120\n\t\t\t\tuuid:81195F69-620A-380A-A9FA-908D784C0DDF\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\turn:schemas-upnp-org:service:WANCommonInterfaceConfig:1\n\t\t\t\t\t\turn:upnp-org:serviceId:WANCommonIFC1\n\t\t\t\t\t\t/soap.cgi?service=WANCommonIFC1\n\t\t\t\t\t\t/gena.cgi?service=WANCommonIFC1\n\t\t\t\t\t\t/WANCommonInterfaceConfig.xml\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\turn:schemas-upnp-org:device:WANConnectionDevice:1\n\t\t\t\t\t\tWANConnectionDevice\n\t\t\t\t\t\tD-Link\n\t\t\t\t\t\thttp://www.dlink.com\n\t\t\t\t\t\tWanConnectionDevice\n\t\t\t\t\t\tDIR-890L\n\t\t\t\t\t\t1\n\t\t\t\t\t\thttp://www.dlink.com\n\t\t\t\t\t\t120\n\t\t\t\t\t\tuuid:81195F69-620A-380A-A9FA-908D784C0DDF\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\turn:schemas-upnp-org:service:WANEthernetLinkConfig:1\n\t\t\t\t\t\t\t\turn:upnp-org:serviceId:WANEthLinkC1\n\t\t\t\t\t\t\t\t/soap.cgi?service=WANEthLinkC1\n\t\t\t\t\t\t\t\t/gena.cgi?service=WANEthLinkC1\n\t\t\t\t\t\t\t\t/WANEthernetLinkConfig.xml\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\turn:schemas-upnp-org:service:WANIPConnection:1\n\t\t\t\t\t\t\t\turn:upnp-org:serviceId:WANIPConn1\n\t\t\t\t\t\t\t\t/soap.cgi?service=WANIPConn1\n\t\t\t\t\t\t\t\t/gena.cgi?service=WANIPConn1\n\t\t\t\t\t\t\t\t/WANIPConnection.xml\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\thttp://10.0.0.1\n\t\n" - }, - "OSInfo.xml": { - "request": "GET /OSInfo.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\n\n\t\n\t\t1\n\t\t0\n\t\n\t\n\t\n\t\n\t\n" - }, - "Layer3Forwarding.xml": { - "request": "GET /Layer3Forwarding.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\n\n\t\n\t\t1\n\t\t0\n\t\n\t\n\t\t\n\t\t\tGetDefaultConnectionService\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewDefaultConnectionService\n\t\t\t\t\tout\n\t\t\t\t\tDefaultConnectionService\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\tSetDefaultConnectionService\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewDefaultConnectionService\n\t\t\t\t\tin\n\t\t\t\t\tDefaultConnectionService\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\tDefaultConnectionService\n\t\t\tstring\n\t\t\n\t\n" - }, - "WANCommonInterfaceConfig.xml": { - "request": "GET /WANCommonInterfaceConfig.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\r\n\r\n\t\r\n\t\t1\r\n\t\t0\r\n\t\r\n\t\r\n\t\t\r\n\t\t\tGetCommonLinkProperties\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewWANAccessType\r\n\t\t\t\t\tout\r\n\t\t\t\t\tWANAccessType\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLayer1UpstreamMaxBitRate\r\n\t\t\t\t\tout\r\n\t\t\t\t\tLayer1UpstreamMaxBitRate\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLayer1DownstreamMaxBitRate\r\n\t\t\t\t\tout\r\n\t\t\t\t\tLayer1DownstreamMaxBitRate\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPhysicalLinkStatus\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPhysicalLinkStatus\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetTotalBytesSent\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewTotalBytesSent\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalBytesSent\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetTotalBytesReceived\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewTotalBytesReceived\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalBytesReceived\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetTotalPacketsSent\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewTotalPacketsSent\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalPacketsSent\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetTotalPacketsReceived\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewTotalPacketsReceived\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalPacketsReceived\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tX_GetICSStatistics\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tTotalBytesSent\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalBytesSent\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tTotalBytesReceived\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalBytesReceived\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tTotalPacketsSent\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalPacketsSent\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tTotalPacketsReceived\r\n\t\t\t\t\tout\r\n\t\t\t\t\tTotalPacketsReceived\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tLayer1DownstreamMaxBitRate\r\n\t\t\t\t\tout\r\n\t\t\t\t\tLayer1DownstreamMaxBitRate\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tUptime\r\n\t\t\t\t\tout\r\n\t\t\t\t\tX_Uptime\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\tWANAccessType\r\n\t\t\tstring\r\n\t\t\t\r\n\t\t\t\tDSL\r\n\t\t\t\tPOTS\r\n\t\t\t\tCable\r\n\t\t\t\tEthernet\r\n\t\t\t\tOther\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tLayer1UpstreamMaxBitRate\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tLayer1DownstreamMaxBitRate\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tPhysicalLinkStatus\r\n\t\t\tstring\r\n\t\t\t\r\n\t\t\t\tUp\r\n\t\t\t\tDown\r\n\t\t\t\tInitializing\r\n\t\t\t\tUnavailable\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tWANAccessProvider\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tMaximumActiveConnections\r\n\t\t\tui2\r\n\t\t\t\r\n\t\t\t\t1\r\n\t\t\t\t\r\n\t\t\t\t1\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tTotalBytesSent\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tTotalBytesReceived\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tTotalPacketsSent\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tTotalPacketsReceived\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tX_PersonalFirewallEnabled\r\n\t\t\tboolean\r\n\t\t\r\n\t\t\r\n\t\t\tX_Uptime\r\n\t\t\tui4\r\n\t\t\r\n\t\r\n\r" - }, - "WANEthernetLinkConfig.xml": { - "request": "GET /WANEthernetLinkConfig.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\n\n\t\n\t\t1\n\t\t0\n\t\n\t\n\t\t\n\t\t\tGetEthernetLinkStatus\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tNewEthernetLinkStatus\n\t\t\t\t\tout\n\t\t\t\t\tEthernetLinkStatus\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\tEthernetLinkStatus\n\t\t\tstring\n\t\t\t\n\t\t\t\tUp\n\t\t\t\tDown\n\t\t\t\tUnavailable\n\t\t\t\n\t\t\n\t\n" - }, - "WANIPConnection.xml": { - "request": "GET /WANIPConnection.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 10.0.0.1\r\nConnection: Close\r\n\r\n", - "response": "\r\n\r\n\t\r\n\t\t1\r\n\t\t0\r\n\t\r\n\t\r\n\t\t\r\n\t\t\tSetConnectionType\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewConnectionType\r\n\t\t\t\t\tin\r\n\t\t\t\t\tConnectionType\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\r\n\t\t\tGetConnectionTypeInfo\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewConnectionType\r\n\t\t\t\t\tout\r\n\t\t\t\t\tConnectionType\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPossibleConnectionTypes\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPossibleConnectionTypes\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tRequestConnection\r\n\t\t\r\n\t\t\r\n\t\t\tForceTermination\r\n\t\t\r\n\t\t\r\n\t\t\tGetStatusInfo\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewConnectionStatus\r\n\t\t\t\t\tout\r\n\t\t\t\t\tConnectionStatus\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLastConnectionError\r\n\t\t\t\t\tout\r\n\t\t\t\t\tLastConnectionError\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewUptime\r\n\t\t\t\t\tout\r\n\t\t\t\t\tUptime\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetNATRSIPStatus\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewRSIPAvailable\r\n\t\t\t\t\tout\r\n\t\t\t\t\tRSIPAvailable\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewNATEnabled\r\n\t\t\t\t\tout\r\n\t\t\t\t\tNATEnabled\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetGenericPortMappingEntry\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPortMappingIndex\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingNumberOfEntries\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewRemoteHost\r\n\t\t\t\t\tout\r\n\t\t\t\t\tRemoteHost\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewExternalPort\r\n\t\t\t\t\tout\r\n\t\t\t\t\tExternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewProtocol\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingProtocol\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalPort\r\n\t\t\t\t\tout\r\n\t\t\t\t\tInternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalClient\r\n\t\t\t\t\tout\r\n\t\t\t\t\tInternalClient\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewEnabled\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingEnabled\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPortMappingDescription\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingDescription\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLeaseDuration\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingLeaseDuration\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetSpecificPortMappingEntry\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewRemoteHost\r\n\t\t\t\t\tin\r\n\t\t\t\t\tRemoteHost\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewExternalPort\r\n\t\t\t\t\tin\r\n\t\t\t\t\tExternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewProtocol\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingProtocol\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalPort\r\n\t\t\t\t\tout\r\n\t\t\t\t\tInternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalClient\r\n\t\t\t\t\tout\r\n\t\t\t\t\tInternalClient\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewEnabled\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingEnabled\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPortMappingDescription\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingDescription\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLeaseDuration\r\n\t\t\t\t\tout\r\n\t\t\t\t\tPortMappingLeaseDuration\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tAddPortMapping\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewRemoteHost\r\n\t\t\t\t\tin\r\n\t\t\t\t\tRemoteHost\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewExternalPort\r\n\t\t\t\t\tin\r\n\t\t\t\t\tExternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewProtocol\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingProtocol\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalPort\r\n\t\t\t\t\tin\r\n\t\t\t\t\tInternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewInternalClient\r\n\t\t\t\t\tin\r\n\t\t\t\t\tInternalClient\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewEnabled\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingEnabled\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewPortMappingDescription\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingDescription\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewLeaseDuration\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingLeaseDuration\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tDeletePortMapping\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewRemoteHost\r\n\t\t\t\t\tin\r\n\t\t\t\t\tRemoteHost\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewExternalPort\r\n\t\t\t\t\tin\r\n\t\t\t\t\tExternalPort\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewProtocol\r\n\t\t\t\t\tin\r\n\t\t\t\t\tPortMappingProtocol\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tGetExternalIPAddress\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tNewExternalIPAddress\r\n\t\t\t\t\tout\r\n\t\t\t\t\tExternalIPAddress\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\tConnectionType\r\n\t\t\tstring\r\n\t\t\tUnconfigured\r\n\t\t\r\n\t\t\r\n\t\t\tPossibleConnectionTypes\r\n\t\t\tstring\r\n\t\t\t\r\n\t\t\t\tUnconfigured\r\n\t\t\t\tIP_Routed\r\n\t\t\t\tIP_Bridged\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tConnectionStatus\r\n\t\t\tstring\r\n\t\t\tUnconfigured\r\n\t\t\t\r\n\t\t\t\tUnconfigured\r\n\t\t\t\tConnecting\r\n\t\t\t\tAuthenticating\r\n\t\t\t\tPendingDisconnect\r\n\t\t\t\tDisconnecting\r\n\t\t\t\tDisconnected\r\n\t\t\t\tConnected\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tUptime\r\n\t\t\tui4\r\n\t\t\t0\r\n\t\t\t\r\n\t\t\t\t0\r\n\t\t\t\t\r\n\t\t\t\t1\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tRSIPAvailable\r\n\t\tboolean\r\n\t\t\t0\r\n\t\t\r\n\t\t\r\n\t\t\tNATEnabled\r\n\t\t\tboolean\r\n\t\t\t1\r\n\t\t \r\n\t\t\r\n\t\t\tX_Name\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tLastConnectionError\r\n\t\t\tstring\r\n\t\t\tERROR_NONE\r\n\t\t\t\r\n\t\t\t\tERROR_NONE\r\n\t\t\t\tERROR_ISP_TIME_OUT\r\n\t\t\t\tERROR_COMMAND_ABORTED\r\n\t\t\t\tERROR_NOT_ENABLED_FOR_INTERNET\r\n\t\t\t\tERROR_BAD_PHONE_NUMBER\r\n\t\t\t\tERROR_USER_DISCONNECT\r\n\t\t\t\tERROR_ISP_DISCONNECT\r\n\t\t\t\tERROR_IDLE_DISCONNECT\r\n\t\t\t\tERROR_FORCED_DISCONNECT\r\n\t\t\t\tERROR_SERVER_OUT_OF_RESOURCES\r\n\t\t\t\tERROR_RESTRICTED_LOGON_HOURS\r\n\t\t\t\tERROR_ACCOUNT_DISABLED\r\n\t\t\t\tERROR_ACCOUNT_EXPIRED\r\n\t\t\t\tERROR_PASSWORD_EXPIRED\r\n\t\t\t\tERROR_AUTHENTICATION_FAILURE\r\n\t\t\t\tERROR_NO_DIALTONE\r\n\t\t\t\tERROR_NO_CARRIER\r\n\t\t\t\tERROR_NO_ANSWER\r\n\t\t\t\tERROR_LINE_BUSY\r\n\t\t\t\tERROR_UNSUPPORTED_BITSPERSECOND\r\n\t\t\t\tERROR_TOO_MANY_LINE_ERRORS\r\n\t\t\t\tERROR_IP_CONFIGURATION\r\n\t\t\t\tERROR_UNKNOWN\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tExternalIPAddress\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tRemoteHost\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tExternalPort\r\n\t\t\tui2\r\n\t\t\r\n\t\t\r\n\t\t\tInternalPort\r\n\t\t\tui2\r\n\t\t\r\n\t\t\r\n\t\t\tPortMappingProtocol\r\n\t\t\tstring\r\n\t\t\t\r\n\t\t\t\tTCP\r\n\t\t\t\tUDP\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\tInternalClient\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tPortMappingDescription\r\n\t\t\tstring\r\n\t\t\r\n\t\t\r\n\t\t\tPortMappingEnabled\r\n\t\t\tboolean\r\n\t\t\r\n\t\t\r\n\t\t\tPortMappingLeaseDuration\r\n\t\t\tui4\r\n\t\t\r\n\t\t\r\n\t\t\tPortMappingNumberOfEntries\r\n\t\t\tui2\r\n\t\t\r\n\t\r\n\r" - } - }, - "POST": { - "http://10.0.0.1:49152/soap.cgi?service=WANIPConn1": [ - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 285\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n\r\n", - "response": "\n\n\t\n\t\t\n1.2.3.4\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\n\n\t\n\t\t\n\n\n9308\nUDP\n9308\n10.0.0.94\n1\n10.0.0.94:9308 to 9308 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n1\r\n", - "response": "\n\n\t\n\t\t\n\n\n3333\nTCP\n3333\n10.0.0.11\n1\nLBRY peer port\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n2\r\n", - "response": "\n\n\t\n\t\t\n\n\n4444\nUDP\n4444\n10.0.0.11\n1\nLBRY DHT port\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n3\r\n", - "response": "\n\n\t\n\t\t\n\n\n9305\nUDP\n9305\n10.0.0.94\n1\n10.0.0.94:9305 to 9305 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4\r\n", - "response": "\n\n\t\n\t\t\n\n\n9306\nUDP\n9306\n10.0.0.94\n1\n10.0.0.94:9306 to 9306 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n5\r\n", - "response": "\n\n\t\n\t\t\n\t\t\ts:Client\n\t\t\tUPnPError\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t713\n\t\t\t\t\tSpecifiedArrayIndexInvalid\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\n\n\t\n\t\t\n\n\n9308\nUDP\n9308\n10.0.0.94\n1\n10.0.0.94:9308 to 9308 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n1\r\n", - "response": "\n\n\t\n\t\t\n\n\n3333\nTCP\n3333\n10.0.0.11\n1\nLBRY peer port\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n2\r\n", - "response": "\n\n\t\n\t\t\n\n\n4444\nUDP\n4444\n10.0.0.11\n1\nLBRY DHT port\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n3\r\n", - "response": "\n\n\t\n\t\t\n\n\n9305\nUDP\n9305\n10.0.0.94\n1\n10.0.0.94:9305 to 9305 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4\r\n", - "response": "\n\n\t\n\t\t\n\n\n9306\nUDP\n9306\n10.0.0.94\n1\n10.0.0.94:9306 to 9306 (UDP)\n0\n\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n5\r\n", - "response": "\n\n\t\n\t\t\n\t\t\ts:Client\n\t\t\tUPnPError\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t713\n\t\t\t\t\tSpecifiedArrayIndexInvalid\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 598\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP456710.0.0.1361txupnp test mapping\r\n", - "response": "\n\n\t\n\t\t\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 379\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP\r\n", - "response": "\n\n\t\n\t\t\n\t\n" - }, - { - "request": "POST /soap.cgi?service=WANIPConn1 HTTP/1.1\r\nHost: 10.0.0.1:49152\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 403\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:1#GetSpecificPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\nNone4567UDP\r\n", - "response": "\n\n\t\n\t\t\n\t\t\ts:Client\n\t\t\tUPnPError\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t714\n\t\t\t\t\tNoSuchEntryInArray\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n" - } - ] - } - }, - "soap": [ - [ - "get_external_ip", - [], - "1.2.3.4" - ], - [ - "get_redirects", - [], - [ - [ - null, - 9308, - "UDP", - 9308, - "10.0.0.94", - true, - "10.0.0.94:9308 to 9308 (UDP)", - 0 - ], - [ - null, - 3333, - "TCP", - 3333, - "10.0.0.11", - true, - "LBRY peer port", - 0 - ], - [ - null, - 4444, - "UDP", - 4444, - "10.0.0.11", - true, - "LBRY DHT port", - 0 - ], - [ - null, - 9305, - "UDP", - 9305, - "10.0.0.94", - true, - "10.0.0.94:9305 to 9305 (UDP)", - 0 - ], - [ - null, - 9306, - "UDP", - 9306, - "10.0.0.94", - true, - "10.0.0.94:9306 to 9306 (UDP)", - 0 - ] - ] - ], - [ - "get_next_mapping", - [ - 4567, - "UDP", - "txupnp test mapping" - ], - 4567 - ], - [ - "delete_port_mapping", - [ - 4567, - "UDP" - ], - [] - ], - [ - "get_specific_port_mapping", - [ - 4567, - "UDP" - ], - null - ] - ] -} \ No newline at end of file diff --git a/tests/devices/MiniUPnP MiniUPnPd b/tests/devices/MiniUPnP MiniUPnPd deleted file mode 100644 index 6edd3a4..0000000 --- a/tests/devices/MiniUPnP MiniUPnPd +++ /dev/null @@ -1,167 +0,0 @@ -{ - "router_address": "192.168.128.1", - "client_address": "192.168.128.36", - "port": 43412, - "gateway_dict": { - "server": "Ubuntu/lucid UPnP/1.1 MiniUPnPd/1.8", - "urlBase": "http://192.168.128.1:43412", - "location": "http://192.168.128.1:43412/rootDesc.xml", - "specVersion": { - "major": "1", - "minor": "0" - }, - "usn": "uuid:43c2ed51-faac-4bc2-af42-c33a66379328::urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "urn": "urn:schemas-upnp-org:device:InternetGatewayDevice:1" - }, - "expected_devices": [ - { - "cache_control": "max-age=1800", - "location": "http://192.168.128.1:43412/rootDesc.xml", - "server": "Ubuntu/lucid UPnP/1.1 MiniUPnPd/1.8", - "st": "urn:schemas-upnp-org:device:InternetGatewayDevice:1", - "usn": "uuid:43c2ed51-faac-4bc2-af42-c33a66379328::urn:schemas-upnp-org:device:InternetGatewayDevice:1" - } - ], - "commands": { - "available": { - "SetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "GetDefaultConnectionService": "urn:schemas-upnp-org:service:Layer3Forwarding:1", - "GetCommonLinkProperties": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalBytesReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsSent": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "GetTotalPacketsReceived": "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1", - "SetConnectionType": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetConnectionTypeInfo": "urn:schemas-upnp-org:service:WANIPConnection:2", - "RequestConnection": "urn:schemas-upnp-org:service:WANIPConnection:2", - "ForceTermination": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetStatusInfo": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetNATRSIPStatus": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetGenericPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetSpecificPortMappingEntry": "urn:schemas-upnp-org:service:WANIPConnection:2", - "AddPortMapping": "urn:schemas-upnp-org:service:WANIPConnection:2", - "DeletePortMapping": "urn:schemas-upnp-org:service:WANIPConnection:2", - "GetExternalIPAddress": "urn:schemas-upnp-org:service:WANIPConnection:2" - }, - "failed": { - "urn:schemas-upnp-org:service:WANIPConnection:2": [ - "DeletePortMappingRange", - "GetListOfPortMappings", - "AddAnyPortMapping" - ], - "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1": [ - "GetFirewallStatus", - "AddPinhole", - "UpdatePinhole", - "DeletePinhole", - "GetPinholePackets", - "CheckPinholeWorking" - ] - } - }, - "ssdp": { - "lan_address": "192.168.128.36", - "router_address": "192.168.128.1", - "sent": [ - "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nMAN: \"ssdp:discover\"\r\nMX: 1\r\n\r\n" - ], - "received": [ - [ - [ - "192.168.128.1", - 1900 - ], - "HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=120\r\nDATE: Thu, 04 Oct 2018 22:35:51 GMT\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nUSN: uuid:43c2ed51-faac-4bc2-af42-c33a66379328::urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nEXT:\r\nSERVER: Ubuntu/lucid UPnP/1.1 MiniUPnPd/1.8\r\nLOCATION: http://192.168.128.1:43412/rootDesc.xml\r\nOPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n01-NLS: 1\r\nBOOTID.UPNP.ORG: 1\r\nCONFIGID.UPNP.ORG: 1337\r\n\r\n" - ] - ] - }, - "scpd": { - "GET": { - "rootDesc.xml": { - "request": "GET /rootDesc.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 192.168.128.1:43412\r\n\r\n", - "response": "\r\n10urn:schemas-upnp-org:device:InternetGatewayDevice:29x45 MobileAP UPnPUbuntuhttp://www.ubuntu.com/Ubuntu routerUbuntu router1http://www.ubuntu.com/00000000uuid:43c2ed51-faac-4bc2-af42-c33a66379328urn:schemas-upnp-org:service:Layer3Forwarding:1urn:upnp-org:serviceId:Layer3Forwarding1/ctl/L3F/evt/L3F/L3F.xmlurn:schemas-upnp-org:device:WANDevice:2WANDeviceMiniUPnPhttp://miniupnp.free.fr/WAN DeviceWAN Device20140722http://miniupnp.free.fr/00000000uuid:43c2ed51-faac-4bc2-af42-c33a66379329000000000000urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1urn:upnp-org:serviceId:WANCommonIFC1/ctl/CmnIfCfg/evt/CmnIfCfg/WANCfg.xmlurn:schemas-upnp-org:device:WANConnectionDevice:2WANConnectionDeviceMiniUPnPhttp://miniupnp.free.fr/MiniUPnP daemonMiniUPnPd20140722http://miniupnp.free.fr/00000000uuid:43c2ed51-faac-4bc2-af42-c33a6637932a000000000000urn:schemas-upnp-org:service:WANIPConnection:2urn:upnp-org:serviceId:WANIPConn1/ctl/IPConn/evt/IPConn/WANIPCn.xmlurn:schemas-upnp-org:service:WANIPv6FirewallControl:1urn:upnp-org:serviceId:WANIPv6Firewall1/ctl/IP6FCtl/evt/IP6FCtl/WANIP6FC.xml/192.168.128.1:8201" - }, - "L3F.xml": { - "request": "GET /L3F.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 192.168.128.1:43412\r\n\r\n", - "response": "\r\n10SetDefaultConnectionServiceNewDefaultConnectionServiceinDefaultConnectionServiceGetDefaultConnectionServiceNewDefaultConnectionServiceoutDefaultConnectionServiceDefaultConnectionServicestring" - }, - "WANCfg.xml": { - "request": "GET /WANCfg.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 192.168.128.1:43412\r\n\r\n", - "response": "\r\n10GetCommonLinkPropertiesNewWANAccessTypeoutWANAccessTypeNewLayer1UpstreamMaxBitRateoutLayer1UpstreamMaxBitRateNewLayer1DownstreamMaxBitRateoutLayer1DownstreamMaxBitRateNewPhysicalLinkStatusoutPhysicalLinkStatusGetTotalBytesSentNewTotalBytesSentoutTotalBytesSentGetTotalBytesReceivedNewTotalBytesReceivedoutTotalBytesReceivedGetTotalPacketsSentNewTotalPacketsSentoutTotalPacketsSentGetTotalPacketsReceivedNewTotalPacketsReceivedoutTotalPacketsReceivedWANAccessTypestringDSLPOTSCableEthernetLayer1UpstreamMaxBitRateui4Layer1DownstreamMaxBitRateui4PhysicalLinkStatusstringUpDownInitializingUnavailableTotalBytesSentui4TotalBytesReceivedui4TotalPacketsSentui4TotalPacketsReceivedui4" - }, - "WANIPCn.xml": { - "request": "GET /WANIPCn.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 192.168.128.1:43412\r\n\r\n", - "response": "\r\n10SetConnectionTypeNewConnectionTypeinConnectionTypeGetConnectionTypeInfoNewConnectionTypeoutConnectionTypeNewPossibleConnectionTypesoutPossibleConnectionTypesRequestConnectionForceTerminationGetStatusInfoNewConnectionStatusoutConnectionStatusNewLastConnectionErroroutLastConnectionErrorNewUptimeoutUptimeGetNATRSIPStatusNewRSIPAvailableoutRSIPAvailableNewNATEnabledoutNATEnabledGetGenericPortMappingEntryNewPortMappingIndexinPortMappingNumberOfEntriesNewRemoteHostoutRemoteHostNewExternalPortoutExternalPortNewProtocoloutPortMappingProtocolNewInternalPortoutInternalPortNewInternalClientoutInternalClientNewEnabledoutPortMappingEnabledNewPortMappingDescriptionoutPortMappingDescriptionNewLeaseDurationoutPortMappingLeaseDurationGetSpecificPortMappingEntryNewRemoteHostinRemoteHostNewExternalPortinExternalPortNewProtocolinPortMappingProtocolNewInternalPortoutInternalPortNewInternalClientoutInternalClientNewEnabledoutPortMappingEnabledNewPortMappingDescriptionoutPortMappingDescriptionNewLeaseDurationoutPortMappingLeaseDurationAddPortMappingNewRemoteHostinRemoteHostNewExternalPortinExternalPortNewProtocolinPortMappingProtocolNewInternalPortinInternalPortNewInternalClientinInternalClientNewEnabledinPortMappingEnabledNewPortMappingDescriptioninPortMappingDescriptionNewLeaseDurationinPortMappingLeaseDurationDeletePortMappingNewRemoteHostinRemoteHostNewExternalPortinExternalPortNewProtocolinPortMappingProtocolGetExternalIPAddressNewExternalIPAddressoutExternalIPAddressDeletePortMappingRangeNewStartPortinExternalPortNewEndPortinExternalPortNewProtocolinPortMappingProtocolNewManageinA_ARG_TYPE_ManageGetListOfPortMappingsNewStartPortinExternalPortNewEndPortinExternalPortNewProtocolinPortMappingProtocolNewManageinA_ARG_TYPE_ManageNewNumberOfPortsinPortMappingNumberOfEntriesNewPortListingoutA_ARG_TYPE_PortListingAddAnyPortMappingNewRemoteHostinRemoteHostNewExternalPortinExternalPortNewProtocolinPortMappingProtocolNewInternalPortinInternalPortNewInternalClientinInternalClientNewEnabledinPortMappingEnabledNewPortMappingDescriptioninPortMappingDescriptionNewLeaseDurationinPortMappingLeaseDurationNewReservedPortoutExternalPortConnectionTypestringUnconfiguredIP_RoutedIP_BridgedIP_RoutedPossibleConnectionTypesstringConnectionStatusstringUnconfiguredConnectingConnectedPendingDisconnectDisconnectingDisconnectedUptimeui4LastConnectionErrorstringERROR_NONEERROR_COMMAND_ABORTEDERROR_NOT_ENABLED_FOR_INTERNETERROR_USER_DISCONNECTERROR_ISP_DISCONNECTERROR_IDLE_DISCONNECTERROR_FORCED_DISCONNECTERROR_NO_CARRIERERROR_IP_CONFIGURATIONERROR_UNKNOWNRSIPAvailablebooleanNATEnabledbooleanExternalIPAddressstringPortMappingNumberOfEntriesui2PortMappingEnabledbooleanPortMappingLeaseDurationui406048003600RemoteHoststringExternalPortui2InternalPortui2165535PortMappingProtocolstringTCPUDPInternalClientstringPortMappingDescriptionstringSystemUpdateIDui4A_ARG_TYPE_ManagebooleanA_ARG_TYPE_PortListingstring" - }, - "WANIP6FC.xml": { - "request": "GET /WANIP6FC.xml HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: 192.168.128.1:43412\r\n\r\n", - "response": "\r\n10GetFirewallStatusFirewallEnabledoutFirewallEnabledInboundPinholeAllowedoutInboundPinholeAllowedAddPinholeRemoteHostinA_ARG_TYPE_IPv6AddressRemotePortinA_ARG_TYPE_PortInternalClientinA_ARG_TYPE_IPv6AddressInternalPortinA_ARG_TYPE_PortProtocolinA_ARG_TYPE_ProtocolLeaseTimeinA_ARG_TYPE_LeaseTimeUniqueIDoutA_ARG_TYPE_UniqueIDUpdatePinholeUniqueIDinA_ARG_TYPE_UniqueIDNewLeaseTimeinA_ARG_TYPE_LeaseTimeDeletePinholeUniqueIDinA_ARG_TYPE_UniqueIDGetPinholePacketsUniqueIDinA_ARG_TYPE_UniqueIDPinholePacketsoutA_ARG_TYPE_PinholePacketsCheckPinholeWorkingUniqueIDinA_ARG_TYPE_UniqueIDIsWorkingoutA_ARG_TYPE_BooleanFirewallEnabledbooleanA_ARG_TYPE_IPv6AddressstringA_ARG_TYPE_Portui2A_ARG_TYPE_Protocolui2A_ARG_TYPE_UniqueIDui2A_ARG_TYPE_LeaseTimeui4186400InboundPinholeAllowedbooleanA_ARG_TYPE_OutboundPinholeTimeoutui4100200A_ARG_TYPE_BooleanbooleanA_ARG_TYPE_PinholePacketsui4" - } - }, - "POST": { - "http://192.168.128.1:43412/ctl/IPConn": [ - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 285\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#GetExternalIPAddress\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n\r\n", - "response": "\r\n1.2.3.4\r" - }, - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\r\ns:ClientUPnPError713SpecifiedArrayIndexInvalid" - }, - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 341\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#GetGenericPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n0\r\n", - "response": "\r\ns:ClientUPnPError713SpecifiedArrayIndexInvalid" - }, - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 602\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#AddPortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP4567192.168.128.361txupnp test mapping\r\n", - "response": "\r\n\r" - }, - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 379\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#DeletePortMapping\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\n4567UDP\r\n", - "response": "\r\n\r" - }, - { - "request": "POST /ctl/IPConn HTTP/1.1\r\nHost: 192.168.128.1:43412\r\nUser-Agent: python3/txupnp, UPnP/1.0, MiniUPnPc/1.9\r\nContent-Length: 403\r\nContent-Type: text/xml\r\nSOAPAction: \"urn:schemas-upnp-org:service:WANIPConnection:2#GetSpecificPortMappingEntry\"\r\nConnection: Close\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n\r\n\r\nNone4567UDP\r\n", - "response": "\r\ns:ClientUPnPError714NoSuchEntryInArray" - } - ] - } - }, - "soap": [ - [ - "get_external_ip", - [], - "1.2.3.4" - ], - [ - "get_redirects", - [], - [] - ], - [ - "get_next_mapping", - [ - 4567, - "UDP", - "txupnp test mapping" - ], - 4567 - ], - [ - "delete_port_mapping", - [ - 4567, - "UDP" - ], - [] - ], - [ - "get_specific_port_mapping", - [ - 4567, - "UDP" - ], - null - ] - ] -} \ No newline at end of file diff --git a/tests/test_devices.py b/tests/test_devices.py deleted file mode 100644 index cc9ca79..0000000 --- a/tests/test_devices.py +++ /dev/null @@ -1,117 +0,0 @@ -# from twisted.internet import reactor, defer -# from twisted.trial import unittest -# from aioupnp.constants import SSDP_PORT, SSDP_IP_ADDRESS -# from aioupnp.upnp import UPnP -# from aioupnp.mocks import MockReactor, MockSSDPServiceGatewayProtocol, get_device_test_case -# -# -# class TestDevice(unittest.TestCase): -# manufacturer, model = "Cisco", "CGA4131COM" -# -# device = get_device_test_case(manufacturer, model) -# router_address = device.device_dict['router_address'] -# client_address = device.device_dict['client_address'] -# expected_devices = device.device_dict['expected_devices'] -# packets_rx = device.device_dict['ssdp']['received'] -# packets_tx = device.device_dict['ssdp']['sent'] -# expected_available_commands = device.device_dict['commands']['available'] -# scdp_packets = device.device_dict['scpd'] -# -# def setUp(self): -# fake_reactor = MockReactor(self.client_address, self.scdp_packets) -# reactor.listenMulticast = fake_reactor.listenMulticast -# self.reactor = reactor -# server_protocol = MockSSDPServiceGatewayProtocol( -# self.client_address, self.router_address, self.packets_rx, self.packets_tx -# ) -# self.server_port = self.reactor.listenMulticast(SSDP_PORT, server_protocol, interface=self.router_address) -# self.server_port.transport.joinGroup(SSDP_IP_ADDRESS, interface=self.router_address) -# -# self.upnp = UPnP( -# self.reactor, debug_ssdp=True, router_ip=self.router_address, -# lan_ip=self.client_address, iface_name='mock' -# ) -# -# def tearDown(self): -# self.upnp.sspd_factory.disconnect() -# self.server_port.stopListening() -# -# -# class TestSSDP(TestDevice): -# @defer.inlineCallbacks -# def test_discover_device(self): -# result = yield self.upnp.m_search(self.router_address, timeout=1) -# self.assertEqual(len(self.expected_devices), len(result)) -# self.assertEqual(len(result), 1) -# self.assertDictEqual(self.expected_devices[0], result[0]) -# -# -# class TestSCPD(TestDevice): -# @defer.inlineCallbacks -# def setUp(self): -# fake_reactor = MockReactor(self.client_address, self.scdp_packets) -# reactor.listenMulticast = fake_reactor.listenMulticast -# reactor.connectTCP = fake_reactor.connectTCP -# self.reactor = reactor -# server_protocol = MockSSDPServiceGatewayProtocol( -# self.client_address, self.router_address, self.packets_rx, self.packets_tx -# ) -# self.server_port = self.reactor.listenMulticast(SSDP_PORT, server_protocol, interface=self.router_address) -# self.server_port.transport.joinGroup(SSDP_IP_ADDRESS, interface=self.router_address) -# -# self.upnp = UPnP( -# self.reactor, debug_ssdp=True, router_ip=self.router_address, -# lan_ip=self.client_address, iface_name='mock' -# ) -# yield self.upnp.discover() -# -# def test_parse_available_commands(self): -# self.assertDictEqual(self.expected_available_commands, self.upnp.gateway.debug_commands()['available']) -# -# def test_parse_gateway(self): -# self.assertDictEqual(self.device.device_dict['gateway_dict'], self.upnp.gateway.as_dict()) -# -# @defer.inlineCallbacks -# def test_commands(self): -# method, args, expected = self.device.device_dict['soap'][0] -# command1 = getattr(self.upnp, method) -# result = yield command1(*tuple(args)) -# self.assertEqual(result, expected) -# -# method, args, expected = self.device.device_dict['soap'][1] -# command2 = getattr(self.upnp, method) -# result = yield command2(*tuple(args)) -# result = [[i for i in r] for r in result] -# self.assertListEqual(result, expected) -# -# method, args, expected = self.device.device_dict['soap'][2] -# command3 = getattr(self.upnp, method) -# result = yield command3(*tuple(args)) -# self.assertEqual(result, expected) -# -# method, args, expected = self.device.device_dict['soap'][3] -# command4 = getattr(self.upnp, method) -# result = yield command4(*tuple(args)) -# result = [r for r in result] -# self.assertEqual(result, expected) -# -# method, args, expected = self.device.device_dict['soap'][4] -# command5 = getattr(self.upnp, method) -# result = yield command5(*tuple(args)) -# self.assertEqual(result, expected) -# -# -# class TestDDWRTSSDP(TestSSDP): -# manufacturer, model = "DD-WRT", "router" -# -# -# class TestDDWRTSCPD(TestSCPD): -# manufacturer, model = "DD-WRT", "router" -# -# -# class TestMiniUPnPMiniUPnPd(TestSSDP): -# manufacturer, model = "MiniUPnP", "MiniUPnPd" -# -# -# class TestMiniUPnPMiniUPnPdSCPD(TestSCPD): -# manufacturer, model = "MiniUPnP", "MiniUPnPd"