wiliot-certificate 4.4.2__py3-none-any.whl → 4.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
- {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
- certificate/cert_common.py +1488 -0
- certificate/cert_config.py +480 -0
- {brg_certificate → certificate}/cert_data_sim.py +134 -46
- {brg_certificate → certificate}/cert_defines.py +129 -128
- {brg_certificate → certificate}/cert_gw_sim.py +183 -53
- {brg_certificate → certificate}/cert_mqtt.py +179 -64
- {brg_certificate → certificate}/cert_prints.py +35 -33
- {brg_certificate → certificate}/cert_protobuf.py +15 -6
- {brg_certificate → certificate}/cert_results.py +240 -64
- certificate/cert_utils.py +634 -0
- certificate/certificate.py +205 -0
- certificate/certificate_cli.py +76 -0
- certificate/certificate_eth_test_list.txt +76 -0
- certificate/certificate_sanity_test_list.txt +66 -0
- certificate/certificate_test_list.txt +76 -0
- {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +3 -2
- {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
- certificate/tests/calibration/output_power_test/output_power_test.json +23 -0
- certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
- {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +2 -1
- {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
- certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +15 -0
- certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
- certificate/tests/cloud_connectivity/acl_test/acl_test.json +15 -0
- certificate/tests/cloud_connectivity/acl_test/acl_test.py +96 -0
- certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +19 -0
- certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +41 -0
- certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +19 -0
- certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
- certificate/tests/cloud_connectivity/connection_test/connection_test.json +18 -0
- certificate/tests/cloud_connectivity/connection_test/connection_test.py +67 -0
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +15 -0
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +80 -0
- certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +21 -0
- certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +201 -0
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +17 -0
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +104 -0
- certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +18 -0
- certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +59 -0
- certificate/tests/cloud_connectivity/registration_test/registration_test.json +20 -0
- certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
- certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
- certificate/tests/cloud_connectivity/stress_test/stress_test.json +17 -0
- certificate/tests/cloud_connectivity/stress_test/stress_test.py +101 -0
- certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +25 -0
- certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +92 -0
- certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +20 -0
- certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +169 -0
- {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +2 -1
- certificate/tests/datapath/aging_test/aging_test.py +142 -0
- certificate/tests/datapath/event_ble5_test/event_ble5_test.json +17 -0
- certificate/tests/datapath/event_ble5_test/event_ble5_test.py +89 -0
- certificate/tests/datapath/event_test/event_test.json +17 -0
- certificate/tests/datapath/event_test/event_test.py +80 -0
- {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +4 -3
- {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +19 -13
- certificate/tests/datapath/output_power_test/output_power_test.json +23 -0
- {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
- {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +2 -1
- {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -11
- {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -1
- {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
- {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +3 -2
- {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
- certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +20 -0
- certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
- {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +2 -1
- {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +15 -14
- certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +19 -0
- certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +85 -0
- {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -1
- {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
- {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -1
- {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
- {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -2
- {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
- brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +6 -4
- certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
- {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +3 -2
- {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
- {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +8 -7
- {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +113 -73
- {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +8 -7
- {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
- {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +4 -3
- {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +15 -11
- {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +4 -3
- {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +15 -11
- {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +3 -1
- {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
- certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +15 -0
- certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
- certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +15 -0
- certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
- certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +15 -0
- certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
- certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +15 -0
- certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
- certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +16 -0
- certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
- certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +15 -0
- certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
- certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +15 -0
- certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
- certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +15 -0
- certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +45 -0
- {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +3 -2
- {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
- {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +2 -1
- {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
- certificate/tests/energy2400/output_power_test/output_power_test.json +23 -0
- {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
- {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +2 -1
- {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
- certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +26 -0
- certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +379 -0
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +20 -0
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +173 -0
- certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +24 -0
- certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
- {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -1
- {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
- {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +2 -1
- {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
- {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +2 -1
- {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
- {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +5 -4
- certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +450 -0
- certificate/wlt_types.py +122 -0
- {gw_certificate → common}/api_if/202/status.json +6 -0
- {gw_certificate → common}/api_if/203/status.json +6 -0
- {gw_certificate → common}/api_if/204/status.json +6 -0
- common/api_if/206/data.json +85 -0
- common/api_if/206/status.json +69 -0
- common/api_if/api_validation.py +91 -0
- common/web/templates/generator.html +210 -0
- common/web/templates/index.html +20 -0
- common/web/templates/menu.html +54 -0
- common/web/templates/parser.html +53 -0
- {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
- common/web/web_utils.py +399 -0
- {brg_certificate → common}/wltPb_pb2.py +14 -12
- {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
- gui_certificate/gui_certificate_cli.py +14 -0
- gui_certificate/server.py +1267 -0
- gui_certificate/templates/cert_run.html +1273 -0
- wiliot_certificate-4.5.0.dist-info/METADATA +99 -0
- wiliot_certificate-4.5.0.dist-info/RECORD +168 -0
- {wiliot_certificate-4.4.2.dist-info → wiliot_certificate-4.5.0.dist-info}/WHEEL +1 -1
- wiliot_certificate-4.5.0.dist-info/entry_points.txt +5 -0
- wiliot_certificate-4.5.0.dist-info/top_level.txt +3 -0
- brg_certificate/ag/energous_v0_defines.py +0 -925
- brg_certificate/ag/energous_v1_defines.py +0 -931
- brg_certificate/ag/energous_v2_defines.py +0 -925
- brg_certificate/ag/energous_v3_defines.py +0 -925
- brg_certificate/ag/energous_v4_defines.py +0 -925
- brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
- brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
- brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
- brg_certificate/ag/minew_lte_v0_defines.py +0 -925
- brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -142
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -785
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -139
- brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -394
- brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -515
- brg_certificate/ag/wlt_types_ag_jsons/datapath.json +0 -672
- brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -550
- brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -595
- brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -598
- brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -938
- brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1234
- brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
- brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
- brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
- brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -110
- brg_certificate/brg_certificate.py +0 -225
- brg_certificate/brg_certificate_cli.py +0 -63
- brg_certificate/cert_common.py +0 -923
- brg_certificate/cert_config.py +0 -402
- brg_certificate/cert_utils.py +0 -362
- brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
- brg_certificate/certificate_bcc_test_list.txt +0 -48
- brg_certificate/certificate_sanity_test_list.txt +0 -43
- brg_certificate/certificate_test_list.txt +0 -53
- brg_certificate/config/eclipse.json +0 -10
- brg_certificate/config/hivemq.json +0 -10
- brg_certificate/config/mosquitto.json +0 -10
- brg_certificate/config/mosquitto.md +0 -95
- brg_certificate/config/wiliot-dev.json +0 -10
- brg_certificate/restore_brg.py +0 -61
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
- brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
- brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +0 -20
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +0 -321
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
- brg_certificate/wltPb_pb2.pyi +0 -234
- brg_certificate/wlt_types.py +0 -113
- gw_certificate/ag/ut_defines.py +0 -364
- gw_certificate/ag/wlt_types.py +0 -85
- gw_certificate/ag/wlt_types_ag.py +0 -5310
- gw_certificate/ag/wlt_types_data.py +0 -64
- gw_certificate/api/extended_api.py +0 -23
- gw_certificate/api_if/200/data.json +0 -106
- gw_certificate/api_if/200/status.json +0 -47
- gw_certificate/api_if/201/data.json +0 -98
- gw_certificate/api_if/201/status.json +0 -53
- gw_certificate/api_if/205/logs.json +0 -12
- gw_certificate/api_if/api_validation.py +0 -38
- gw_certificate/api_if/gw_capabilities.py +0 -54
- gw_certificate/cert_results.py +0 -145
- gw_certificate/common/analysis_data_bricks.py +0 -60
- gw_certificate/common/debug.py +0 -42
- gw_certificate/common/serialization_formatter.py +0 -93
- gw_certificate/common/utils.py +0 -8
- gw_certificate/common/utils_defines.py +0 -15
- gw_certificate/common/wltPb_pb2.py +0 -84
- gw_certificate/gw_certificate.py +0 -154
- gw_certificate/gw_certificate_cli.py +0 -87
- gw_certificate/interface/4.4.91_app.zip +0 -0
- gw_certificate/interface/4.4.91_sd_bl_app.zip +0 -0
- gw_certificate/interface/ble_simulator.py +0 -61
- gw_certificate/interface/ble_sniffer.py +0 -189
- gw_certificate/interface/flash_fw.py +0 -90
- gw_certificate/interface/if_defines.py +0 -36
- gw_certificate/interface/mqtt.py +0 -563
- gw_certificate/interface/nrfutil-linux +0 -0
- gw_certificate/interface/nrfutil-mac +0 -0
- gw_certificate/interface/nrfutil.exe +0 -0
- gw_certificate/interface/pkt_generator.py +0 -594
- gw_certificate/interface/uart_if.py +0 -236
- gw_certificate/interface/uart_ports.py +0 -20
- gw_certificate/templates/results.html +0 -241
- gw_certificate/templates/stage.html +0 -22
- gw_certificate/templates/table.html +0 -6
- gw_certificate/templates/test.html +0 -38
- gw_certificate/tests/__init__.py +0 -10
- gw_certificate/tests/actions.py +0 -289
- gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
- gw_certificate/tests/connection.py +0 -188
- gw_certificate/tests/downlink.py +0 -172
- gw_certificate/tests/generic.py +0 -238
- gw_certificate/tests/registration.py +0 -340
- gw_certificate/tests/static/__init__.py +0 -0
- gw_certificate/tests/static/connection_defines.py +0 -9
- gw_certificate/tests/static/downlink_defines.py +0 -9
- gw_certificate/tests/static/generated_packet_table.py +0 -195
- gw_certificate/tests/static/packet_table.csv +0 -10067
- gw_certificate/tests/static/references.py +0 -5
- gw_certificate/tests/static/uplink_defines.py +0 -14
- gw_certificate/tests/throughput.py +0 -240
- gw_certificate/tests/uplink.py +0 -853
- wiliot_certificate-4.4.2.dist-info/METADATA +0 -211
- wiliot_certificate-4.4.2.dist-info/RECORD +0 -210
- wiliot_certificate-4.4.2.dist-info/entry_points.txt +0 -3
- wiliot_certificate-4.4.2.dist-info/top_level.txt +0 -3
- {brg_certificate → certificate}/__init__.py +0 -0
- {gw_certificate → common}/api_if/202/data.json +0 -0
- {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
- {gw_certificate → common}/api_if/203/data.json +0 -0
- {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
- {gw_certificate → common}/api_if/204/data.json +0 -0
- {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
- {gw_certificate → common}/api_if/205/data.json +0 -0
- {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
- {gw_certificate → common}/api_if/205/status.json +0 -0
- {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
- {gw_certificate → common/api_if}/__init__.py +0 -0
- {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
- {wiliot_certificate-4.4.2.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
from certificate.cert_defines import *
|
|
2
|
+
from certificate.cert_prints import *
|
|
3
|
+
from certificate.wlt_types import *
|
|
4
|
+
import certificate.cert_common as cert_common
|
|
5
|
+
import certificate.cert_protobuf as cert_protobuf
|
|
6
|
+
import certificate.cert_mqtt as cert_mqtt
|
|
7
|
+
import datetime, string, json, random, inspect
|
|
8
|
+
|
|
9
|
+
BLE5_MAX_RETRIES = BLE5_MAX_DURATION_MS//20
|
|
10
|
+
|
|
11
|
+
#################################
|
|
12
|
+
# GW
|
|
13
|
+
#################################
|
|
14
|
+
|
|
15
|
+
def is_gw(obj):
|
|
16
|
+
return hasattr(obj, 'mqttc') and hasattr(obj, 'id_str')
|
|
17
|
+
|
|
18
|
+
def get_protobuf_by_target(test, target):
|
|
19
|
+
return test.dut.protobuf if is_gw(test.dut) and target == DUT else test.tester.protobuf
|
|
20
|
+
|
|
21
|
+
def gw_configure(test, cfg={}, version="", extended_cfg={}, ret_pkt=False, wait=False, serialization_change=False, target=DUT):
|
|
22
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
23
|
+
cfg = cfg if cfg else get_default_gw_dict(test, target=target)
|
|
24
|
+
gw_config = create_gw_config(test, cfg, target=target, version=version)
|
|
25
|
+
gw_config[GW_CONF][ADDITIONAL].update(extended_cfg)
|
|
26
|
+
gw_config[GW_CONF].update(extended_cfg)
|
|
27
|
+
if get_protobuf_by_target(test, target):
|
|
28
|
+
payload = cert_protobuf.downlink_to_pb(gw_config)
|
|
29
|
+
utPrint(f"Configuring GW with cfg pkt:\n{payload}", "BLUE")
|
|
30
|
+
else:
|
|
31
|
+
if not serialization_change:
|
|
32
|
+
gw_config[GW_CONF][ADDITIONAL][SERIALIZATION_FORMAT] = JSON
|
|
33
|
+
payload = json.dumps(gw_config)
|
|
34
|
+
utPrint(f"Configuring GW with cfg pkt:\n{payload}", "BLUE")
|
|
35
|
+
mqttc.flush_pkts()
|
|
36
|
+
mqttc.publish(mqttc.update_topic, payload=payload, qos=1)
|
|
37
|
+
if wait:
|
|
38
|
+
# Search for update packet
|
|
39
|
+
start_time = datetime.datetime.now()
|
|
40
|
+
while (datetime.datetime.now() - start_time).seconds < DEFAULT_GW_FIELD_UPDATE_TIMEOUT:
|
|
41
|
+
for p in cert_mqtt.get_all_status_pkts(mqttc):
|
|
42
|
+
if GW_CONF in p or GW_STATUS in p:
|
|
43
|
+
test.gw_api_version = (p.get(GW_CONF, {}).get(GW_API_VERSION) or p.get(GW_STATUS, {}).get(GW_API_VERSION))
|
|
44
|
+
if target == DUT and is_gw(test.dut):
|
|
45
|
+
test.dut.gw_api_version = test.gw_api_version
|
|
46
|
+
print_pkt(p)
|
|
47
|
+
utPrint("SUCCESS: Found GW cfg", "GREEN")
|
|
48
|
+
wait_time_n_print(2)
|
|
49
|
+
if ret_pkt:
|
|
50
|
+
return test, p
|
|
51
|
+
else:
|
|
52
|
+
return test, DONE
|
|
53
|
+
print_update_wait()
|
|
54
|
+
test.rc = TEST_FAILED
|
|
55
|
+
test.add_reason(f"FAILURE: GW cfg not found after {DEFAULT_GW_FIELD_UPDATE_TIMEOUT} seconds!")
|
|
56
|
+
return test, NO_RESPONSE
|
|
57
|
+
else:
|
|
58
|
+
utPrint("Sent GW cfg, Wait is set to False", "BLUE")
|
|
59
|
+
return test, DONE
|
|
60
|
+
|
|
61
|
+
def gw_fw_upgrade(test, version, board_type, target=DUT):
|
|
62
|
+
|
|
63
|
+
# GW FW upgrade by action
|
|
64
|
+
gw_config = dict({ACTION: ACTION_GW_OTA,
|
|
65
|
+
# The URL here is for testing. The cloud using the BTM urls
|
|
66
|
+
IMG_DIR_URL: f"https://api.us-east-2.prod.wiliot.cloud/v1/bridge/type/{board_type}/version/{version[BLE_VERSION]}/binary/",
|
|
67
|
+
WIFI_VERSION: version[WIFI_VERSION],
|
|
68
|
+
BLE_VERSION: version[BLE_VERSION]})
|
|
69
|
+
if test.tester.protobuf:
|
|
70
|
+
payload = cert_protobuf.downlink_to_pb(gw_config)
|
|
71
|
+
else:
|
|
72
|
+
payload = json.dumps(gw_config)
|
|
73
|
+
utPrint(f"Upgrading GW with action pkt:\n{payload}", "BLUE")
|
|
74
|
+
|
|
75
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
76
|
+
mqttc.flush_pkts()
|
|
77
|
+
mqttc.publish(mqttc.update_topic, payload=payload, qos=1)
|
|
78
|
+
|
|
79
|
+
def create_gw_config(test, cfg, target=DUT, version=""):
|
|
80
|
+
gw = test.dut if is_gw(test.dut) and target == DUT else test.tester
|
|
81
|
+
if version:
|
|
82
|
+
conf = {LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, WIFI_VERSION: version[WIFI_VERSION],
|
|
83
|
+
BLE_VERSION: version[BLE_VERSION], ADDITIONAL: dict(cfg)}
|
|
84
|
+
elif gw.gw_orig_versions:
|
|
85
|
+
conf = {LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, WIFI_VERSION: gw.gw_orig_versions[WIFI_VERSION],
|
|
86
|
+
BLE_VERSION: gw.gw_orig_versions[BLE_VERSION], ADDITIONAL: dict(cfg)}
|
|
87
|
+
# Protection for FDM gw config
|
|
88
|
+
else:
|
|
89
|
+
conf = {LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, ADDITIONAL: dict(cfg)}
|
|
90
|
+
# If api version was not sent in gw info then the gw_api_version is None, we don't want to set it in the config
|
|
91
|
+
if gw.gw_api_version is not None:
|
|
92
|
+
conf[GW_API_VERSION] = gw.gw_api_version
|
|
93
|
+
return dict({GW_CONF: conf})
|
|
94
|
+
|
|
95
|
+
def gw_downlink(test, raw_tx_data="", is_ota=False, version="", max_duration=100, max_retries=8, target=DUT):
|
|
96
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
97
|
+
pkt = create_gw_downlink_pkt(test, raw_tx_data, is_ota, version=version, max_duration=max_duration, max_retries=max_retries, target=target)
|
|
98
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
99
|
+
mqttc.publish(mqttc.update_topic, payload=payload, qos=1)
|
|
100
|
+
|
|
101
|
+
def create_gw_downlink_pkt(test, raw_tx_data="", is_ota=False, version="", max_duration=100, max_retries=8, target=DUT):
|
|
102
|
+
ret = dict({TX_PKT: raw_tx_data,
|
|
103
|
+
TX_MAX_DURATION_MS: max_duration,
|
|
104
|
+
TX_MAX_RETRIES: max_retries})
|
|
105
|
+
if is_ota == False:
|
|
106
|
+
ret[ACTION] = ACTION_ADVERTISING
|
|
107
|
+
else:
|
|
108
|
+
ret[ACTION] = ACTION_BRG_OTA
|
|
109
|
+
ret[GW_ID] = test.dut.id_str if target == DUT and is_gw(test.dut) else test.tester.id_str
|
|
110
|
+
# Determine destination bridge
|
|
111
|
+
brg = get_brg_by_target(test, DUT if test.dut_is_bridge() else TESTER)
|
|
112
|
+
ret[BRIDGE_ID] = brg.id_str
|
|
113
|
+
ret[IMG_DIR_URL] = f"https://api.us-east-2.prod.wiliot.cloud/v1/bridge/type/{brg.board_type}/version/{version}/binary/"
|
|
114
|
+
# Using a random uuid to force file download on the GW side
|
|
115
|
+
ret[VER_UUID_STR] = ''.join(random.choices(string.digits, k=VER_MAX_LEN))
|
|
116
|
+
ret[UPGRADE_BLSD] = False
|
|
117
|
+
ret[TX_MAX_DURATION_MS] = 150
|
|
118
|
+
utPrint(f"Publishing ACTION_BRG_OTA:\n{ret}", "BLUE")
|
|
119
|
+
return ret
|
|
120
|
+
|
|
121
|
+
def get_default_gw_dict(test=None, target=DUT):
|
|
122
|
+
if test:
|
|
123
|
+
validation_schema = test.dut.validation_schema if target == DUT and is_gw(test.dut) else test.tester.validation_schema
|
|
124
|
+
else:
|
|
125
|
+
validation_schema = None
|
|
126
|
+
gw_dict = {}
|
|
127
|
+
|
|
128
|
+
def parse_properties(props):
|
|
129
|
+
d = {}
|
|
130
|
+
for prop_name, prop_desc in props.items():
|
|
131
|
+
# If 'properties' key exists, recurse
|
|
132
|
+
if "properties" in prop_desc:
|
|
133
|
+
d[prop_name] = parse_properties(prop_desc["properties"])
|
|
134
|
+
elif "default" in prop_desc:
|
|
135
|
+
d[prop_name] = prop_desc["default"]
|
|
136
|
+
else:
|
|
137
|
+
# Set default values for known types if 'default' not specified
|
|
138
|
+
prop_type = prop_desc.get("type")
|
|
139
|
+
if prop_type == "string":
|
|
140
|
+
d[prop_name] = ""
|
|
141
|
+
elif prop_type == "integer" or prop_type == "number":
|
|
142
|
+
d[prop_name] = 0
|
|
143
|
+
elif prop_type == "boolean":
|
|
144
|
+
d[prop_name] = False
|
|
145
|
+
elif prop_type == "array":
|
|
146
|
+
d[prop_name] = []
|
|
147
|
+
elif prop_type == "object":
|
|
148
|
+
d[prop_name] = {}
|
|
149
|
+
return d
|
|
150
|
+
|
|
151
|
+
if validation_schema:
|
|
152
|
+
gw_dict = parse_properties(validation_schema)
|
|
153
|
+
else:
|
|
154
|
+
gw_dict = dict({WLT_SERVER: PROD, USE_STAT_LOC: False,
|
|
155
|
+
SERIALIZATION_FORMAT: PROTOBUF, ACL: dict({ACL_MODE: ACL_DENY, ACL_BRIDGE_IDS: []})})
|
|
156
|
+
return gw_dict
|
|
157
|
+
|
|
158
|
+
def config_gw_defaults(test, version="", target=DUT):
|
|
159
|
+
gw = test.dut if target == DUT and is_gw(test.dut) else test.tester
|
|
160
|
+
utPrint(f"Configuring gateway {gw.id_str} to defaults", "BLUE")
|
|
161
|
+
return gw_configure(test, get_default_gw_dict(test, target=target), wait=True, version=version)
|
|
162
|
+
|
|
163
|
+
def config_gw_version(test, version, board_type=None, target=DUT):
|
|
164
|
+
|
|
165
|
+
utPrint(f"Updating GW versions to {version[WIFI_VERSION]} , {version[BLE_VERSION]}", "BLUE")
|
|
166
|
+
# Search for current api version
|
|
167
|
+
response = cert_common.get_gw_info(test, target=target)
|
|
168
|
+
if response == NO_RESPONSE:
|
|
169
|
+
print("Didn't get GW_INFO response from GW!")
|
|
170
|
+
return
|
|
171
|
+
|
|
172
|
+
cur_api_version = 0
|
|
173
|
+
if ENTRIES in response[GW_INFO]:
|
|
174
|
+
if GW_API_VERSION in response[GW_INFO][ENTRIES]:
|
|
175
|
+
cur_api_version = int(response[GW_INFO][ENTRIES][GW_API_VERSION][STR_VAL])
|
|
176
|
+
else:
|
|
177
|
+
if GW_API_VERSION in response[GW_INFO]:
|
|
178
|
+
cur_api_version = int(response[GW_INFO][GW_API_VERSION])
|
|
179
|
+
|
|
180
|
+
# Support for legacy esp api version below 206 where the upgrade was done by configuration and not action
|
|
181
|
+
print(f'ESP api version: {cur_api_version}')
|
|
182
|
+
if cur_api_version < 206:
|
|
183
|
+
print("Legacy ESP - using old version configuration approach")
|
|
184
|
+
gw_configure(test, get_default_gw_dict(test, target=target), version)
|
|
185
|
+
return
|
|
186
|
+
|
|
187
|
+
if not board_type:
|
|
188
|
+
board_type = get_brg_by_target(test, target).board_type
|
|
189
|
+
|
|
190
|
+
gw_fw_upgrade(test, version, board_type)
|
|
191
|
+
|
|
192
|
+
def gw_info_action(test, target=DUT):
|
|
193
|
+
pkt = {ACTION: GET_INFO_ACTION}
|
|
194
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
195
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
196
|
+
mqttc.publish(mqttc.update_topic, payload=payload, qos=1)
|
|
197
|
+
|
|
198
|
+
def gw_reboot_action(test, target=DUT):
|
|
199
|
+
pkt = {ACTION: REBOOT_GW_ACTION}
|
|
200
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
201
|
+
test.get_mqttc_by_target(target).publish(test.get_mqttc_by_target(target).update_topic, payload=payload, qos=1)
|
|
202
|
+
|
|
203
|
+
def gw_action(test, action, target=DUT):
|
|
204
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
205
|
+
pkt = {ACTION: action}
|
|
206
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
207
|
+
mqttc.publish(mqttc.update_topic, payload=payload, qos=1)
|
|
208
|
+
|
|
209
|
+
def gw_log_period_action(test, period, target=DUT):
|
|
210
|
+
pkt = {ACTION: f"{LOG_PERIOD_ACTION} {period}"}
|
|
211
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
212
|
+
test.get_mqttc_by_target(target).publish(test.get_mqttc_by_target(target).update_topic, payload=payload, qos=1)
|
|
213
|
+
|
|
214
|
+
def gw_logs_action(test, target=DUT):
|
|
215
|
+
pkt = {ACTION: GET_LOGS}
|
|
216
|
+
payload = cert_protobuf.downlink_to_pb(pkt) if get_protobuf_by_target(test, target) else json.dumps(pkt)
|
|
217
|
+
test.get_mqttc_by_target(target).publish(test.get_mqttc_by_target(target).update_topic, payload=payload, qos=1)
|
|
218
|
+
|
|
219
|
+
def gw_status_wait(test, cond, str, time_limit, target=DUT): #cond gatewayLogs str test type
|
|
220
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
221
|
+
mqttc.flush_pkts()
|
|
222
|
+
start_time = datetime.datetime.now()
|
|
223
|
+
while (datetime.datetime.now() - start_time).seconds < time_limit:
|
|
224
|
+
for p in cert_mqtt.get_all_status_pkts(mqttc):
|
|
225
|
+
if cond in p:
|
|
226
|
+
if str in p[cond]:
|
|
227
|
+
print_pkt(p)
|
|
228
|
+
return
|
|
229
|
+
print_update_wait()
|
|
230
|
+
|
|
231
|
+
#################################
|
|
232
|
+
# BRG
|
|
233
|
+
#################################
|
|
234
|
+
|
|
235
|
+
def get_brg_by_target(test, target):
|
|
236
|
+
if target == DUT:
|
|
237
|
+
return test.dut.internal_brg if is_gw(test.dut) else test.dut
|
|
238
|
+
elif target == BRG1:
|
|
239
|
+
return test.brg1
|
|
240
|
+
elif target == TESTER:
|
|
241
|
+
return test.tester.internal_brg
|
|
242
|
+
return None
|
|
243
|
+
|
|
244
|
+
def fields_n_vals_dict_get(fields, values):
|
|
245
|
+
# initiate fields and values
|
|
246
|
+
fields_and_values = {}
|
|
247
|
+
for field, value in zip(fields, values):
|
|
248
|
+
fields_and_values[field] = int(value)
|
|
249
|
+
# functionality run print
|
|
250
|
+
print_string = generate_print_string(fields_and_values)
|
|
251
|
+
functionality_run_print(print_string)
|
|
252
|
+
return fields_and_values
|
|
253
|
+
|
|
254
|
+
def brg_configure(test, cfg_pkt=None, module=None, fields=[], values=[], wait=True, ret_cfg_pkt=False, ble5=False, target=DUT):
|
|
255
|
+
brg = get_brg_by_target(test, target)
|
|
256
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
257
|
+
if ble5:
|
|
258
|
+
return brg_configure_ble5(test, cfg_pkt=cfg_pkt, module=module, fields=fields,
|
|
259
|
+
values=values, ret_cfg_pkt=ret_cfg_pkt, wait=wait, target=target)
|
|
260
|
+
retries = 3
|
|
261
|
+
if not cfg_pkt:
|
|
262
|
+
fields_n_vals = fields_n_vals_dict_get(fields, values)
|
|
263
|
+
cfg_pkt = get_default_brg_pkt(test, pkt_type=module, target=target, **fields_n_vals)
|
|
264
|
+
|
|
265
|
+
if not wait:
|
|
266
|
+
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), target=target)
|
|
267
|
+
utPrint("Wait is set to False, not waiting for Bridge cfg ACK", "CYAN")
|
|
268
|
+
return test, DONE
|
|
269
|
+
else:
|
|
270
|
+
mqttc.flush_pkts()
|
|
271
|
+
|
|
272
|
+
# Search for update packet
|
|
273
|
+
for retry in range(retries):
|
|
274
|
+
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), target=target)
|
|
275
|
+
pkts_found = False
|
|
276
|
+
seq_ids = []
|
|
277
|
+
wlt_pkt = WltPkt()
|
|
278
|
+
start_time = datetime.datetime.now()
|
|
279
|
+
while (datetime.datetime.now() - start_time).seconds < DEFAULT_BRG_FIELD_UPDATE_TIMEOUT:
|
|
280
|
+
pkts = cert_common.get_brg_cfg_pkts(test=test, target=target)
|
|
281
|
+
if pkts:
|
|
282
|
+
pkts_found = True
|
|
283
|
+
for p in pkts:
|
|
284
|
+
wlt_pkt = WltPkt(p)
|
|
285
|
+
if seq_ids == [] or wlt_pkt.pkt.seq_id not in seq_ids:
|
|
286
|
+
print(wlt_pkt.pkt)
|
|
287
|
+
if cfg_pkt.pkt == wlt_pkt.pkt:
|
|
288
|
+
utPrint("SUCCESS: Bridge cfg", "GREEN")
|
|
289
|
+
return (test, DONE) if not ret_cfg_pkt else (test, wlt_pkt)
|
|
290
|
+
seq_ids.append(wlt_pkt.pkt.seq_id)
|
|
291
|
+
print_update_wait()
|
|
292
|
+
utPrint(f"brg_configure: No pkts found retry={retry}!", "WARNING")
|
|
293
|
+
if not pkts_found:
|
|
294
|
+
utPrint(f"brg_configure: No pkts found retry={retry}!", "RED")
|
|
295
|
+
test.add_reason(f"brg_configure: No pkts found. retry={retry}")
|
|
296
|
+
test.rc = TEST_FAILED
|
|
297
|
+
if wlt_pkt.pkt:
|
|
298
|
+
# In case of failure, we want to see if it's api version issue
|
|
299
|
+
brg.api_version = wlt_pkt.pkt.api_version
|
|
300
|
+
print(f"-->> api_version:{brg.api_version}\nFailed brg_configure with pkt ({cfg_pkt.pkt.__dict__})")
|
|
301
|
+
test.add_reason(f"Failed brg_configure")
|
|
302
|
+
return test, NO_RESPONSE
|
|
303
|
+
|
|
304
|
+
def brg_configure_ble5(test, cfg_pkt=None, module=None, fields=None, values=None, ret_cfg_pkt=False, wait=True, target=DUT):
|
|
305
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
306
|
+
if not cfg_pkt:
|
|
307
|
+
fields_n_vals = fields_n_vals_dict_get(fields, values)
|
|
308
|
+
cfg_pkt = get_default_brg_pkt(test, pkt_type=module, target=target, **fields_n_vals)
|
|
309
|
+
# Search for update packet
|
|
310
|
+
mqttc.flush_pkts()
|
|
311
|
+
|
|
312
|
+
num_of_tries = 0
|
|
313
|
+
pkts_found = False
|
|
314
|
+
seq_ids = []
|
|
315
|
+
wlt_pkt = WltPkt()
|
|
316
|
+
start_time = datetime.datetime.now()
|
|
317
|
+
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), max_duration=BLE5_MAX_DURATION_MS, max_retries=BLE5_MAX_RETRIES, target=target)
|
|
318
|
+
if wait is False:
|
|
319
|
+
return test, DONE
|
|
320
|
+
while not pkts_found:
|
|
321
|
+
if ((datetime.datetime.now() - start_time).seconds > BLE5_MAX_DURATION_SEC):
|
|
322
|
+
if num_of_tries < 3:
|
|
323
|
+
num_of_tries += 1
|
|
324
|
+
start_time = datetime.datetime.now()
|
|
325
|
+
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), max_duration=BLE5_MAX_DURATION_MS, max_retries=BLE5_MAX_RETRIES, target=target)
|
|
326
|
+
print(f"Brg configure - BLE5 mode : No pkts found after {BLE5_MAX_DURATION_SEC} seconds, in try number {num_of_tries}")
|
|
327
|
+
else:
|
|
328
|
+
test.add_reason(f"Brg configure - BLE5 mode : No pkts found after {BLE5_MAX_DURATION_SEC} seconds, in 3 tries")
|
|
329
|
+
test.rc = TEST_FAILED
|
|
330
|
+
time.sleep(1)
|
|
331
|
+
mqttc.flush_pkts()
|
|
332
|
+
return test, NO_RESPONSE
|
|
333
|
+
pkts = cert_common.get_brg_cfg_pkts(test=test, target=target)
|
|
334
|
+
if pkts:
|
|
335
|
+
for p in pkts:
|
|
336
|
+
wlt_pkt = WltPkt(p)
|
|
337
|
+
if seq_ids == [] or wlt_pkt.pkt.seq_id not in seq_ids:
|
|
338
|
+
print(wlt_pkt.pkt)
|
|
339
|
+
if cfg_pkt.pkt == wlt_pkt.pkt:
|
|
340
|
+
utPrint("SUCCESS: Bridge cfg", "GREEN")
|
|
341
|
+
time.sleep(15)
|
|
342
|
+
mqttc.flush_pkts()
|
|
343
|
+
return (test, DONE) if not ret_cfg_pkt else (test, wlt_pkt)
|
|
344
|
+
seq_ids.append(wlt_pkt.pkt.seq_id)
|
|
345
|
+
print_update_wait()
|
|
346
|
+
|
|
347
|
+
def send_brg_action(test, action_id, target=DUT, **kwargs):
|
|
348
|
+
brg = get_brg_by_target(test, target)
|
|
349
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
350
|
+
mqttc.flush_pkts()
|
|
351
|
+
action_pkt = get_default_brg_pkt(test, pkt_type=eval_pkt(f'{ag.ACTIONS_DICT[action_id]}{brg.api_version}'), **kwargs)
|
|
352
|
+
gw_downlink(test, raw_tx_data=action_pkt.dump(), target=target)
|
|
353
|
+
|
|
354
|
+
def backward_compatible_handler(test, pkt_type, **kwargs):
|
|
355
|
+
datapath_output_power = 8
|
|
356
|
+
energy_2400_output_power = 2
|
|
357
|
+
calibration_output_power = 2
|
|
358
|
+
init_params = inspect.signature(pkt_type.__init__).parameters
|
|
359
|
+
safe_kwargs = {}
|
|
360
|
+
for k, v in kwargs.items():
|
|
361
|
+
if k in init_params:
|
|
362
|
+
safe_kwargs[k] = v
|
|
363
|
+
else:
|
|
364
|
+
utPrint(f"WARNING: Parameter {k} not in {pkt_type.__name__} parameters, ignoring it!", "WARNING")
|
|
365
|
+
|
|
366
|
+
if test.active_brg.api_version < ag.API_VERSION_V13:
|
|
367
|
+
if "ModuleDatapathV12" in pkt_type.__name__ and BRG_OUTPUT_POWER not in safe_kwargs:
|
|
368
|
+
safe_kwargs.update({BRG_OUTPUT_POWER: datapath_output_power})
|
|
369
|
+
if "ModuleEnergy2400V12" in pkt_type.__name__ and BRG_OUTPUT_POWER not in safe_kwargs:
|
|
370
|
+
safe_kwargs.update({BRG_OUTPUT_POWER: energy_2400_output_power})
|
|
371
|
+
if "ModuleCalibrationV12" in pkt_type.__name__ and BRG_OUTPUT_POWER not in safe_kwargs:
|
|
372
|
+
safe_kwargs.update({BRG_OUTPUT_POWER: calibration_output_power})
|
|
373
|
+
return safe_kwargs
|
|
374
|
+
|
|
375
|
+
def get_default_brg_pkt(test, pkt_type, group_id=ag.GROUP_ID_GW2BRG, seq_id=0, target=DUT, **kwargs):
|
|
376
|
+
brg = get_brg_by_target(test, target)
|
|
377
|
+
seq_id = test.get_seq_id() if seq_id == 0 else seq_id
|
|
378
|
+
safe_kwargs = backward_compatible_handler(test, pkt_type, **kwargs)
|
|
379
|
+
# Bypass from default sub1g ep cfg of 0 (no energizing) ONLY if not using data simulation
|
|
380
|
+
if "ModuleEnergySub1G" in pkt_type.__name__ and BRG_PATTERN not in safe_kwargs and test.data != DATA_SIMULATION:
|
|
381
|
+
safe_kwargs.update({BRG_PATTERN: ag.SUB1G_ENERGY_PATTERN_ISRAEL})
|
|
382
|
+
brg_pkt = WltPkt(hdr=ag.Hdr(group_id=group_id), pkt=pkt_type(brg_mac=brg.id_int if brg else 0, seq_id=seq_id, **safe_kwargs))
|
|
383
|
+
return brg_pkt
|
|
384
|
+
|
|
385
|
+
def config_brg_defaults(test, modules=[], ble5=False, wait=True, target=DUT):
|
|
386
|
+
failed_cfg = False
|
|
387
|
+
brg = get_brg_by_target(test, target)
|
|
388
|
+
modules = brg.modules if not modules else modules
|
|
389
|
+
for module in modules:
|
|
390
|
+
utPrint(f"Configuring {module.__name__} to defaults. board type[{brg.board_type}] api version[{brg.api_version}]", "BLUE")
|
|
391
|
+
cfg_pkt = get_default_brg_pkt(test, module, target=target)
|
|
392
|
+
if ble5:
|
|
393
|
+
test, res = brg_configure_ble5(test=test, cfg_pkt=cfg_pkt, wait=wait, target=target)
|
|
394
|
+
else:
|
|
395
|
+
test, res = brg_configure(test=test, cfg_pkt=cfg_pkt, wait=wait, target=target)
|
|
396
|
+
if res == NO_RESPONSE:
|
|
397
|
+
utPrint(f"FAILURE: {module.__name__} not configured to defaults", "RED")
|
|
398
|
+
failed_cfg = True
|
|
399
|
+
else:
|
|
400
|
+
utPrint(f"SUCCESS: {module.__name__} configured to defaults", "GREEN")
|
|
401
|
+
return (test, DONE) if not failed_cfg else (test, NO_RESPONSE)
|
|
402
|
+
|
|
403
|
+
def brg_ota(test, ble_version, search_ack=True, ble5=False, target=DUT, upgrader=TESTER, timeout=VER_UPDATE_TIMEOUT):
|
|
404
|
+
brg = get_brg_by_target(test, target)
|
|
405
|
+
mqttc = test.get_mqttc_by_target(upgrader)
|
|
406
|
+
|
|
407
|
+
if ble_version != brg.version:
|
|
408
|
+
utPrint(f"Updating BRG version to {ble_version}", "BLUE")
|
|
409
|
+
functionality_run_print(f"OTA for brg: {brg.id_str}")
|
|
410
|
+
action_pkt = get_default_brg_pkt(test=test, pkt_type=eval_pkt(f'ActionGenericV{brg.api_version}'), action_id=ag.ACTION_REBOOT,
|
|
411
|
+
target=target)
|
|
412
|
+
# BRG OTA - Flush pkts ONLY before starting to avoid deletion of needed GW Logs which are in the status topic
|
|
413
|
+
mqttc.flush_status_pkts()
|
|
414
|
+
# If the bridge is configured to ble5 then we need to broadcast the reboot packet for 15 seconds
|
|
415
|
+
if not ble5:
|
|
416
|
+
gw_downlink(test, raw_tx_data=action_pkt.dump(), is_ota=True, version=ble_version, target=upgrader)
|
|
417
|
+
else:
|
|
418
|
+
gw_downlink(test=test, raw_tx_data=action_pkt.dump(), is_ota=True, version=ble_version, max_duration=BLE5_MAX_DURATION_MS, max_retries=BLE5_MAX_RETRIES, target=upgrader)
|
|
419
|
+
|
|
420
|
+
# expected_hash=1 due to different cfgs and versions between builds
|
|
421
|
+
test = cert_common.reboot_config_analysis(test=test, expected_hash=1, ble_version=ble_version, timeout=timeout)
|
|
422
|
+
# for debug - print all logs to see failure reason
|
|
423
|
+
cert_common.get_gw_logs_packets(test, print_log=True)
|
|
424
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
425
|
+
return test
|
|
426
|
+
elif search_ack:
|
|
427
|
+
test = cert_common.gw_action_status_search(test, ag.BRG_MGMT_MSG_TYPE_OTA_UPDATE, 0, target=upgrader)
|
|
428
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
429
|
+
return test
|
|
430
|
+
else:
|
|
431
|
+
test.add_reason(WANTED_VER_SAME)
|
|
432
|
+
if test.rc == TEST_PASSED:
|
|
433
|
+
brg.version = ble_version
|
|
434
|
+
brg.update_modules()
|
|
435
|
+
return test
|
|
436
|
+
|
|
437
|
+
def update_versions(test, versions, update_gw=True, update_brg=True, target=DUT):
|
|
438
|
+
mqttc = test.get_mqttc_by_target(target)
|
|
439
|
+
#update gw versions
|
|
440
|
+
if update_gw:
|
|
441
|
+
config_gw_version(test, versions, target=TESTER)
|
|
442
|
+
# Search for update packet
|
|
443
|
+
start_time = datetime.datetime.now()
|
|
444
|
+
found = {BLE_VERSION: False, WIFI_VERSION: False}
|
|
445
|
+
while not all([found[version] for version in found]):
|
|
446
|
+
duration = (datetime.datetime.now() - start_time).seconds
|
|
447
|
+
for p in cert_mqtt.get_all_status_pkts(mqttc):
|
|
448
|
+
if GW_CONF in p or GW_STATUS in p:
|
|
449
|
+
print("\nConfig pkts:")
|
|
450
|
+
print_pkt(p)
|
|
451
|
+
bkv = BLE_VERSION.replace('Chip', '') if test.tester.protobuf else BLE_VERSION
|
|
452
|
+
wkv = WIFI_VERSION.replace('Chip', '') if test.tester.protobuf else WIFI_VERSION
|
|
453
|
+
ckv = GW_STATUS if test.tester.protobuf else GW_CONF
|
|
454
|
+
if p[ckv][bkv] == versions[BLE_VERSION]:
|
|
455
|
+
found[BLE_VERSION] = True
|
|
456
|
+
if p[ckv][wkv] == versions[WIFI_VERSION]:
|
|
457
|
+
found[WIFI_VERSION] = True
|
|
458
|
+
if not all([found[version] for version in found]):
|
|
459
|
+
# WIFI configured, need to configure again for BLE
|
|
460
|
+
if duration > 5:
|
|
461
|
+
# First pkt may be received is GW "cfg ack" so skip it
|
|
462
|
+
print(f"\nVersions Update Status:\n{found}\nUpdate Time: {duration} seconds")
|
|
463
|
+
config_gw_version(test, versions, target=TESTER)
|
|
464
|
+
mqttc.flush_pkts()
|
|
465
|
+
print_update_wait()
|
|
466
|
+
if duration > VER_UPDATE_TIMEOUT:
|
|
467
|
+
test.rc = TEST_FAILED
|
|
468
|
+
failed_versions = " & ".join([f"{k}={v}" for k,v in versions.items() if not found[k]])
|
|
469
|
+
test.add_reason(f"{failed_versions} not found after {VER_UPDATE_TIMEOUT} seconds!")
|
|
470
|
+
print(f"\n{test.reason}")
|
|
471
|
+
break
|
|
472
|
+
wait_time_n_print(10)
|
|
473
|
+
if not test.rc:
|
|
474
|
+
if update_gw:
|
|
475
|
+
print(f"\nGW versions updated successfully!\n")
|
|
476
|
+
# update brg version if test is not an internal_brg test
|
|
477
|
+
if update_brg and not test.internal_brg:
|
|
478
|
+
test = brg_ota(test, ble_version=versions[BLE_VERSION], search_ack=False)
|
|
479
|
+
|
|
480
|
+
return test
|