diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7de3433..f4f33c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,12 +48,17 @@ jobs: run: | pip install -r requirements_test.txt - - name: Run tests + - name: Run unit tests run: | - pytest --cov=asusrouter --cov-report term-missing + pytest --cov=asusrouter --cov-report=xml:unit-tests-cov.xml -k 'not test_devices' + + - name: Run real-data tests + run: | + pytest --cov=asusrouter --cov-report=xml:real-data-tests-cov.xml tests/test_devices.py --log-cli-level=INFO - name: Upload coverage to Codecov uses: codecov/codecov-action@v3.1.4 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + files: unit-tests-cov.xml,real-data-tests-cov.xml diff --git a/asusrouter/__main__.py b/asusrouter/__main__.py index 183bb4d..0acfc4b 100644 --- a/asusrouter/__main__.py +++ b/asusrouter/__main__.py @@ -9,6 +9,7 @@ import aiohttp from asusrouter import AsusRouter, AsusRouterDump, AsusRouterError +from asusrouter.modules.data import AsusData _LOGGER = logging.getLogger(__name__) @@ -43,6 +44,13 @@ async def _connect_and_dump(args: argparse.Namespace) -> None: _LOGGER.debug("Connected and identified") + _LOGGER.debug("Checking all known data...") + + for datatype in AsusData: + await router.async_get_data(datatype) + + _LOGGER.debug("Finished checking all known data") + # Disconnect from the router await router.async_disconnect() _LOGGER.debug("Disconnected") diff --git a/asusrouter/asusrouter.py b/asusrouter/asusrouter.py index 9f89ecf..9a869c0 100644 --- a/asusrouter/asusrouter.py +++ b/asusrouter/asusrouter.py @@ -269,8 +269,6 @@ async def _check_flags(self) -> None: ): flags = state_flags.data - print("FLAGS: ", flags) - if flags.get("reboot", False) is True: _LOGGER.debug("Reboot flag is set") await self._async_handle_reboot() diff --git a/asusrouter/modules/endpoint/devicemap.py b/asusrouter/modules/endpoint/devicemap.py index 7e1a35a..23df0dd 100644 --- a/asusrouter/modules/endpoint/devicemap.py +++ b/asusrouter/modules/endpoint/devicemap.py @@ -2,6 +2,7 @@ from __future__ import annotations +import logging import re from datetime import datetime, timedelta from typing import Any, Optional, Tuple @@ -18,6 +19,8 @@ from .devicemap_const import DEVICEMAP_BY_INDEX, DEVICEMAP_BY_KEY, DEVICEMAP_CLEAR +_LOGGER = logging.getLogger(__name__) + REQUIRE_HISTORY = True @@ -31,8 +34,10 @@ def read(content: str) -> dict[str, Any]: try: xml_content: dict[str, Any] = xmltodict.parse(content).get("devicemap", {}) if not xml_content: + _LOGGER.debug("Received empty devicemap XML") return devicemap - except xmltodict.expat.ExpatError: # type: ignore + except xmltodict.expat.ExpatError as ex: # type: ignore + _LOGGER.debug("Received invalid devicemap XML: %s", ex) return devicemap # Go through the data and fill the dict diff --git a/asusrouter/modules/endpoint/ethernet_ports.py b/asusrouter/modules/endpoint/ethernet_ports.py index 9fbfb3c..50fc5e2 100644 --- a/asusrouter/modules/endpoint/ethernet_ports.py +++ b/asusrouter/modules/endpoint/ethernet_ports.py @@ -25,7 +25,7 @@ def process(data: dict[str, Any]) -> dict[AsusData, Any]: """Process ethernet ports data.""" # Ports info - ports = { + ports: dict[PortType, dict] = { PortType.LAN: {}, PortType.WAN: {}, } diff --git a/tests/test_data/__init__.py b/tests/test_data/__init__.py new file mode 100644 index 0000000..86668bf --- /dev/null +++ b/tests/test_data/__init__.py @@ -0,0 +1 @@ +"""Test data for AsusRouter.""" diff --git a/tests/test_data/rt_ax88u_merlin_388/__init__.py b/tests/test_data/rt_ax88u_merlin_388/__init__.py new file mode 100644 index 0000000..d8ef8cc --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/__init__.py @@ -0,0 +1 @@ +"""Test data for RT-AX88U / Merlin 388.""" diff --git a/tests/test_data/rt_ax88u_merlin_388/devicemap_001.content b/tests/test_data/rt_ax88u_merlin_388/devicemap_001.content new file mode 100644 index 0000000..edabc3d --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/devicemap_001.content @@ -0,0 +1,86 @@ + + 2 +0 +0 + +monoClient= +wlc_state=0 +wlc_sbstate=0 +psta:wlc_state=0;wlc_state_auth=0; +wifi_hw_switch=1 +ddnsRet= +ddnsUpdate= +wan_line_state= +wlan0_radio_flag=1 +wlan1_radio_flag=1 +wlan2_radio_flag= +data_rate_info_2g="72 Mbps" +data_rate_info_5g="1921.5 Mbps" +data_rate_info_5g_2="0 Mbps" +wan_diag_state= +active_wan_unit=0 +wan0_enable=1 +wan1_enable=1 +wan0_realip_state=2 +wan1_realip_state=0 +wan0_ipaddr=111.222.111.222 +wan1_ipaddr=0.0.0.0 +wan0_realip_ip=111.222.111.222 +wan1_realip_ip= +vpnc_proto=disable +vpnc_state_t=0 +vpnc_sbstate_t=0 +vpn_client1_state=0 +vpn_client2_state= +vpn_client3_state=0 +vpn_client4_state=-1 +vpn_client5_state= +vpnd_state=0 +vpn_client1_errno=0 +vpn_client2_errno= +vpn_client3_errno=0 +vpn_client4_errno=8 +vpn_client5_errno= +vpn_server1_state=2 +vpn_server2_state= +uptimeStr=Sun, 19 Nov 2023 15:51:06 +0100(509356 secs since boot) +qtn_state= +'[]' +modem_enable=1 +2 +0 +0 +0 +0 +0 + +sim_state= +sim_signal= +sim_operation= +sim_isp= +roaming=0 +roaming_imsi= +sim_imsi= +g3err_pin= +pin_remaining_count= +modem_act_provider= +rx_bytes= +tx_bytes= +modem_sim_order= +dnsqmode= +wlc0_state= +wlc1_state= +rssi_2g= +rssi_5g= +rssi_5g_2= +link_internet=2 +diag_dblog_enable=0 +diag_dblog_remaining=0 +wlc2_state= +le_restart_httpd= +wan_bonding_speed="0" +wan_bonding_p1_status="0" +wan_bonding_p2_status="2" +lacp_wan=0 + + diff --git a/tests/test_data/rt_ax88u_merlin_388/devicemap_001.py b/tests/test_data/rt_ax88u_merlin_388/devicemap_001.py new file mode 100644 index 0000000..623aa36 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/devicemap_001.py @@ -0,0 +1,114 @@ +"""Result of processing devicemap_001.content.""" + +from datetime import datetime + +from dateutil.tz import tzoffset + +from asusrouter import AsusData +from asusrouter.modules.openvpn import AsusOVPNClient, AsusOVPNServer + +expected_result = { + AsusData.DEVICEMAP: { + "wan": { + "status": "2", + "sbstatus": "0", + "auxstatus": "0", + "monoClient": None, + "wlc_state": "0", + "wlc_sbstate": "0", + "wifi_hw_switch": "1", + "ddnsRet": None, + "ddnsUpdate": None, + "line_state": None, + "wlan0_radio_flag": "1", + "wlan1_radio_flag": "1", + "wlan2_radio_flag": None, + "data_rate_info_2g": "72 Mbps", + "data_rate_info_5g": "1921.5 Mbps", + "data_rate_info_5g_2": "0 Mbps", + "diag_state": None, + "active_wan_unit": "0", + "wlc0_state": None, + "wlc1_state": None, + "rssi_2g": None, + "rssi_5g": None, + "rssi_5g_2": None, + "link_internet": "2", + "wlc2_state": None, + "le_restart_httpd": None, + }, + "wan0": { + "status": "2", + "sbstatus": "0", + "auxstatus": "0", + "enable": "1", + "realip_state": "2", + "ipaddr": "111.222.111.222", + "realip_ip": "111.222.111.222", + }, + "wan1": { + "status": "0", + "sbstatus": "0", + "auxstatus": "0", + "enable": "1", + "realip_state": "0", + "ipaddr": "0.0.0.0", + "realip_ip": None, + }, + "usb": {"status": "'[]'", "modem_enable": "1"}, + "vpn": { + "vpnc_proto": "disable", + "vpnc_state_t": "0", + "vpnc_sbstate_t": "0", + "client1_state": "0", + "client2_state": None, + "client3_state": "0", + "client4_state": "-1", + "client5_state": None, + "vpnd_state": "0", + "client1_errno": "0", + "client2_errno": None, + "client3_errno": "0", + "client4_errno": "8", + "client5_errno": None, + "server1_state": "2", + "server2_state": None, + }, + "sys": {"uptimeStr": "Sun, 19 Nov 2023 15:51:06 +0100(509356 secs since boot)"}, + "qtn": {"state": None}, + "sim": { + "state": None, + "signal": None, + "operation": None, + "isp": None, + "roaming": "0", + "roaming_imsi": None, + "imsi": None, + "g3err_pin": None, + "pin_remaining_count": None, + "modem_act_provider": None, + "rx_bytes": None, + "tx_bytes": None, + "modem_sim_order": None, + }, + "dhcp": {"dnsqmode": None}, + "diag": {"dblog_enable": "0", "dblog_remaining": "0"}, + }, + AsusData.BOOTTIME: { + "datetime": datetime(2023, 11, 13, 18, 21, 50, tzinfo=tzoffset(None, 3600)) + }, + AsusData.OPENVPN: { + "client": { + 1: {"state": AsusOVPNClient.DISCONNECTED, "errno": 0}, + 2: {"state": AsusOVPNClient.DISCONNECTED, "errno": None}, + 3: {"state": AsusOVPNClient.DISCONNECTED, "errno": 0}, + 4: {"state": AsusOVPNClient.ERROR, "errno": 8}, + 5: {"state": AsusOVPNClient.DISCONNECTED, "errno": None}, + }, + "server": { + 1: {"state": AsusOVPNServer.CONNECTED}, + 2: {"state": AsusOVPNServer.DISCONNECTED}, + }, + }, + AsusData.FLAGS: {}, +} diff --git a/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.content b/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.content new file mode 100644 index 0000000..d0f8f3d --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.content @@ -0,0 +1,2 @@ +get_wan_lan_status = { "portSpeed": { "WAN 0": "G", "LAN 1": "G", "LAN 2": "G", "LAN 3": "G", "LAN 4": "X", "LAN 5": "X", "LAN 6": "X", "LAN 7": "X", "LAN 8": "G" }, "portCount": { "wanCount": 1, "lanCount": 8 } }; + diff --git a/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.py b/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.py new file mode 100644 index 0000000..4054387 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.py @@ -0,0 +1,49 @@ +"""Result of processing ethernet_ports_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.ports import PortSpeed, PortType + +expected_result = { + AsusData.PORTS: { + PortType.LAN: { + 1: { + "link_rate": PortSpeed.LINK_1000, + "state": True, + }, + 2: { + "link_rate": PortSpeed.LINK_1000, + "state": True, + }, + 3: { + "link_rate": PortSpeed.LINK_1000, + "state": True, + }, + 4: { + "link_rate": PortSpeed.LINK_DOWN, + "state": False, + }, + 5: { + "link_rate": PortSpeed.LINK_DOWN, + "state": False, + }, + 6: { + "link_rate": PortSpeed.LINK_DOWN, + "state": False, + }, + 7: { + "link_rate": PortSpeed.LINK_DOWN, + "state": False, + }, + 8: { + "link_rate": PortSpeed.LINK_1000, + "state": True, + }, + }, + PortType.WAN: { + 0: { + "link_rate": PortSpeed.LINK_1000, + "state": True, + }, + }, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/firmware_001.content b/tests/test_data/rt_ax88u_merlin_388/firmware_001.content new file mode 100644 index 0000000..ab89116 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/firmware_001.content @@ -0,0 +1,25 @@ +webs_state_update = '1'; +webs_state_error = '0'; +webs_state_info = '3004_388_4_0'; +webs_state_info_beta = ''; +webs_state_REQinfo = ''; +webs_state_flag = '0'; +webs_state_upgrade = ''; +webs_state_level = '0'; +sig_state_flag = '1'; +sig_state_update = '0'; +sig_state_upgrade = '1'; +sig_state_error = '0'; +sig_ver = '2.380'; +if(cfg_sync_support){ +cfg_check = ''; +cfg_upgrade = ''; +} +if(pipefw_support || urlfw_support){ +hndwr_status = '99'; +} +if(rbkfw_support){ +_rollback_info = JSON.parse(''); +rbk_count = Object.keys(_rollback_info).length; +} + diff --git a/tests/test_data/rt_ax88u_merlin_388/firmware_001.py b/tests/test_data/rt_ax88u_merlin_388/firmware_001.py new file mode 100644 index 0000000..0eed839 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/firmware_001.py @@ -0,0 +1,26 @@ +"""Result of processing firmware_001.content.""" + +from asusrouter import AsusData + +expected_result = { + AsusData.FIRMWARE: { + "webs_state_error": "0", + "webs_state_info": "3004_388_4_0", + "webs_state_info_beta": "", + "webs_state_REQinfo": "", + "webs_state_flag": "0", + "webs_state_upgrade": "", + "webs_state_level": "0", + "sig_state_flag": "1", + "sig_state_update": "0", + "sig_state_upgrade": "1", + "sig_state_error": "0", + "sig_ver": "2.380", + "cfg_check": "", + "cfg_upgrade": "", + "hndwr_status": "99", + "state": True, + "current": "None", + "available": "3.0.0.4.388.4_0", + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_001.content b/tests/test_data/rt_ax88u_merlin_388/hook_001.content new file mode 100644 index 0000000..a6baba1 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_001.content @@ -0,0 +1,5 @@ +{ +"cpu_usage":{"cpu1_total":"52557468","cpu1_usage":"4733197","cpu2_total":"52587131","cpu2_usage":"1731814","cpu3_total":"52621020","cpu3_usage":"1821047","cpu4_total":"52620879","cpu4_usage":"1720689"}, +"memory_usage":{"mem_total":"1048576","mem_free":"235464","mem_used":"813112"}, +"netdev":{ "BRIDGE_rx":"0x30a0b6bba","BRIDGE_tx":"0x134ce06712","INTERNET_rx":"0xe5d193f41","INTERNET_tx":"0x2000941dd","INTERNET_rx":"0xeb9a134fe","INTERNET_tx":"0x227d6b665","WIRED_rx":"0x39ddba16c","WIRED_tx":"0x80c855eba","WIRELESS0_rx":"0x1d09911e","WIRELESS0_tx":"0x610f01c4","WIRELESS1_rx":"0x2f570951","WIRELESS1_tx":"0x32ed23b8c","LACP1_rx":"0x0","LACP1_tx":"0x5e9c7a8c","LACP2_rx":"0xf5b08c18","LACP2_tx":"0x4408840"} +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_001.py b/tests/test_data/rt_ax88u_merlin_388/hook_001.py new file mode 100644 index 0000000..508a7ba --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_001.py @@ -0,0 +1,28 @@ +"""Result of processing hook_001.content.""" + +from asusrouter import AsusData + +expected_result = { + AsusData.CPU: { + "total": {"total": 210386498.0, "used": 10006747.0}, + 1: {"total": 52557468, "used": 4733197}, + 2: {"total": 52587131, "used": 1731814}, + 3: {"total": 52621020, "used": 1821047}, + 4: {"total": 52620879, "used": 1720689}, + }, + AsusData.NETWORK: { + "wan": {"rx": 63243891966, "tx": 9258317413}, + "wired": {"rx": 15533318508, "tx": 34569805498}, + "bridge": {"rx": 13053422522, "tx": 82894153490}, + "2ghz": {"rx": 487166238, "tx": 1628373444}, + "5ghz": {"rx": 794233169, "tx": 13670431628}, + "lacp1": {"rx": 0, "tx": 1587313292}, + "lacp2": {"rx": 4121988120, "tx": 71338048}, + }, + AsusData.RAM: { + "free": 235464, + "total": 1048576, + "used": 813112, + "usage": 77.54, + }, +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_002.content b/tests/test_data/rt_ax88u_merlin_388/hook_002.content new file mode 100644 index 0000000..b7a82ed --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_002.content @@ -0,0 +1,3 @@ +{ +"led_val":"0" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_002.py b/tests/test_data/rt_ax88u_merlin_388/hook_002.py new file mode 100644 index 0000000..fa17d6a --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_002.py @@ -0,0 +1,6 @@ +"""Result of processing hook_002.content.""" + +from asusrouter import AsusData +from asusrouter.modules.led import AsusLED + +expected_result = {AsusData.LED: {"state": AsusLED.OFF}} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_003.content b/tests/test_data/rt_ax88u_merlin_388/hook_003.content new file mode 100644 index 0000000..8a56de4 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_003.content @@ -0,0 +1,7 @@ +{ +"MULTIFILTER_MAC":"00:00:00:00:00:01ᠸ:00:00:00:00:02ᠸ:00:00:00:00:03ᠸ:00:00:00:00:04ᠸ:00:00:00:00:05ᠸ:00:00:00:00:06ᠸ:00:00:00:00:07ᠸ:00:00:00:00:08", +"MULTIFILTER_DEVICENAME":"FakeName001>FakeName002>FakeName003>FakeName004>FakeName005>FakeName006>FakeName007>FakeName008", +"MULTIFILTER_ALL":"1", +"MULTIFILTER_MACFILTER_DAYTIME_V2":"W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800>W03E21000700<W04122000800", +"MULTIFILTER_ENABLE":"2ɮɮɮɮɮɬɬ" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_003.py b/tests/test_data/rt_ax88u_merlin_388/hook_003.py new file mode 100644 index 0000000..75105e4 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_003.py @@ -0,0 +1,60 @@ +"""Result of processing hook_003.content.""" + +from asusrouter import AsusData +from asusrouter.modules.parental_control import AsusParentalControl, ParentalControlRule + +expected_result = { + AsusData.PARENTAL_CONTROL: { + "state": AsusParentalControl.ON, + "rules": { + "00:00:00:00:00:01": ParentalControlRule( + mac="00:00:00:00:00:01", + name="FakeName001", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:02": ParentalControlRule( + mac="00:00:00:00:00:02", + name="FakeName002", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:03": ParentalControlRule( + mac="00:00:00:00:00:03", + name="FakeName003", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:04": ParentalControlRule( + mac="00:00:00:00:00:04", + name="FakeName004", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:05": ParentalControlRule( + mac="00:00:00:00:00:05", + name="FakeName005", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:06": ParentalControlRule( + mac="00:00:00:00:00:06", + name="FakeName006", + type="block", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:07": ParentalControlRule( + mac="00:00:00:00:00:07", + name="FakeName007", + type="disable", + timemap="W03E21000700<W04122000800", + ), + "00:00:00:00:00:08": ParentalControlRule( + mac="00:00:00:00:00:08", + name="FakeName008", + type="disable", + timemap="W03E21000700<W04122000800", + ), + }, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_004.content b/tests/test_data/rt_ax88u_merlin_388/hook_004.content new file mode 100644 index 0000000..c4c41d6 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_004.content @@ -0,0 +1,4 @@ +{ +"vts_rulelist":"", +"vts_enable_x":"0" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_004.py b/tests/test_data/rt_ax88u_merlin_388/hook_004.py new file mode 100644 index 0000000..e5451a9 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_004.py @@ -0,0 +1,6 @@ +"""Result of processing hook_004.content.""" + +from asusrouter import AsusData +from asusrouter.modules.port_forwarding import AsusPortForwarding + +expected_result = {AsusData.PORT_FORWARDING: {"state": AsusPortForwarding.OFF}} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_005.content b/tests/test_data/rt_ax88u_merlin_388/hook_005.content new file mode 100644 index 0000000..40badc6 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_005.content @@ -0,0 +1,63 @@ +{ +"vpnc_clientlist":"", +"wgc1_enable":"", +"wgc1_nat":"", +"wgc1_priv":"", +"wgc1_addr":"", +"wgc1_dns":"", +"wgc1_mtu":"", +"wgc1_ppub":"", +"wgc1_psk":"", +"wgc1_aips":"", +"wgc1_ep_addr":"", +"wgc1_ep_port":"", +"wgc1_alive":"", +"wgc2_enable":"", +"wgc2_nat":"", +"wgc2_priv":"", +"wgc2_addr":"", +"wgc2_dns":"", +"wgc2_mtu":"", +"wgc2_ppub":"", +"wgc2_psk":"", +"wgc2_aips":"", +"wgc2_ep_addr":"", +"wgc2_ep_port":"", +"wgc2_alive":"", +"wgc3_enable":"", +"wgc3_nat":"", +"wgc3_priv":"", +"wgc3_addr":"", +"wgc3_dns":"", +"wgc3_mtu":"", +"wgc3_ppub":"", +"wgc3_psk":"", +"wgc3_aips":"", +"wgc3_ep_addr":"", +"wgc3_ep_port":"", +"wgc3_alive":"", +"wgc4_enable":"", +"wgc4_nat":"", +"wgc4_priv":"", +"wgc4_addr":"", +"wgc4_dns":"", +"wgc4_mtu":"", +"wgc4_ppub":"", +"wgc4_psk":"", +"wgc4_aips":"", +"wgc4_ep_addr":"", +"wgc4_ep_port":"", +"wgc4_alive":"", +"wgc5_enable":"1", +"wgc5_nat":"1", +"wgc5_priv":"PrIvAtE KeY", +"wgc5_addr":"10.1.1.11/32", +"wgc5_dns":"", +"wgc5_mtu":"", +"wgc5_ppub":"PuBlIk kEy", +"wgc5_psk":"PrE-ShArEd kEy", +"wgc5_aips":"10.1.1.0/24,192.168.1.0/24", +"wgc5_ep_addr":"111.222.111.222", +"wgc5_ep_port":"443", +"wgc5_alive":"25" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_005.py b/tests/test_data/rt_ax88u_merlin_388/hook_005.py new file mode 100644 index 0000000..98c2ec3 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_005.py @@ -0,0 +1,61 @@ +"""Result of processing hook_005.content.""" + +from asusrouter import AsusData +from asusrouter.modules.endpoint.error import AccessError +from asusrouter.modules.vpnc import AsusVPNC, AsusVPNType + +expected_result = { + AsusData.OPENVPN_CLIENT: { + 1: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 2: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 3: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 4: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 5: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + }, + AsusData.VPNC: { + AsusVPNType.OPENVPN: { + 1: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 2: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 3: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 4: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 5: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + }, + AsusVPNType.WIREGUARD: { + 5: { + "state": True, + "nat": True, + "private_key": "PrIvAtE KeY", + "address": "10.1.1.11/32", + "public_key": "PuBlIk kEy", + "psk": "PrE-ShArEd kEy", + "allowed_ips": ["10.1.1.0/24", "192.168.1.0/24"], + "endpoint_address": "111.222.111.222", + "endpoint_port": 443, + "keep_alive": 25, + }, + 1: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 2: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 3: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 4: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + }, + }, + AsusData.VPNC_CLIENTLIST: "", + AsusData.WIREGUARD_CLIENT: { + 5: { + "state": True, + "nat": True, + "private_key": "PrIvAtE KeY", + "address": "10.1.1.11/32", + "public_key": "PuBlIk kEy", + "psk": "PrE-ShArEd kEy", + "allowed_ips": ["10.1.1.0/24", "192.168.1.0/24"], + "endpoint_address": "111.222.111.222", + "endpoint_port": 443, + "keep_alive": 25, + }, + 1: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 2: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 3: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + 4: {"state": AsusVPNC.UNKNOWN, "error": AccessError.NO_ERROR}, + }, +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_006.content b/tests/test_data/rt_ax88u_merlin_388/hook_006.content new file mode 100644 index 0000000..52f1a77 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_006.content @@ -0,0 +1,48 @@ +{ +"get_wan_unit":0, +"link_internet":"2", +"link_wan":"1", +"link_wan1":"0", +"wans_mode":"fo", +"wans_dualwan":"wan none", +"bond_wan":"0", +"wanports_bond":"4 0", +"wan0_auxstate_t":"0", +"wan0_primary":"1", +"wan0_proto":"pppoe", +"wan0_realip_ip":"111.222.111.222", +"wan0_realip_state":"2", +"wan0_state_t":"2", +"wan0_sbstate_t":"0", +"wan1_auxstate_t":"0", +"wan1_primary":"0", +"wan1_proto":"dhcp", +"wan1_realip_ip":"", +"wan1_realip_state":"0", +"wan1_state_t":"0", +"wan1_sbstate_t":"0", +"wan0_dns":"222.111.222.110 222.111.222.111", +"wan0_expires":"", +"wan0_gateway":"111.222.111.1", +"wan0_ipaddr":"111.222.111.222", +"wan0_lease":"", +"wan0_netmask":"255.255.255.255", +"wan0_xdns":"192.168.1.254", +"wan0_xexpires":"604829", +"wan0_xgateway":"192.168.1.254", +"wan0_xipaddr":"192.168.1.2", +"wan0_xlease":"86400", +"wan0_xnetmask":"255.255.255.0", +"wan1_dns":"", +"wan1_expires":"", +"wan1_gateway":"0.0.0.0", +"wan1_ipaddr":"0.0.0.0", +"wan1_lease":"", +"wan1_netmask":"0.0.0.0", +"wan1_xdns":"", +"wan1_xexpires":"", +"wan1_xgateway":"0.0.0.0", +"wan1_xipaddr":"0.0.0.0", +"wan1_xlease":"", +"wan1_xnetmask":"0.0.0.0" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_006.py b/tests/test_data/rt_ax88u_merlin_388/hook_006.py new file mode 100644 index 0000000..003073d --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_006.py @@ -0,0 +1,74 @@ +"""Result of processing hook_006.content.""" + +from asusrouter import AsusData +from asusrouter.modules.connection import ConnectionState, ConnectionStatus +from asusrouter.modules.endpoint.wan import AsusDualWAN +from asusrouter.modules.ip_address import IPAddressType + +expected_result = { + AsusData.WAN: { + "internet": { + "unit": 0, + "link": ConnectionStatus.CONNECTED, + "ip_address": "111.222.111.222", + }, + 0: { + "auxstate": ConnectionStatus.DISCONNECTED, + "primary": True, + "protocol": IPAddressType.PPPOE, + "real_ip": "111.222.111.222", + "real_ip_state": None, + "state": ConnectionStatus.CONNECTED, + "bstate": ConnectionStatus.DISCONNECTED, + "main": { + "dns": ["222.111.222.110", "222.111.222.111"], + "expires": None, + "gateway": "111.222.111.1", + "ip_address": "111.222.111.222", + "lease": None, + "mask": "255.255.255.255", + }, + "extra": { + "dns": ["192.168.1.254"], + "expires": 604829, + "gateway": "192.168.1.254", + "ip_address": "192.168.1.2", + "lease": 86400, + "mask": "255.255.255.0", + }, + "link": ConnectionState.CONNECTED, + }, + 1: { + "auxstate": ConnectionStatus.DISCONNECTED, + "primary": False, + "protocol": IPAddressType.DHCP, + "real_ip": "", + "real_ip_state": False, + "state": ConnectionStatus.DISCONNECTED, + "bstate": ConnectionStatus.DISCONNECTED, + "main": { + "dns": [], + "expires": None, + "gateway": "0.0.0.0", + "ip_address": "0.0.0.0", + "lease": None, + "mask": "0.0.0.0", + }, + "extra": { + "dns": [], + "expires": None, + "gateway": "0.0.0.0", + "ip_address": "0.0.0.0", + "lease": None, + "mask": "0.0.0.0", + }, + "link": ConnectionState.DISCONNECTED, + }, + "aggregation": {"state": False, "ports": ["4", "0"]}, + "dualwan": { + "mode": AsusDualWAN.FAILOVER, + "priority": ["wan", None], + "state": False, + }, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_007.content b/tests/test_data/rt_ax88u_merlin_388/hook_007.content new file mode 100644 index 0000000..25437dd --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_007.content @@ -0,0 +1,64 @@ +{ +"get_wgsc_status":{ "client_status": [ { "pub": "PuB001", "index": 3, "status": 0 }, { "pub": "PuB002", "index": 2, "status": 0 }, { "pub": "PuB003", "index": 5, "status": 0 }, { "pub": "PuB004", "index": 6, "status": 0 }, { "pub": "PuB005", "index": 1, "status": 0 }, { "pub": "PuB006", "index": 4, "status": 0 } ] } +, +"wgs_enable":"1", +"wgs_lanaccess":"1", +"wgs_addr":"10.1.0.1/24", +"wgs_port":"443", +"wgs_dns":"1", +"wgs_nat6":"1", +"wgs_psk":"1", +"wgs_alive":"25", +"wgs_priv":"PrIvAtE KeY", +"wgs_pub":"PuBlIk kEy", +"wgs1_c1_enable":"1", +"wgs1_c1_name":"FakeName001", +"wgs1_c1_addr":"10.1.0.2/32", +"wgs1_c1_aips":"10.1.0.2/32", +"wgs1_c1_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c2_enable":"1", +"wgs1_c2_name":"FakeName002", +"wgs1_c2_addr":"10.1.0.3/32", +"wgs1_c2_aips":"10.1.0.3/32", +"wgs1_c2_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c3_enable":"1", +"wgs1_c3_name":"FakeName003", +"wgs1_c3_addr":"10.1.0.4/32", +"wgs1_c3_aips":"10.1.0.4/32", +"wgs1_c3_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c4_enable":"1", +"wgs1_c4_name":"FakeName004", +"wgs1_c4_addr":"10.1.0.5/32", +"wgs1_c4_aips":"10.1.0.5/32", +"wgs1_c4_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c5_enable":"1", +"wgs1_c5_name":"FakeName005", +"wgs1_c5_addr":"10.1.0.6/32", +"wgs1_c5_aips":"10.1.0.6/32", +"wgs1_c5_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c6_enable":"1", +"wgs1_c6_name":"FakeName006", +"wgs1_c6_addr":"10.1.0.7/32", +"wgs1_c6_aips":"10.1.0.7/32", +"wgs1_c6_caips":"192.168.1.0/24,10.1.0.0/24", +"wgs1_c7_enable":"", +"wgs1_c7_name":"", +"wgs1_c7_addr":"", +"wgs1_c7_aips":"", +"wgs1_c7_caips":"", +"wgs1_c8_enable":"", +"wgs1_c8_name":"", +"wgs1_c8_addr":"", +"wgs1_c8_aips":"", +"wgs1_c8_caips":"", +"wgs1_c9_enable":"", +"wgs1_c9_name":"", +"wgs1_c9_addr":"", +"wgs1_c9_aips":"", +"wgs1_c9_caips":"", +"wgs1_c10_enable":"", +"wgs1_c10_name":"", +"wgs1_c10_addr":"", +"wgs1_c10_aips":"", +"wgs1_c10_caips":"" +} diff --git a/tests/test_data/rt_ax88u_merlin_388/hook_007.py b/tests/test_data/rt_ax88u_merlin_388/hook_007.py new file mode 100644 index 0000000..b63df21 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/hook_007.py @@ -0,0 +1,72 @@ +"""Result of processing hook_007.content.""" + +from asusrouter import AsusData +from asusrouter.modules.connection import ConnectionState +from asusrouter.modules.wireguard import AsusWireGuardServer + +expected_result = { + AsusData.WIREGUARD_SERVER: { + 1: { + "state": AsusWireGuardServer.ON, + "lan_access": True, + "address": "10.1.0.1/24", + "port": 443, + "dns": True, + "nat6": True, + "psk": True, + "keep_alive": 25, + "private_key": "PrIvAtE KeY", + "public_key": "PuBlIk kEy", + "clients": { + 1: { + "enabled": True, + "name": "FakeName001", + "address": "10.1.0.2/32", + "allowed_ips": ["10.1.0.2/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + 2: { + "enabled": True, + "name": "FakeName002", + "address": "10.1.0.3/32", + "allowed_ips": ["10.1.0.3/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + 3: { + "enabled": True, + "name": "FakeName003", + "address": "10.1.0.4/32", + "allowed_ips": ["10.1.0.4/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + 4: { + "enabled": True, + "name": "FakeName004", + "address": "10.1.0.5/32", + "allowed_ips": ["10.1.0.5/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + 5: { + "enabled": True, + "name": "FakeName005", + "address": "10.1.0.6/32", + "allowed_ips": ["10.1.0.6/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + 6: { + "enabled": True, + "name": "FakeName006", + "address": "10.1.0.7/32", + "allowed_ips": ["10.1.0.7/32"], + "client_allowed_ips": ["192.168.1.0/24", "10.1.0.0/24"], + "state": ConnectionState.DISCONNECTED, + }, + }, + } + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/onboarding_001.content b/tests/test_data/rt_ax88u_merlin_388/onboarding_001.content new file mode 100644 index 0000000..b7b0842 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/onboarding_001.content @@ -0,0 +1,9 @@ +get_onboardinglist = [{}][0]; +get_cfg_clientlist = [[{"alias":"Living Room","model_name":"RT-AX88U","ui_model_name":"RT-AX88U","icon_model_name":"","product_id":"RT-AX88U","frs_model_name":"","fwver":"3.0.0.4.388.4_0","newfwver":"","ip":"192.168.1.1","mac":"00:00:00:00:00:00","online":"1","ap2g":"00:00:00:00:00:00","ap5g":"00:00:00:00:00:01","ap5g1":"","apdwb":"","ap6g":"","wired_mac":[],"pap2g":"","rssi2g":"","pap5g":"","rssi5g":"","pap6g":"","rssi6g":"","level":"0","re_path":"0","config":{},"sta2g":"","sta5g":"","sta6g":"","capability":{"3":3,"2":1,"16":1,"17":1,"19":1,"20":1,"1":31,"4":10111,"22":3,"23":1},"ap2g_ssid":"WiFi2","ap5g_ssid":"WiFi5","ap5g1_ssid":"","ap6g_ssid":"","pap2g_ssid":"","pap5g_ssid":"","pap6g_ssid":"","wired_port":{},"plc_status":{},"moca_status":{},"band_num":"2","tcode":"EU/01","misc_info":{"2":"1"},"ap2g_fh":"00:00:00:00:00:00","ap5g_fh":"00:00:00:00:00:01","ap5g1_fh":"","ap6g_fh":"","ap2g_ssid_fh":"WiFi2","ap5g_ssid_fh":"WiFi5","ap5g1_ssid_fh":"","ap6g_ssid_fh":"","band_info":{"0":{"unit":0},"1":{"unit":1}}}]][0]; +get_onboardingstatus = [{"cfg_obstatus":"1","cfg_obresult":"","cfg_newre":"","cfg_wifi_quality":"-65","cfg_obstart":"","cfg_obcurrent":"1700405465","cfg_obtimeout":"","cfg_obmodel":"","cfg_ui_obmodel":"","cfg_obrssi":"-23","cfg_obcount":"0","cfg_obreboottime":"","cfg_obstage":"0","cfg_obfailresult":"0","cfg_re_maxnum":"9","cfg_recount":"0","cfg_ready":"1"}][0]; +get_wclientlist = [{"00:00:00:00:00:00":{"2G":["00:00:00:00:00:02","00:00:00:00:00:03","00:00:00:00:00:04","00:00:00:00:00:05","00:00:00:00:00:06","00:00:00:00:00:07","00:00:00:00:00:08","00:00:00:00:00:09","00:00:00:00:00:10","00:00:00:00:00:11","00:00:00:00:00:12"],"5G":["00:00:00:00:00:13","00:00:00:00:00:14","00:00:00:00:00:15"]}}][0]; +get_wiredclientlist = [{ "00:00:00:00:00:00": [ "00:00:00:00:00:16", "00:00:00:00:00:17", "00:00:00:00:00:18", "00:00:00:00:00:19", "00:00:00:00:00:20" ] }][0]; +get_allclientlist = [{"00:00:00:00:00:00":{"2G":{"00:00:00:00:00:02":{"ip":"192.168.1.2","rssi":"-34"},"00:00:00:00:00:03":{"ip":"192.168.1.3","rssi":"-47"},"00:00:00:00:00:04":{"ip":"192.168.1.4","rssi":"-58"},"00:00:00:00:00:05":{"ip":"192.168.1.5","rssi":"-50"},"00:00:00:00:00:06":{"ip":"192.168.1.6","rssi":"-26"},"00:00:00:00:00:07":{"ip":"192.168.1.7","rssi":"-52"},"00:00:00:00:00:08":{"ip":"192.168.1.8","rssi":"-41"},"00:00:00:00:00:09":{"ip":"192.168.1.9","rssi":"-41"},"00:00:00:00:00:10":{"ip":"192.168.1.10","rssi":"-44"},"00:00:00:00:00:11":{"ip":"192.168.1.11","rssi":"-43"},"00:00:00:00:00:12":{"ip":"192.168.1.12","rssi":"-53"}},"5G":{"00:00:00:00:00:13":{"ip":"192.168.1.13","rssi":"-43"},"00:00:00:00:00:14":{"ip":"192.168.1.14","rssi":"-27"},"00:00:00:00:00:15":{"ip":"192.168.1.15","rssi":"-40"}},"wired_mac":{"00:00:00:00:00:16":{"ip":"192.168.1.16"},"00:00:00:00:00:17":{"ip":"192.168.1.17"},"00:00:00:00:00:18":{"ip":"192.168.1.18"},"00:00:00:00:00:19":{"ip":"192.168.1.19"},"00:00:00:00:00:20":{"ip":"192.168.1.20"}}}}][0]; +cfg_note = "1"; +cfg_obre = ""; + diff --git a/tests/test_data/rt_ax88u_merlin_388/onboarding_001.py b/tests/test_data/rt_ax88u_merlin_388/onboarding_001.py new file mode 100644 index 0000000..67b1832 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/onboarding_001.py @@ -0,0 +1,197 @@ +"""Result of processing onboarding_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.aimesh import AiMeshDevice + +expected_result = { + AsusData.AIMESH: { + "00:00:00:00:00:00": AiMeshDevice( + status=True, + alias="Living Room", + model="RT-AX88U", + product_id="RT-AX88U", + ip="192.168.1.1", + fw="3.0.0.4.388.4_0", + fw_new=None, + mac="00:00:00:00:00:00", + ap={"2ghz": "00:00:00:00:00:00", "5ghz": "00:00:00:00:00:01"}, + parent={}, + type="router", + level=0, + config={}, + ) + }, + AsusData.CLIENTS: { + "00:00:00:00:00:02": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.2", + "mac": "00:00:00:00:00:02", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-34", + }, + "00:00:00:00:00:03": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.3", + "mac": "00:00:00:00:00:03", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-47", + }, + "00:00:00:00:00:04": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.4", + "mac": "00:00:00:00:00:04", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-58", + }, + "00:00:00:00:00:05": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.5", + "mac": "00:00:00:00:00:05", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-50", + }, + "00:00:00:00:00:06": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.6", + "mac": "00:00:00:00:00:06", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-26", + }, + "00:00:00:00:00:07": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.7", + "mac": "00:00:00:00:00:07", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-52", + }, + "00:00:00:00:00:08": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.8", + "mac": "00:00:00:00:00:08", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-41", + }, + "00:00:00:00:00:09": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.9", + "mac": "00:00:00:00:00:09", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-41", + }, + "00:00:00:00:00:10": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.10", + "mac": "00:00:00:00:00:10", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-44", + }, + "00:00:00:00:00:11": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.11", + "mac": "00:00:00:00:00:11", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-43", + }, + "00:00:00:00:00:12": { + "connection_type": 1, + "guest": 0, + "ip": "192.168.1.12", + "mac": "00:00:00:00:00:12", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-53", + }, + "00:00:00:00:00:13": { + "connection_type": 2, + "guest": 0, + "ip": "192.168.1.13", + "mac": "00:00:00:00:00:13", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-43", + }, + "00:00:00:00:00:14": { + "connection_type": 2, + "guest": 0, + "ip": "192.168.1.14", + "mac": "00:00:00:00:00:14", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-27", + }, + "00:00:00:00:00:15": { + "connection_type": 2, + "guest": 0, + "ip": "192.168.1.15", + "mac": "00:00:00:00:00:15", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": "-40", + }, + "00:00:00:00:00:16": { + "connection_type": 0, + "guest": 0, + "ip": "192.168.1.16", + "mac": "00:00:00:00:00:16", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": None, + }, + "00:00:00:00:00:17": { + "connection_type": 0, + "guest": 0, + "ip": "192.168.1.17", + "mac": "00:00:00:00:00:17", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": None, + }, + "00:00:00:00:00:18": { + "connection_type": 0, + "guest": 0, + "ip": "192.168.1.18", + "mac": "00:00:00:00:00:18", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": None, + }, + "00:00:00:00:00:19": { + "connection_type": 0, + "guest": 0, + "ip": "192.168.1.19", + "mac": "00:00:00:00:00:19", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": None, + }, + "00:00:00:00:00:20": { + "connection_type": 0, + "guest": 0, + "ip": "192.168.1.20", + "mac": "00:00:00:00:00:20", + "node": "00:00:00:00:00:00", + "online": True, + "rssi": None, + }, + }, +} diff --git a/tests/test_data/rt_ax88u_merlin_388/port_status_001.content b/tests/test_data/rt_ax88u_merlin_388/port_status_001.content new file mode 100644 index 0000000..88d7bf3 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/port_status_001.content @@ -0,0 +1 @@ +{ "node_info": { "7C:10:C9:03:6D:90": { "cd_good_to_go": "1" } }, "port_info": { "7C:10:C9:03:6D:90": { "W0": { "is_on": "1", "cap": "1073741825", "max_rate": "1000", "link_rate": "1000", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L1": { "is_on": "1", "cap": "2", "max_rate": "1000", "link_rate": "1000", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L2": { "is_on": "1", "cap": "2", "max_rate": "1000", "link_rate": "1000", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L3": { "is_on": "1", "cap": "2", "max_rate": "1000", "link_rate": "1000", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L4": { "is_on": "0", "cap": "2", "max_rate": "1000", "link_rate": "0", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L5": { "is_on": "0", "cap": "2", "max_rate": "1000", "link_rate": "0", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L6": { "is_on": "0", "cap": "2", "max_rate": "1000", "link_rate": "0", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L7": { "is_on": "0", "cap": "2", "max_rate": "1000", "link_rate": "0", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "L8": { "is_on": "1", "cap": "2", "max_rate": "1000", "link_rate": "1000", "brown": "0", "brown_len": "0", "blue": "0", "blue_len": "0", "green": "0", "green_len": "0", "orange": "0", "orange_len": "0", "linkrecover": "1", "timeout": "1" }, "U1": { "is_on": "0", "cap": "128", "max_rate": "5000", "link_rate": "0" }, "U2": { "is_on": "0", "cap": "128", "max_rate": "5000", "link_rate": "0" } } } } \ No newline at end of file diff --git a/tests/test_data/rt_ax88u_merlin_388/port_status_001.py b/tests/test_data/rt_ax88u_merlin_388/port_status_001.py new file mode 100644 index 0000000..d585cb6 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/port_status_001.py @@ -0,0 +1,162 @@ +"""Result of processing port_status_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.ports import PortType + +expected_result = { + AsusData.NODE_INFO: {"cd_good_to_go": "1"}, + AsusData.PORTS: { + PortType.LAN: { + 1: { + "cap": "2", + "max_rate": 1000, + "link_rate": 1000, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": True, + }, + 2: { + "cap": "2", + "max_rate": 1000, + "link_rate": 1000, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": True, + }, + 3: { + "cap": "2", + "max_rate": 1000, + "link_rate": 1000, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": True, + }, + 4: { + "cap": "2", + "max_rate": 1000, + "link_rate": 0, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": False, + }, + 5: { + "cap": "2", + "max_rate": 1000, + "link_rate": 0, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": False, + }, + 6: { + "cap": "2", + "max_rate": 1000, + "link_rate": 0, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": False, + }, + 7: { + "cap": "2", + "max_rate": 1000, + "link_rate": 0, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": False, + }, + 8: { + "cap": "2", + "max_rate": 1000, + "link_rate": 1000, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": True, + }, + }, + PortType.USB: { + 1: {"cap": "128", "max_rate": 5000, "link_rate": 0, "state": False}, + 2: {"cap": "128", "max_rate": 5000, "link_rate": 0, "state": False}, + }, + PortType.WAN: { + 0: { + "cap": "1073741825", + "max_rate": 1000, + "link_rate": 1000, + "brown": "0", + "brown_len": "0", + "blue": "0", + "blue_len": "0", + "green": "0", + "green_len": "0", + "orange": "0", + "orange_len": "0", + "linkrecover": "1", + "timeout": "1", + "state": True, + } + }, + }, +} diff --git a/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.content b/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.content new file mode 100644 index 0000000..77db475 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.content @@ -0,0 +1,10 @@ +wlc_0_arr = ["11", "11", "11"]; +wlc_1_arr = ["3", "3", "3"]; +wlc_2_arr = ["0", "0", "0"]; +wlc_3_arr = ["0", "0", "0"]; +conn_stats_arr = ["320","86"]; +mem_stats_arr = ["882.34", "240.57", "0.00", +"52.73", "0.00", "0.00", +"85328", "7.49 / 63.00 MB"]; +cpu_stats_arr = ["1.98", "2.04", "2.01"]; + diff --git a/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.py b/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.py new file mode 100644 index 0000000..be03f8b --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/sysinfo_001.py @@ -0,0 +1,44 @@ +"""Result of processing sysinfo_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.wlan import Wlan + +expected_result = { + AsusData.SYSINFO: { + "wlan": { + Wlan.FREQ_2G: { + "client_associated": 11, + "client_authorized": 11, + "client_authenticated": 11, + }, + Wlan.FREQ_5G: { + "client_associated": 3, + "client_authorized": 3, + "client_authenticated": 3, + }, + Wlan.FREQ_5G2: { + "client_associated": 0, + "client_authorized": 0, + "client_authenticated": 0, + }, + Wlan.FREQ_6G: { + "client_associated": 0, + "client_authorized": 0, + "client_authenticated": 0, + }, + }, + "connections": {"total": 320, "active": 86}, + "memory": { + "total": 882.34, + "free": 240.57, + "buffers": 0.0, + "cache": 52.73, + "swap_1": 0.0, + "swap_2": 0.0, + "nvram": 85328, + "jffs_used": 7.49, + "jffs_total": 63.0, + }, + "load_avg": {1: 1.98, 5: 2.04, 15: 2.01}, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/temperature_001.content b/tests/test_data/rt_ax88u_merlin_388/temperature_001.content new file mode 100644 index 0000000..4b70f3c --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/temperature_001.content @@ -0,0 +1,11 @@ +curr_coreTmp_wl0_raw = "44°C"; +curr_coreTmp_wl0 = (curr_coreTmp_wl0_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl0_raw.replace("°C", "")); +curr_coreTmp_wl1_raw = "44°C"; +curr_coreTmp_wl1 = (curr_coreTmp_wl1_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl1_raw.replace("°C", "")); +curr_coreTmp_wl2_raw = "disabled"; +curr_coreTmp_wl2 = (curr_coreTmp_wl2_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl2_raw.replace("°C", "")); +curr_coreTmp_wl3_raw = "disabled"; +curr_coreTmp_wl3 = (curr_coreTmp_wl3_raw.indexOf("disabled") > 0 ? 0 : curr_coreTmp_wl3_raw.replace("°C", "")); +curr_cpuTemp = "65.514"; +fanctrl_info = ""; + diff --git a/tests/test_data/rt_ax88u_merlin_388/temperature_001.py b/tests/test_data/rt_ax88u_merlin_388/temperature_001.py new file mode 100644 index 0000000..227f02e --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/temperature_001.py @@ -0,0 +1,12 @@ +"""Result of processing firmware_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.wlan import Wlan + +expected_result = { + AsusData.TEMPERATURE: { + Wlan.FREQ_2G: 44.0, + Wlan.FREQ_5G: 44.0, + "cpu": 65.514, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/update_clients_001.content b/tests/test_data/rt_ax88u_merlin_388/update_clients_001.content new file mode 100644 index 0000000..9f3d379 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/update_clients_001.content @@ -0,0 +1,8 @@ +originDataTmp = originData; +originData = { +fromNetworkmapd : [{ "00:00:00:00:00:01": { "type": "0", "defaultType": "0", "name": "Espressif Inc ", "nickName": "FakeNickName", "ip": "192.168.1.147", "mac": "00:00:00:00:00:01", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-43", "curTx": "54", "curRx": "11", "totalTx": "", "totalRx": "", "wlConnectTime": "141:25:19", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": 1, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:02": { "type": "30", "defaultType": "30", "name": "MSFT 5 0", "nickName": "FakeNickName", "ip": "192.168.1.22", "mac": "00:00:00:00:00:02", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "MSFT 5.0", "isWL": "2", "isGN": "", "isOnline": "0", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-25", "curTx": "2401.9", "curRx": "1225", "totalTx": "", "totalRx": "", "wlConnectTime": "00:00:33", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:03": { "type": "30", "defaultType": "30", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.10", "mac": "00:00:00:00:00:03", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "MSFT 5.0", "isWL": "0", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:04": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.112", "mac": "00:00:00:00:00:04", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-50", "curTx": "57.8", "curRx": "6", "totalTx": "", "totalRx": "", "wlConnectTime": "32:24:36", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:05": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.12", "mac": "00:00:00:00:00:05", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Microsoft Corporation", "isWL": "0", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:06": { "type": "6", "defaultType": "6", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.102", "mac": "00:00:00:00:00:06", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "AzureWave Technology Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-44", "curTx": "58.5", "curRx": "72.2", "totalTx": "", "totalRx": "", "wlConnectTime": "141:25:19", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:07": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.73", "mac": "00:00:00:00:00:07", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-34", "curTx": "72.2", "curRx": "6", "totalTx": "", "totalRx": "", "wlConnectTime": "08:25:35", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:08": { "type": "0", "defaultType": "0", "name": "Espressif Inc ", "nickName": "FakeNickName", "ip": "192.168.1.116", "mac": "00:00:00:00:00:08", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-26", "curTx": "65", "curRx": "54", "totalTx": "", "totalRx": "", "wlConnectTime": "32:24:41", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:09": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.146", "mac": "00:00:00:00:00:09", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-53", "curTx": "54", "curRx": "11", "totalTx": "", "totalRx": "", "wlConnectTime": "141:25:19", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:10": { "type": "30", "defaultType": "30", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.21", "mac": "00:00:00:00:00:10", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "MSFT 5.0", "isWL": "0", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "1", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:11": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.11", "mac": "00:00:00:00:00:11", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Microsoft Corporation", "isWL": "0", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:12": { "type": "0", "defaultType": "0", "name": "Espressif Inc ", "nickName": "FakeNickName", "ip": "192.168.1.113", "mac": "00:00:00:00:00:12", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-58", "curTx": "65", "curRx": "54", "totalTx": "", "totalRx": "", "wlConnectTime": "32:24:35", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:13": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.101", "mac": "00:00:00:00:00:13", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Seiko Epson Corporation", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-41", "curTx": "130", "curRx": "1", "totalTx": "", "totalRx": "", "wlConnectTime": "141:25:16", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:14": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.115", "mac": "00:00:00:00:00:14", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-41", "curTx": "54", "curRx": "54", "totalTx": "", "totalRx": "", "wlConnectTime": "116:41:53", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:15": { "type": "5", "defaultType": "4", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.15", "mac": "00:00:00:00:00:15", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Synology Incorporated", "isWL": "0", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:16": { "type": "10", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.25", "mac": "00:00:00:00:00:16", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "", "isWL": "2", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-40", "curTx": "2041.7", "curRx": "24", "totalTx": "", "totalRx": "", "wlConnectTime": "13:39:08", "ipMethod": "DHCP", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:17": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.114", "mac": "00:00:00:00:00:17", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-52", "curTx": "54", "curRx": "6", "totalTx": "", "totalRx": "", "wlConnectTime": "111:46:30", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:18": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.52", "mac": "00:00:00:00:00:18", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Apple, Inc.", "isWL": "2", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-43", "curTx": "1134.2", "curRx": "24", "totalTx": "", "totalRx": "", "wlConnectTime": "05:18:53", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:19": { "type": "31", "defaultType": "9", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.24", "mac": "00:00:00:00:00:19", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "android-dhcp-13", "isWL": "2", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-27", "curTx": "1134.2", "curRx": "6", "totalTx": "", "totalRx": "", "wlConnectTime": "08:27:14", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:20": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.111", "mac": "00:00:00:00:00:20", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Espressif Inc.", "isWL": "1", "isGN": "", "isOnline": "1", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-47", "curTx": "72.2", "curRx": "6", "totalTx": "", "totalRx": "", "wlConnectTime": "32:01:57", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "block", "internetState": 0, "amesh_isReClient": "1", "amesh_papMac": "00:00:00:00:00:00", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:29": { "type": "31", "defaultType": "9", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.51", "mac": "00:00:00:00:00:29", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "android-dhcp-10", "isWL": "2", "isGN": "", "isOnline": "0", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-46", "curTx": "780", "curRx": "975", "totalTx": "", "totalRx": "", "wlConnectTime": "24:22:53", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:58": { "type": "34", "defaultType": "7", "name": "FakeName", "nickName": "FakeNickName", "ip": "192.168.1.103", "mac": "00:00:00:00:00:58", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "MSFT 5.0 XBOX", "isWL": "0", "isGN": "", "isOnline": "0", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "0", "curTx": "", "curRx": "", "totalTx": "", "totalRx": "", "wlConnectTime": "", "ipMethod": "Manual", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:33": { "type": "0", "defaultType": "0", "name": "FakeName", "nickName": "", "ip": "192.168.1.131", "mac": "00:00:00:00:00:33", "from": "networkmapd", "macRepeat": "0", "isGateway": "0", "isWebServer": "0", "isPrinter": "0", "isITunes": "0", "dpiType": "", "dpiDevice": "", "vendor": "Samsung Electronics Co., Ltd.", "isWL": "1", "isGN": "", "isOnline": "0", "ssid": "", "isLogin": "0", "opMode": "0", "rssi": "-49", "curTx": "65", "curRx": "65", "totalTx": "", "totalRx": "", "wlConnectTime": "00:00:42", "ipMethod": "DHCP", "ROG": "0", "group": "", "callback": "", "keeparp": "", "qosLevel": "", "wtfast": "0", "internetMode": "allow", "internetState": "1", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "maclist": [ "00:00:00:00:00:01", "00:00:00:00:00:03", "00:00:00:00:00:04", "00:00:00:00:00:05", "00:00:00:00:00:06", "00:00:00:00:00:07", "00:00:00:00:00:08", "00:00:00:00:00:09", "00:00:00:00:00:10", "00:00:00:00:00:11", "00:00:00:00:00:12", "00:00:00:00:00:13", "00:00:00:00:00:14", "00:00:00:00:00:15", "00:00:00:00:00:16", "00:00:00:00:00:17", "00:00:00:00:00:18", "00:00:00:00:00:19", "00:00:00:00:00:20" ], "ClientAPILevel": "5" }], +nmpClient : [{ "00:00:00:00:00:10": { "mac": "00:00:00:00:00:10", "name": "FakeName", "vendor": "MSFT 5.0", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "0", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:17": { "mac": "00:00:00:00:00:17", "name": "FakeName", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:11": { "mac": "00:00:00:00:00:11", "name": "FakeName", "vendor": "Microsoft Corporation", "vendorclass": "Microsoft", "os_type": 2, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:21": { "mac": "00:00:00:00:00:21", "name": "FakeName", "vendor": "TP-LINK", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:05": { "mac": "00:00:00:00:00:05", "name": "FakeName", "vendor": "Microsoft Corporation", "vendorclass": "Microsoft", "os_type": 2, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:03": { "mac": "00:00:00:00:00:03", "name": "FakeName", "vendor": "MSFT 5.0", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:22": { "mac": "00:00:00:00:00:22", "name": "", "vendor": "", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:20": { "mac": "00:00:00:00:00:20", "name": "FakeName", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:23": { "mac": "00:00:00:00:00:23", "name": "FakeName", "vendor": "Asus", "vendorclass": "udhcp 1.25.1", "os_type": 0, "type": "24", "nickName": "FakeNickName", "defaultType": "2", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:19": { "mac": "00:00:00:00:00:19", "name": "FakeName", "vendor": "android-dhcp-13", "vendorclass": "android-dhcp-13", "os_type": 1, "type": "31", "nickName": "FakeNickName", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:24": { "mac": "00:00:00:00:00:24", "name": "FakeName", "vendor": "Amazon", "vendorclass": "dhcpcd-6.8.2:Linux-4.9.77+:armv", "os_type": 3, "type": "22", "nickName": "FakeNickName", "defaultType": "22", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:25": { "mac": "00:00:00:00:00:25", "name": "FakeName", "vendor": "Hangzhou BroadLink Technology Co., Ltd.", "vendorclass": "Hangzhou BroadLink Technology C", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:12": { "mac": "00:00:00:00:00:12", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:26": { "mac": "00:00:00:00:00:26", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:06": { "mac": "00:00:00:00:00:06", "name": "FakeName", "vendor": "AzureWave Technology Inc.", "vendorclass": "AzureWave Technology Inc.", "os_type": 5, "type": "0", "nickName": "FakeNickName", "defaultType": "6", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:08": { "mac": "00:00:00:00:00:08", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:13": { "mac": "00:00:00:00:00:13", "name": "FakeName", "vendor": "Seiko Epson Corporation", "vendorclass": "Seiko Epson Corporation", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:27": { "mac": "00:00:00:00:00:27", "name": "FakeName", "vendor": "Espressif Inc.", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:14": { "mac": "00:00:00:00:00:14", "name": "FakeName", "vendor": "Espressif Inc.", "type": "0", "vendorclass": "Espressif Inc.", "os_type": 0, "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:28": { "mac": "00:00:00:00:00:28", "name": "FakeName", "vendor": "Intel Corporate", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:04": { "mac": "00:00:00:00:00:04", "name": "FakeName", "vendor": "Espressif Inc.", "type": "0", "vendorclass": "Espressif Inc.", "os_type": 0, "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:29": { "mac": "00:00:00:00:00:29", "name": "FakeName", "vendor": "android-dhcp-10", "type": "31", "vendorclass": "android-dhcp-10", "os_type": 1, "nickName": "FakeNickName", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:30": { "mac": "00:00:00:00:00:30", "name": "FakeName", "vendor": "android-dhcp-10", "vendorclass": "android-dhcp-10", "os_type": 1, "type": "31", "nickName": "FakeNickName", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:18": { "mac": "00:00:00:00:00:18", "name": "FakeName", "vendor": "Apple, Inc.", "vendorclass": "Apple", "os_type": 5, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:31": { "mac": "00:00:00:00:00:31", "name": "FakeName", "vendor": "", "type": "30", "vendorclass": "MSFT 5.0", "os_type": 2, "nickName": "00:00:00:00:00:31", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:32": { "mac": "00:00:00:00:00:32", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:02": { "mac": "00:00:00:00:00:02", "name": "MSFT 5.0", "vendor": "MSFT 5.0", "type": "30", "vendorclass": "MSFT 5.0", "os_type": 2, "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:33": { "mac": "00:00:00:00:00:33", "name": "FakeName", "vendor": "Samsung Electronics Co., Ltd.", "vendorclass": "Samsung", "os_type": 0, "type": "0", "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:34": { "mac": "00:00:00:00:00:34", "name": "FakeName", "vendor": "Samsung Electronics Co., Ltd.", "vendorclass": "Samsung", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:35": { "mac": "00:00:00:00:00:35", "name": "Xiaomi Communications Co Ltd", "vendor": "Xiaomi Communications Co Ltd", "vendorclass": "android-dhcp-9", "os_type": 1, "type": "31", "nickName": "", "defaultType": "31", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:44": { "mac": "00:00:00:00:00:44", "name": "dhcpcd-5.5.6", "vendor": "dhcpcd-5.5.6", "vendorclass": "dhcpcd-5.5.6", "os_type": 3, "type": "0", "nickName": "FakeNickName", "defaultType": "22", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:36": { "mac": "00:00:00:00:00:36", "name": "FakeName", "vendor": "", "type": "0", "vendorclass": "android-dhcp-10", "os_type": 1, "nickName": "FakeNickName", "defaultType": "31", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:37": { "mac": "00:00:00:00:00:37", "name": "FakeName", "vendor": "", "vendorclass": "android-dhcp-12", "os_type": 1, "type": "31", "nickName": "", "defaultType": "31", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:38": { "mac": "00:00:00:00:00:38", "name": "", "vendor": "", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:39": { "mac": "00:00:00:00:00:39", "name": "Intel Corporate", "vendor": "Intel Corporate", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:40": { "mac": "00:00:00:00:00:40", "name": "FakeName", "vendor": "dhcpcd-6.6.6:Linux-3.0.35+:armv", "vendorclass": "dhcpcd-6.6.6:Linux-3.0.35+:armv", "os_type": 3, "type": "22", "nickName": "", "defaultType": "22", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:41": { "mac": "00:00:00:00:00:41", "name": "MSFT 5.0", "vendor": "MSFT 5.0", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:01": { "mac": "00:00:00:00:00:01", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:09": { "mac": "00:00:00:00:00:09", "name": "FakeName", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:42": { "mac": "00:00:00:00:00:42", "name": "Espressif Inc.", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 0, "type": "0", "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:43": { "mac": "00:00:00:00:00:43", "name": "FakeName", "vendor": "Microsoft", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:45": { "mac": "00:00:00:00:00:45", "name": "FakeName", "vendor": "", "vendorclass": "android-dhcp-11", "os_type": 1, "type": "31", "nickName": "", "defaultType": "31", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:46": { "mac": "00:00:00:00:00:46", "name": "FakeName", "vendor": "Samsung", "vendorclass": "", "os_type": 0, "type": "0", "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:47": { "mac": "00:00:00:00:00:47", "name": "FakeName", "vendor": "MSFT 5.0", "vendorclass": "MSFT 5.0", "os_type": 2, "type": "30", "nickName": "FakeNickName", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:48": { "mac": "00:00:00:00:00:48", "name": "FakeName", "vendor": "Samsung Group", "vendorclass": "android-dhcp-10", "os_type": 1, "type": "9", "nickName": "", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:49": { "mac": "00:00:00:00:00:49", "name": "FakeName", "vendor": "Espressif Inc.", "vendorclass": "Espressif Inc.", "os_type": 2, "type": "0", "nickName": "FakeNickName", "defaultType": "1", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:50": { "mac": "00:00:00:00:00:50", "name": "FakeName", "vendor": "Asus", "vendorclass": "Espressif Inc.", "type": "34", "os_type": 0, "nickName": "FakeNickName", "defaultType": "24", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:51": { "mac": "00:00:00:00:00:51", "name": "FakeName", "vendor": "android-dhcp-10", "vendorclass": "android-dhcp-10", "type": "9", "os_type": 1, "nickName": "FakeNickName", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:52": { "mac": "00:00:00:00:00:52", "name": "FakeName", "vendor": "android-dhcp-10", "vendorclass": "android-dhcp-10", "type": "9", "os_type": 1, "nickName": "", "defaultType": "9", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:53": { "mac": "00:00:00:00:00:53", "name": "FakeName", "vendor": "Raspberry Pi Foundation", "vendorclass": "Raspberry Pi Foundation", "type": "0", "os_type": 0, "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:54": { "mac": "00:00:00:00:00:54", "name": "FakeName", "vendor": "Raspberry Pi Foundation", "vendorclass": "Raspberry Pi Foundation", "type": "0", "os_type": 0, "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:15": { "mac": "00:00:00:00:00:15", "name": "FakeName", "vendor": "Synology Incorporated", "vendorclass": "Synology", "type": "5", "os_type": 0, "nickName": "FakeNickName", "defaultType": "4", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:55": { "mac": "00:00:00:00:00:55", "name": "FakeName", "vendor": "Synology Incorporated", "vendorclass": "Synology", "type": "4", "os_type": 0, "nickName": "FakeNickName", "defaultType": "4", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:56": { "mac": "00:00:00:00:00:56", "name": "", "vendor": "Microsoft Corp.", "vendorclass": "", "type": "34", "os_type": 0, "nickName": "", "defaultType": "34", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:57": { "mac": "00:00:00:00:00:57", "name": "MSFT 5.0", "vendor": "MSFT 5.0", "vendorclass": "MSFT 5.0", "type": "30", "os_type": 2, "sdn_idx": 0, "online": "0", "wireless": 2, "is_wireless": 2, "conn_ts": 1691951484, "nickName": "", "defaultType": "30", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:58": { "mac": "00:00:00:00:00:58", "name": "FakeName", "vendor": "MSFT 5.0 XBOX", "vendorclass": "MSFT 5.0 XBOX", "type": "34", "os_type": 2, "sdn_idx": 0, "online": "0", "wireless": 0, "is_wireless": 0, "conn_ts": 0, "nickName": "FakeNickName", "defaultType": "7", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:07": { "mac": "00:00:00:00:00:07", "name": "FakeName", "vendor": "", "vendorclass": "", "type": "0", "os_type": 0, "sdn_idx": 0, "online": "1", "wireless": 1, "is_wireless": 1, "conn_ts": 1700405333, "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:59": { "mac": "00:00:00:00:00:59", "name": "", "vendor": "Apple, Inc.", "vendorclass": "", "type": "0", "os_type": 5, "sdn_idx": 0, "online": "0", "wireless": 2, "is_wireless": 2, "conn_ts": 1698701168, "nickName": "00:00:00:00:00:59", "defaultType": "10", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:16": { "mac": "00:00:00:00:00:16", "name": "FakeName", "vendor": "", "vendorclass": "", "type": "10", "os_type": 0, "sdn_idx": 0, "online": "1", "wireless": 2, "is_wireless": 2, "conn_ts": 1700405333, "nickName": "FakeNickName", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "00:00:00:00:00:60": { "mac": "00:00:00:00:00:60", "name": "", "vendor": "", "vendorclass": "", "type": "0", "os_type": 0, "sdn_idx": 0, "online": "0", "wireless": 2, "is_wireless": 2, "conn_ts": 1699113854, "nickName": "", "defaultType": "0", "from": "nmpClient", "ROG": "0", "amesh_isRe": "0", "amesh_bind_mac": "", "amesh_bind_band": "0" }, "maclist": [ "00:00:00:00:00:10", "00:00:00:00:00:17", "00:00:00:00:00:11", "00:00:00:00:00:21", "00:00:00:00:00:05", "00:00:00:00:00:03", "00:00:00:00:00:22", "00:00:00:00:00:20", "00:00:00:00:00:23", "00:00:00:00:00:19", "00:00:00:00:00:24", "00:00:00:00:00:25", "00:00:00:00:00:12", "00:00:00:00:00:26", "00:00:00:00:00:06", "00:00:00:00:00:08", "00:00:00:00:00:13", "00:00:00:00:00:27", "00:00:00:00:00:14", "00:00:00:00:00:28", "00:00:00:00:00:04", "00:00:00:00:00:29", "00:00:00:00:00:30", "00:00:00:00:00:18", "00:00:00:00:00:31", "00:00:00:00:00:32", "00:00:00:00:00:02", "00:00:00:00:00:33", "00:00:00:00:00:34", "00:00:00:00:00:35", "00:00:00:00:00:44", "00:00:00:00:00:36", "00:00:00:00:00:37", "00:00:00:00:00:38", "00:00:00:00:00:39", "00:00:00:00:00:40", "00:00:00:00:00:41", "00:00:00:00:00:01", "00:00:00:00:00:09", "00:00:00:00:00:42", "00:00:00:00:00:43", "00:00:00:00:00:45", "00:00:00:00:00:46", "00:00:00:00:00:47", "00:00:00:00:00:48", "00:00:00:00:00:49", "00:00:00:00:00:50", "00:00:00:00:00:51", "00:00:00:00:00:52", "00:00:00:00:00:53", "00:00:00:00:00:54", "00:00:00:00:00:15", "00:00:00:00:00:55", "00:00:00:00:00:56", "00:00:00:00:00:57", "00:00:00:00:00:58", "00:00:00:00:00:07", "00:00:00:00:00:59", "00:00:00:00:00:16", "00:00:00:00:00:60" ], "ClientAPILevel": "5" }] +} +networkmap_fullscan = '2'; +if(networkmap_fullscan == 2) genClientList(); + diff --git a/tests/test_data/rt_ax88u_merlin_388/update_clients_001.py b/tests/test_data/rt_ax88u_merlin_388/update_clients_001.py new file mode 100644 index 0000000..ef6004b --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/update_clients_001.py @@ -0,0 +1,1560 @@ +"""Result of processing update_clients_001.content.""" + +from asusrouter import AsusData + +expected_result = { + AsusData.CLIENTS: { + "00:00:00:00:00:01": { + "type": "0", + "defaultType": "0", + "name": "Espressif Inc ", + "nickName": "FakeNickName", + "ip": "192.168.1.147", + "mac": "00:00:00:00:00:01", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-43", + "curTx": "54", + "curRx": "11", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "141:25:19", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": 1, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:02": { + "type": "30", + "defaultType": "30", + "name": "MSFT 5 0", + "nickName": "FakeNickName", + "ip": "192.168.1.22", + "mac": "00:00:00:00:00:02", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "MSFT 5.0", + "isWL": "2", + "isGN": None, + "isOnline": "0", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-25", + "curTx": "2401.9", + "curRx": "1225", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "00:00:33", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "amesh_isRe": "0", + }, + "00:00:00:00:00:03": { + "type": "30", + "defaultType": "30", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.10", + "mac": "00:00:00:00:00:03", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "MSFT 5.0", + "isWL": "0", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "amesh_isRe": "0", + }, + "00:00:00:00:00:04": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.112", + "mac": "00:00:00:00:00:04", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-50", + "curTx": "57.8", + "curRx": "6", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "32:24:36", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:05": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.12", + "mac": "00:00:00:00:00:05", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Microsoft Corporation", + "isWL": "0", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Microsoft", + "os_type": 2, + "amesh_isRe": "0", + }, + "00:00:00:00:00:06": { + "type": "6", + "defaultType": "6", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.102", + "mac": "00:00:00:00:00:06", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "AzureWave Technology Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-44", + "curTx": "58.5", + "curRx": "72.2", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "141:25:19", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "AzureWave Technology Inc.", + "os_type": 5, + "amesh_isRe": "0", + }, + "00:00:00:00:00:07": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.73", + "mac": "00:00:00:00:00:07", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": None, + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-34", + "curTx": "72.2", + "curRx": "6", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "08:25:35", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": None, + "os_type": 0, + "sdn_idx": 0, + "online": "1", + "wireless": 1, + "is_wireless": 1, + "conn_ts": 1700405333, + "amesh_isRe": "0", + }, + "00:00:00:00:00:08": { + "type": "0", + "defaultType": "0", + "name": "Espressif Inc ", + "nickName": "FakeNickName", + "ip": "192.168.1.116", + "mac": "00:00:00:00:00:08", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-26", + "curTx": "65", + "curRx": "54", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "32:24:41", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:09": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.146", + "mac": "00:00:00:00:00:09", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-53", + "curTx": "54", + "curRx": "11", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "141:25:19", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:10": { + "type": "30", + "defaultType": "30", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.21", + "mac": "00:00:00:00:00:10", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "MSFT 5.0", + "isWL": "0", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "1", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "amesh_isRe": "0", + }, + "00:00:00:00:00:11": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.11", + "mac": "00:00:00:00:00:11", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Microsoft Corporation", + "isWL": "0", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Microsoft", + "os_type": 2, + "amesh_isRe": "0", + }, + "00:00:00:00:00:12": { + "type": "0", + "defaultType": "0", + "name": "Espressif Inc ", + "nickName": "FakeNickName", + "ip": "192.168.1.113", + "mac": "00:00:00:00:00:12", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-58", + "curTx": "65", + "curRx": "54", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "32:24:35", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:13": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.101", + "mac": "00:00:00:00:00:13", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Seiko Epson Corporation", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-41", + "curTx": "130", + "curRx": "1", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "141:25:16", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Seiko Epson Corporation", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:14": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.115", + "mac": "00:00:00:00:00:14", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-41", + "curTx": "54", + "curRx": "54", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "116:41:53", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:15": { + "type": "5", + "defaultType": "4", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.15", + "mac": "00:00:00:00:00:15", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Synology Incorporated", + "isWL": "0", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Synology", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:16": { + "type": "10", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.25", + "mac": "00:00:00:00:00:16", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": None, + "isWL": "2", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-40", + "curTx": "2041.7", + "curRx": "24", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "13:39:08", + "ipMethod": "DHCP", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": None, + "os_type": 0, + "sdn_idx": 0, + "online": "1", + "wireless": 2, + "is_wireless": 2, + "conn_ts": 1700405333, + "amesh_isRe": "0", + }, + "00:00:00:00:00:17": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.114", + "mac": "00:00:00:00:00:17", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-52", + "curTx": "54", + "curRx": "6", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "111:46:30", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:18": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.52", + "mac": "00:00:00:00:00:18", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Apple, Inc.", + "isWL": "2", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-43", + "curTx": "1134.2", + "curRx": "24", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "05:18:53", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Apple", + "os_type": 5, + "amesh_isRe": "0", + }, + "00:00:00:00:00:19": { + "type": "31", + "defaultType": "9", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.24", + "mac": "00:00:00:00:00:19", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "android-dhcp-13", + "isWL": "2", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-27", + "curTx": "1134.2", + "curRx": "6", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "08:27:14", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "android-dhcp-13", + "os_type": 1, + "amesh_isRe": "0", + }, + "00:00:00:00:00:20": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.111", + "mac": "00:00:00:00:00:20", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Espressif Inc.", + "isWL": "1", + "isGN": None, + "isOnline": "1", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-47", + "curTx": "72.2", + "curRx": "6", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "32:01:57", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "block", + "internetState": 0, + "amesh_isReClient": "1", + "amesh_papMac": "00:00:00:00:00:00", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:29": { + "type": "31", + "defaultType": "9", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.51", + "mac": "00:00:00:00:00:29", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "android-dhcp-10", + "isWL": "2", + "isGN": None, + "isOnline": "0", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-46", + "curTx": "780", + "curRx": "975", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "24:22:53", + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "android-dhcp-10", + "os_type": 1, + "amesh_isRe": "0", + }, + "00:00:00:00:00:58": { + "type": "34", + "defaultType": "7", + "name": "FakeName", + "nickName": "FakeNickName", + "ip": "192.168.1.103", + "mac": "00:00:00:00:00:58", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "MSFT 5.0 XBOX", + "isWL": "0", + "isGN": None, + "isOnline": "0", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "0", + "curTx": None, + "curRx": None, + "totalTx": None, + "totalRx": None, + "wlConnectTime": None, + "ipMethod": "Manual", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "MSFT 5.0 XBOX", + "os_type": 2, + "sdn_idx": 0, + "online": "0", + "wireless": 0, + "is_wireless": 0, + "conn_ts": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:33": { + "type": "0", + "defaultType": "0", + "name": "FakeName", + "nickName": None, + "ip": "192.168.1.131", + "mac": "00:00:00:00:00:33", + "macRepeat": "0", + "isGateway": "0", + "isWebServer": "0", + "isPrinter": "0", + "isITunes": "0", + "dpiType": None, + "dpiDevice": None, + "vendor": "Samsung Electronics Co., Ltd.", + "isWL": "1", + "isGN": None, + "isOnline": "0", + "ssid": None, + "isLogin": "0", + "opMode": "0", + "rssi": "-49", + "curTx": "65", + "curRx": "65", + "totalTx": None, + "totalRx": None, + "wlConnectTime": "00:00:42", + "ipMethod": "DHCP", + "ROG": "0", + "group": None, + "callback": None, + "keeparp": None, + "qosLevel": None, + "wtfast": "0", + "internetMode": "allow", + "internetState": "1", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + "vendorclass": "Samsung", + "os_type": 0, + "amesh_isRe": "0", + }, + "00:00:00:00:00:21": { + "mac": "00:00:00:00:00:21", + "name": "FakeName", + "vendor": "TP-LINK", + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:22": { + "mac": "00:00:00:00:00:22", + "name": None, + "vendor": None, + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": None, + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:23": { + "mac": "00:00:00:00:00:23", + "name": "FakeName", + "vendor": "Asus", + "vendorclass": "udhcp 1.25.1", + "os_type": 0, + "type": "24", + "nickName": "FakeNickName", + "defaultType": "2", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:24": { + "mac": "00:00:00:00:00:24", + "name": "FakeName", + "vendor": "Amazon", + "vendorclass": "dhcpcd-6.8.2:Linux-4.9.77+:armv", + "os_type": 3, + "type": "22", + "nickName": "FakeNickName", + "defaultType": "22", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:25": { + "mac": "00:00:00:00:00:25", + "name": "FakeName", + "vendor": "Hangzhou BroadLink Technology Co., Ltd.", + "vendorclass": "Hangzhou BroadLink Technology C", + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:26": { + "mac": "00:00:00:00:00:26", + "name": "Espressif Inc.", + "vendor": "Espressif Inc.", + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:27": { + "mac": "00:00:00:00:00:27", + "name": "FakeName", + "vendor": "Espressif Inc.", + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:28": { + "mac": "00:00:00:00:00:28", + "name": "FakeName", + "vendor": "Intel Corporate", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "type": "30", + "nickName": "FakeNickName", + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:30": { + "mac": "00:00:00:00:00:30", + "name": "FakeName", + "vendor": "android-dhcp-10", + "vendorclass": "android-dhcp-10", + "os_type": 1, + "type": "31", + "nickName": "FakeNickName", + "defaultType": "9", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:31": { + "mac": "00:00:00:00:00:31", + "name": "FakeName", + "vendor": None, + "type": "30", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "nickName": "00:00:00:00:00:31", + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:32": { + "mac": "00:00:00:00:00:32", + "name": "Espressif Inc.", + "vendor": "Espressif Inc.", + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:34": { + "mac": "00:00:00:00:00:34", + "name": "FakeName", + "vendor": "Samsung Electronics Co., Ltd.", + "vendorclass": "Samsung", + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:35": { + "mac": "00:00:00:00:00:35", + "name": "Xiaomi Communications Co Ltd", + "vendor": "Xiaomi Communications Co Ltd", + "vendorclass": "android-dhcp-9", + "os_type": 1, + "type": "31", + "nickName": None, + "defaultType": "31", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:44": { + "mac": "00:00:00:00:00:44", + "name": "dhcpcd-5.5.6", + "vendor": "dhcpcd-5.5.6", + "vendorclass": "dhcpcd-5.5.6", + "os_type": 3, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "22", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:36": { + "mac": "00:00:00:00:00:36", + "name": "FakeName", + "vendor": None, + "type": "0", + "vendorclass": "android-dhcp-10", + "os_type": 1, + "nickName": "FakeNickName", + "defaultType": "31", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:37": { + "mac": "00:00:00:00:00:37", + "name": "FakeName", + "vendor": None, + "vendorclass": "android-dhcp-12", + "os_type": 1, + "type": "31", + "nickName": None, + "defaultType": "31", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:38": { + "mac": "00:00:00:00:00:38", + "name": None, + "vendor": None, + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": None, + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:39": { + "mac": "00:00:00:00:00:39", + "name": "Intel Corporate", + "vendor": "Intel Corporate", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "type": "30", + "nickName": "FakeNickName", + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:40": { + "mac": "00:00:00:00:00:40", + "name": "FakeName", + "vendor": "dhcpcd-6.6.6:Linux-3.0.35+:armv", + "vendorclass": "dhcpcd-6.6.6:Linux-3.0.35+:armv", + "os_type": 3, + "type": "22", + "nickName": None, + "defaultType": "22", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:41": { + "mac": "00:00:00:00:00:41", + "name": "MSFT 5.0", + "vendor": "MSFT 5.0", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "type": "30", + "nickName": "FakeNickName", + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:42": { + "mac": "00:00:00:00:00:42", + "name": "Espressif Inc.", + "vendor": "Espressif Inc.", + "vendorclass": "Espressif Inc.", + "os_type": 0, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:43": { + "mac": "00:00:00:00:00:43", + "name": "FakeName", + "vendor": "Microsoft", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "type": "30", + "nickName": None, + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:45": { + "mac": "00:00:00:00:00:45", + "name": "FakeName", + "vendor": None, + "vendorclass": "android-dhcp-11", + "os_type": 1, + "type": "31", + "nickName": None, + "defaultType": "31", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:46": { + "mac": "00:00:00:00:00:46", + "name": "FakeName", + "vendor": "Samsung", + "vendorclass": None, + "os_type": 0, + "type": "0", + "nickName": None, + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:47": { + "mac": "00:00:00:00:00:47", + "name": "FakeName", + "vendor": "MSFT 5.0", + "vendorclass": "MSFT 5.0", + "os_type": 2, + "type": "30", + "nickName": "FakeNickName", + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:48": { + "mac": "00:00:00:00:00:48", + "name": "FakeName", + "vendor": "Samsung Group", + "vendorclass": "android-dhcp-10", + "os_type": 1, + "type": "9", + "nickName": None, + "defaultType": "9", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:49": { + "mac": "00:00:00:00:00:49", + "name": "FakeName", + "vendor": "Espressif Inc.", + "vendorclass": "Espressif Inc.", + "os_type": 2, + "type": "0", + "nickName": "FakeNickName", + "defaultType": "1", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:50": { + "mac": "00:00:00:00:00:50", + "name": "FakeName", + "vendor": "Asus", + "vendorclass": "Espressif Inc.", + "type": "34", + "os_type": 0, + "nickName": "FakeNickName", + "defaultType": "24", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:51": { + "mac": "00:00:00:00:00:51", + "name": "FakeName", + "vendor": "android-dhcp-10", + "vendorclass": "android-dhcp-10", + "type": "9", + "os_type": 1, + "nickName": "FakeNickName", + "defaultType": "9", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:52": { + "mac": "00:00:00:00:00:52", + "name": "FakeName", + "vendor": "android-dhcp-10", + "vendorclass": "android-dhcp-10", + "type": "9", + "os_type": 1, + "nickName": None, + "defaultType": "9", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:53": { + "mac": "00:00:00:00:00:53", + "name": "FakeName", + "vendor": "Raspberry Pi Foundation", + "vendorclass": "Raspberry Pi Foundation", + "type": "0", + "os_type": 0, + "nickName": None, + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:54": { + "mac": "00:00:00:00:00:54", + "name": "FakeName", + "vendor": "Raspberry Pi Foundation", + "vendorclass": "Raspberry Pi Foundation", + "type": "0", + "os_type": 0, + "nickName": "FakeNickName", + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:55": { + "mac": "00:00:00:00:00:55", + "name": "FakeName", + "vendor": "Synology Incorporated", + "vendorclass": "Synology", + "type": "4", + "os_type": 0, + "nickName": "FakeNickName", + "defaultType": "4", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:56": { + "mac": "00:00:00:00:00:56", + "name": None, + "vendor": "Microsoft Corp.", + "vendorclass": None, + "type": "34", + "os_type": 0, + "nickName": None, + "defaultType": "34", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:57": { + "mac": "00:00:00:00:00:57", + "name": "MSFT 5.0", + "vendor": "MSFT 5.0", + "vendorclass": "MSFT 5.0", + "type": "30", + "os_type": 2, + "sdn_idx": 0, + "online": "0", + "wireless": 2, + "is_wireless": 2, + "conn_ts": 1691951484, + "nickName": None, + "defaultType": "30", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:59": { + "mac": "00:00:00:00:00:59", + "name": None, + "vendor": "Apple, Inc.", + "vendorclass": None, + "type": "0", + "os_type": 5, + "sdn_idx": 0, + "online": "0", + "wireless": 2, + "is_wireless": 2, + "conn_ts": 1698701168, + "nickName": "00:00:00:00:00:59", + "defaultType": "10", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + "00:00:00:00:00:60": { + "mac": "00:00:00:00:00:60", + "name": None, + "vendor": None, + "vendorclass": None, + "type": "0", + "os_type": 0, + "sdn_idx": 0, + "online": "0", + "wireless": 2, + "is_wireless": 2, + "conn_ts": 1699113854, + "nickName": None, + "defaultType": "0", + "ROG": "0", + "amesh_isRe": "0", + "amesh_bind_mac": None, + "amesh_bind_band": "0", + }, + } +} diff --git a/tests/test_data/rt_ax88u_merlin_388/vpn_001.content b/tests/test_data/rt_ax88u_merlin_388/vpn_001.content new file mode 100644 index 0000000..d5c6186 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/vpn_001.content @@ -0,0 +1,21 @@ +vpn_server1_status = "TITLE,OpenVPN 2.6.5 arm-buildroot-linux-gnueabi [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]>TIME,2023-11-19 15:51:05,1700405465>HEADER,CLIENT_LIST,Common Name,Real Address,Virtual Address,Virtual IPv6 Address,Bytes Received,Bytes Sent,Connected Since,Connected Since (time_t),Username,Client ID,Peer ID,Data Channel Cipher>HEADER,ROUTING_TABLE,Virtual Address,Common Name,Real Address,Last Ref,Last Ref (time_t)>GLOBAL_STATS,Max bcast/mcast queue length,0>GLOBAL_STATS,dco_enabled,0>END>"; +vpn_server2_status = "None"; +vpn_client1_status = "None"; +vpn_client2_status = "None"; +vpn_client3_status = "None"; +vpn_client4_status = "None"; +vpn_client5_status = "None"; +server1pid = "2663"; +server2pid = "-1"; +pptpdpid = "-1"; +vpn_client1_ip = "0.0.0.0"; +vpn_client2_ip = "0.0.0.0"; +vpn_client3_ip = "0.0.0.0"; +vpn_client4_ip = "0.0.0.0"; +vpn_client5_ip = "0.0.0.0"; +vpn_client1_rip = ""; +vpn_client2_rip = ""; +vpn_client3_rip = ""; +vpn_client4_rip = ""; +vpn_client5_rip = ""; + diff --git a/tests/test_data/rt_ax88u_merlin_388/vpn_001.py b/tests/test_data/rt_ax88u_merlin_388/vpn_001.py new file mode 100644 index 0000000..620c691 --- /dev/null +++ b/tests/test_data/rt_ax88u_merlin_388/vpn_001.py @@ -0,0 +1,18 @@ +"""Result of processing vpn_001.content.""" + +from asusrouter import AsusData +from asusrouter.modules.openvpn import AsusOVPNClient, AsusOVPNServer + +expected_result = { + AsusData.OPENVPN_CLIENT: { + 1: {"state": AsusOVPNClient.DISCONNECTED}, + 2: {"state": AsusOVPNClient.DISCONNECTED}, + 3: {"state": AsusOVPNClient.DISCONNECTED}, + 4: {"state": AsusOVPNClient.DISCONNECTED}, + 5: {"state": AsusOVPNClient.DISCONNECTED}, + }, + AsusData.OPENVPN_SERVER: { + 1: {"client_list": [], "routing_table": [], "state": AsusOVPNServer.CONNECTED}, + 2: {"state": AsusOVPNServer.DISCONNECTED}, + }, +} diff --git a/tests/test_devices.py b/tests/test_devices.py new file mode 100644 index 0000000..0766434 --- /dev/null +++ b/tests/test_devices.py @@ -0,0 +1,151 @@ +"""Test AsusRouter with real devices data.""" + +import importlib +import logging +import os +import re +from contextlib import contextmanager +from dataclasses import dataclass +from enum import Enum +from pathlib import Path +from typing import Any, Dict, Optional + +import pytest + +from asusrouter import AsusData +from asusrouter.modules.endpoint import Endpoint, process, read + +# Create a logger +_LOGGER = logging.getLogger(__name__) +_LOGGER.setLevel(logging.INFO) + + +class FileExtensions(Enum): + CONTENT = ".content" + PYTHON = ".py" + + +@dataclass +class DataItem: + """A class used to represent a test item.""" + + content: str + result: Dict[AsusData, Any] + endpoint: Endpoint + label: str + + def __repr__(self): + return self.label + + +@contextmanager +def log_test_data_loading(): + """Log the start and end of loading test data.""" + + _LOGGER.info("Starting to load test data") + yield + _LOGGER.info("Finished loading test data") + + +def load_content_data(device_path: Path, module_name: str) -> str: + """Load content data from a file.""" + + content_file = device_path / f"{module_name}{FileExtensions.CONTENT.value}" + with content_file.open("r", encoding="utf-8") as f: + return f.read() + + +def load_expected_result(device_path: Path, module_name: str) -> Any: + """Load expected result from a module.""" + + result_module = importlib.import_module( + f".test_data.{'.'.join([device_path.name, module_name])}", + package="tests", + ) + return result_module.expected_result + + +def load_test_item(device_path: Path, module_name: str) -> Optional[DataItem]: + """Load a single test item.""" + + try: + endpoint_name = re.match(r"(.*)_\d+", module_name).group(1) + endpoint = Endpoint[endpoint_name.upper()] + + content_data = load_content_data(device_path, module_name) + expected_result = load_expected_result(device_path, module_name) + + return DataItem( + content=content_data, + result=expected_result, + endpoint=endpoint, + label=f"{device_path.name}_{module_name}", + ) + except Exception as ex: # pylint: disable=broad-except + _LOGGER.error("Failed to load test item %s: %s", module_name, ex) + return None + + +def load_test_data() -> list[DataItem]: + """Load the test data.""" + + with log_test_data_loading(): + test_data_path = Path(__file__).resolve().parent / "test_data" + data = [] + + for device_path in test_data_path.iterdir(): + if device_path.is_dir(): + device_test_count = 0 + for content_file in device_path.glob("*.content"): + module_name = content_file.stem + + # Check if both .content and .py files exist + if ( + not (device_path / f"{module_name}.content").exists() + or not (device_path / f"{module_name}.py").exists() + ): + continue + + item = load_test_item(device_path, module_name) + data.append(item) + device_test_count += 1 + + _LOGGER.info( + "Found %s test items for device: %s", + device_test_count, + device_path.name, + ) + + _LOGGER.info("Total test items found: %s", len(data)) + return data + + +# Load the test data only once +test_data = load_test_data() + +# Create a list of ids for the test data +test_ids = [item.label for item in test_data] + + +@pytest.fixture(params=test_data, ids=test_ids) +def test_item(request): + """Yield each item in the test data.""" + + return request.param + + +def test_asusrouter(test_item: DataItem): # pylint: disable=redefined-outer-name + """ + Test the asusrouter module with the given test item. + + Args: + test_item (DataItem): The test item to use for the test. + + Raises: + AssertionError: If the actual processed data does not match the expected result. + """ + + actual_read = read(test_item.endpoint, test_item.content) + actual_processed = process(test_item.endpoint, actual_read) + + assert actual_processed == test_item.result, print(actual_processed)