-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RT-AX88U / Merlin test data (#378)
- Loading branch information
1 parent
89bb161
commit 5854af0
Showing
40 changed files
with
3,031 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
files: unit-tests-cov.xml,real-data-tests-cov.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Test data for AsusRouter.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Test data for RT-AX88U / Merlin 388.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" ?> | ||
<devicemap> <wan>2</wan> | ||
<wan>0</wan> | ||
<wan>0</wan> | ||
|
||
<wan>monoClient=</wan> | ||
<wan>wlc_state=0</wan> | ||
<wan>wlc_sbstate=0</wan> | ||
<wan>psta:wlc_state=0;wlc_state_auth=0;</wan> | ||
<wan>wifi_hw_switch=1</wan> | ||
<wan>ddnsRet=</wan> | ||
<wan>ddnsUpdate=</wan> | ||
<wan>wan_line_state=</wan> | ||
<wan>wlan0_radio_flag=1</wan> | ||
<wan>wlan1_radio_flag=1</wan> | ||
<wan>wlan2_radio_flag=</wan> | ||
<wan>data_rate_info_2g="72 Mbps"</wan> | ||
<wan>data_rate_info_5g="1921.5 Mbps"</wan> | ||
<wan>data_rate_info_5g_2="0 Mbps"</wan> | ||
<wan>wan_diag_state=</wan> | ||
<wan>active_wan_unit=0</wan> | ||
<wan>wan0_enable=1</wan> | ||
<wan>wan1_enable=1</wan> | ||
<wan>wan0_realip_state=2</wan> | ||
<wan>wan1_realip_state=0</wan> | ||
<wan>wan0_ipaddr=111.222.111.222</wan> | ||
<wan>wan1_ipaddr=0.0.0.0</wan> | ||
<wan>wan0_realip_ip=111.222.111.222</wan> | ||
<wan>wan1_realip_ip=</wan> | ||
<vpn>vpnc_proto=disable</vpn> | ||
<vpn>vpnc_state_t=0</vpn> | ||
<vpn>vpnc_sbstate_t=0</vpn> | ||
<vpn>vpn_client1_state=0</vpn> | ||
<vpn>vpn_client2_state=</vpn> | ||
<vpn>vpn_client3_state=0</vpn> | ||
<vpn>vpn_client4_state=-1</vpn> | ||
<vpn>vpn_client5_state=</vpn> | ||
<vpn>vpnd_state=0</vpn> | ||
<vpn>vpn_client1_errno=0</vpn> | ||
<vpn>vpn_client2_errno=</vpn> | ||
<vpn>vpn_client3_errno=0</vpn> | ||
<vpn>vpn_client4_errno=8</vpn> | ||
<vpn>vpn_client5_errno=</vpn> | ||
<vpn>vpn_server1_state=2</vpn> | ||
<vpn>vpn_server2_state=</vpn> | ||
<sys>uptimeStr=Sun, 19 Nov 2023 15:51:06 +0100(509356 secs since boot)</sys> | ||
<qtn>qtn_state=</qtn> | ||
<usb>'[]'</usb> | ||
<usb>modem_enable=1</usb> | ||
<first_wan>2</first_wan> | ||
<first_wan>0</first_wan> | ||
<first_wan>0</first_wan> | ||
<second_wan>0</second_wan> | ||
<second_wan>0</second_wan> | ||
<second_wan>0</second_wan> | ||
|
||
<sim>sim_state=</sim> | ||
<sim>sim_signal=</sim> | ||
<sim>sim_operation=</sim> | ||
<sim>sim_isp=</sim> | ||
<sim>roaming=0</sim> | ||
<sim>roaming_imsi=</sim> | ||
<sim>sim_imsi=</sim> | ||
<sim>g3err_pin=</sim> | ||
<sim>pin_remaining_count=</sim> | ||
<sim>modem_act_provider=</sim> | ||
<sim>rx_bytes=</sim> | ||
<sim>tx_bytes=</sim> | ||
<sim>modem_sim_order=</sim> | ||
<dhcp>dnsqmode=</dhcp> | ||
<wan>wlc0_state=</wan> | ||
<wan>wlc1_state=</wan> | ||
<wan>rssi_2g=</wan> | ||
<wan>rssi_5g=</wan> | ||
<wan>rssi_5g_2=</wan> | ||
<wan>link_internet=2</wan> | ||
<diag>diag_dblog_enable=0</diag> | ||
<diag>diag_dblog_remaining=0</diag> | ||
<wan>wlc2_state=</wan> | ||
<wan>le_restart_httpd=</wan> | ||
<wanbonding>wan_bonding_speed="0"</wanbonding> | ||
<wanbonding>wan_bonding_p1_status="0"</wanbonding> | ||
<wanbonding>wan_bonding_p2_status="2"</wanbonding> | ||
<wanbonding>lacp_wan=0</wanbonding> | ||
</devicemap> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: {}, | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/test_data/rt_ax88u_merlin_388/ethernet_ports_001.content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
Oops, something went wrong.