wiliot-certificate 4.4.3__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.3.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.93_app.zip +0 -0
- gw_certificate/interface/4.4.93_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.3.dist-info/METADATA +0 -211
- wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
- wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
- wiliot_certificate-4.4.3.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.3.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
brg_certificate/cert_config.py
DELETED
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
from brg_certificate.cert_defines import *
|
|
2
|
-
from brg_certificate.cert_prints import *
|
|
3
|
-
from brg_certificate.wlt_types import *
|
|
4
|
-
import brg_certificate.cert_common as cert_common
|
|
5
|
-
import brg_certificate.cert_protobuf as cert_protobuf
|
|
6
|
-
import datetime, string, json, random
|
|
7
|
-
|
|
8
|
-
BLE5_MAX_DURATION = ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE + 1000 # In MS
|
|
9
|
-
BLE5_MAX_RETRIES = BLE5_MAX_DURATION//20
|
|
10
|
-
|
|
11
|
-
#################################
|
|
12
|
-
# GW
|
|
13
|
-
#################################
|
|
14
|
-
|
|
15
|
-
def gw_configure(test, cfg={}, version="", extended_cfg={}, ret_pkt=False, wait=False, serialization_change=False):
|
|
16
|
-
cfg = cfg if cfg else get_default_gw_dict(test)
|
|
17
|
-
if test.gw_lan:
|
|
18
|
-
cfg[GW_MODE] = BLE_LAN
|
|
19
|
-
gw_config = create_gw_config(test, cfg, version)
|
|
20
|
-
gw_config[GW_CONF][ADDITIONAL].update(extended_cfg)
|
|
21
|
-
gw_config[GW_CONF].update(extended_cfg)
|
|
22
|
-
if test.protobuf:
|
|
23
|
-
payload = cert_protobuf.downlink_to_pb(gw_config)
|
|
24
|
-
utPrint(f"Configuring GW with cfg pkt:\n{payload}", "BLUE")
|
|
25
|
-
else:
|
|
26
|
-
if not serialization_change:
|
|
27
|
-
gw_config[GW_CONF][ADDITIONAL][SERIALIZATION_FORMAT] = JSON
|
|
28
|
-
payload = json.dumps(gw_config)
|
|
29
|
-
utPrint(f"Configuring GW with cfg pkt:\n{payload}", "BLUE")
|
|
30
|
-
test.mqttc.flush_pkts()
|
|
31
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
32
|
-
if wait:
|
|
33
|
-
# Search for update packet
|
|
34
|
-
start_time = datetime.datetime.now()
|
|
35
|
-
while (datetime.datetime.now() - start_time).seconds < DEFAULT_GW_FIELD_UPDATE_TIMEOUT:
|
|
36
|
-
for p in test.mqttc._userdata["pkts"].status:
|
|
37
|
-
if GW_CONF in p.body or GW_STATUS in p.body:
|
|
38
|
-
print_pkt(p.body)
|
|
39
|
-
utPrint("SUCCESS: Found GW cfg", "GREEN")
|
|
40
|
-
cert_common.wait_time_n_print(5)
|
|
41
|
-
if ret_pkt:
|
|
42
|
-
return test, p.body
|
|
43
|
-
else:
|
|
44
|
-
return test, DONE
|
|
45
|
-
print_update_wait()
|
|
46
|
-
test.rc = TEST_FAILED
|
|
47
|
-
test.add_reason(f"FAILURE: GW cfg not found after {DEFAULT_GW_FIELD_UPDATE_TIMEOUT} seconds!")
|
|
48
|
-
return test, NO_RESPONSE
|
|
49
|
-
else:
|
|
50
|
-
utPrint("Sent GW cfg, Wait is set to False", "BLUE")
|
|
51
|
-
return test, DONE
|
|
52
|
-
|
|
53
|
-
def create_gw_config(test, cfg, version=""):
|
|
54
|
-
if version:
|
|
55
|
-
return dict({GW_CONF:{LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, WIFI_VERSION: version[WIFI_VERSION],
|
|
56
|
-
BLE_VERSION: version[BLE_VERSION], GW_API_VERSION: GW_API_VER_OLD, ADDITIONAL:dict(cfg)}})
|
|
57
|
-
elif test.gw_orig_versions:
|
|
58
|
-
return dict({GW_CONF:{LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, WIFI_VERSION: test.gw_orig_versions[WIFI_VERSION],
|
|
59
|
-
BLE_VERSION: test.gw_orig_versions[BLE_VERSION], GW_API_VERSION: GW_API_VER_OLD, ADDITIONAL:dict(cfg)}})
|
|
60
|
-
# Protection for FDM gw config
|
|
61
|
-
else:
|
|
62
|
-
return dict({GW_CONF:{LAT: GW_LATITUDE_DEFAULT, LNG: GW_LONGITUDE_DEFAULT, GW_API_VERSION: GW_API_VER_OLD,
|
|
63
|
-
ADDITIONAL:dict(cfg)}})
|
|
64
|
-
|
|
65
|
-
def gw_downlink(test, raw_tx_data="", is_ota=False, version="", max_duration=100, max_retries=8):
|
|
66
|
-
pkt = create_gw_downlink_pkt(test, raw_tx_data, is_ota, version=version, max_duration=max_duration, max_retries=max_retries)
|
|
67
|
-
#TODO: logging print
|
|
68
|
-
# print("GW Downlink:", pkt)
|
|
69
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
70
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
71
|
-
|
|
72
|
-
def create_gw_downlink_pkt(test, raw_tx_data="", is_ota=False, version="", max_duration=100, max_retries=8):
|
|
73
|
-
ret = dict({TX_PKT: raw_tx_data,
|
|
74
|
-
TX_MAX_DURATION_MS: max_duration,
|
|
75
|
-
TX_MAX_RETRIES: max_retries})
|
|
76
|
-
if is_ota == False:
|
|
77
|
-
ret[ACTION] = ACTION_ADVERTISING
|
|
78
|
-
else:
|
|
79
|
-
ret[ACTION] = ACTION_BRG_OTA
|
|
80
|
-
ret[GW_ID] = str(test.gw)
|
|
81
|
-
ret[BRIDGE_ID] = test.active_brg.id_str
|
|
82
|
-
ret[IMG_DIR_URL] = f"https://api.us-east-2.prod.wiliot.cloud/v1/bridge/type/{test.active_brg.board_type}/version/{version}/binary/"
|
|
83
|
-
# Using a random uuid to force file download on the GW side
|
|
84
|
-
ret[VER_UUID_STR] = ''.join(random.choices(string.digits, k=VER_MAX_LEN))
|
|
85
|
-
ret[UPGRADE_BLSD] = False
|
|
86
|
-
ret[TX_MAX_DURATION_MS] = 150
|
|
87
|
-
return ret
|
|
88
|
-
|
|
89
|
-
def get_default_gw_dict(test=None):
|
|
90
|
-
return dict({WLT_SERVER: test.server if test else PROD, GW_MODE: BLE_WIFI, USE_STAT_LOC: False,
|
|
91
|
-
SERIALIZATION_FORMAT: PROTOBUF, ACL:dict({ACL_MODE: ACL_DENY , ACL_BRIDGE_IDS:[]})})
|
|
92
|
-
|
|
93
|
-
def config_gw_defaults(test, version=""):
|
|
94
|
-
utPrint(f"Configuring gateway {test.gw} to defaults", "BLUE")
|
|
95
|
-
return gw_configure(test, get_default_gw_dict(test), wait=True, version=version)
|
|
96
|
-
|
|
97
|
-
def config_gw_version(test, version):
|
|
98
|
-
utPrint(f"Updating GW versions to {version[WIFI_VERSION]} , {version[BLE_VERSION]}", "BLUE")
|
|
99
|
-
if version == VERSIONS["3.16.3"]:
|
|
100
|
-
gw_configure(test,
|
|
101
|
-
dict({WLT_SERVER: test.server if test else PROD, OUTPUT_POWER_2_4: 8, GW_MODE: BLE_WIFI, TX_PERIOD: 3,
|
|
102
|
-
USE_STAT_LOC: False, GW_DATA_MODE: TAGS_AND_BRGS, PACER_INTERVAL: 60, GW_ENERGY_PATTERN: 17, RX_TX_PERIOD: 100}),
|
|
103
|
-
version)
|
|
104
|
-
if version == VERSIONS["4.1.0"] or version == VERSIONS["4.1.2"]:
|
|
105
|
-
gw_configure(test,
|
|
106
|
-
dict({WLT_SERVER: test.server if test else PROD, GW_MODE: BLE_WIFI,
|
|
107
|
-
USE_STAT_LOC: False}),
|
|
108
|
-
version)
|
|
109
|
-
else:
|
|
110
|
-
gw_configure(test, get_default_gw_dict(test), version)
|
|
111
|
-
|
|
112
|
-
def gw_info_action(test):
|
|
113
|
-
pkt = {ACTION: GET_INFO_ACTION}
|
|
114
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
115
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
116
|
-
|
|
117
|
-
def gw_reboot_action(test):
|
|
118
|
-
pkt = {ACTION: REBOOT_GW_ACTION}
|
|
119
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
120
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
121
|
-
|
|
122
|
-
def gw_action(test, action):
|
|
123
|
-
pkt = {ACTION: action}
|
|
124
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
125
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
126
|
-
|
|
127
|
-
def gw_log_period_action(test, period):
|
|
128
|
-
pkt = {ACTION: f"{LOG_PERIOD_ACTION} {period}"}
|
|
129
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
130
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
131
|
-
|
|
132
|
-
def gw_logs_action(test):
|
|
133
|
-
pkt = {ACTION: GET_LOGS}
|
|
134
|
-
payload = cert_protobuf.downlink_to_pb(pkt) if test.protobuf else json.dumps(pkt)
|
|
135
|
-
test.mqttc.publish(test.mqttc.update_topic, payload=payload, qos=1)
|
|
136
|
-
|
|
137
|
-
def gw_status_wait(test, cond, str, time_limit): #cond gatewayLogs str test type
|
|
138
|
-
test.mqttc.flush_pkts()
|
|
139
|
-
start_time = datetime.datetime.now()
|
|
140
|
-
while (datetime.datetime.now() - start_time).seconds < time_limit:
|
|
141
|
-
for p in test.mqttc._userdata["pkts"].status:
|
|
142
|
-
if cond in p.body:
|
|
143
|
-
if str in p.body[cond]:
|
|
144
|
-
print_pkt(p.body)
|
|
145
|
-
return
|
|
146
|
-
print_update_wait()
|
|
147
|
-
|
|
148
|
-
#################################
|
|
149
|
-
# BRG
|
|
150
|
-
#################################
|
|
151
|
-
|
|
152
|
-
get_brg_id_int = lambda test, brg_mac : brg_mac if brg_mac != 0 else test.active_brg.id_int
|
|
153
|
-
|
|
154
|
-
def fields_n_vals_dict_get(fields, values):
|
|
155
|
-
# initiate fields and values
|
|
156
|
-
fields_and_values = {}
|
|
157
|
-
for field, value in zip(fields, values):
|
|
158
|
-
fields_and_values[field] = int(value)
|
|
159
|
-
# functionality run print
|
|
160
|
-
print_string = generate_print_string(fields_and_values)
|
|
161
|
-
functionality_run_print(print_string)
|
|
162
|
-
return fields_and_values
|
|
163
|
-
|
|
164
|
-
def brg_configure(test, cfg_pkt=None, module=None, fields=None, values=None, wait=True, ret_cfg_pkt=False, ble5=False):
|
|
165
|
-
if ble5:
|
|
166
|
-
return brg_configure_ble5(test, cfg_pkt=cfg_pkt, module=module, fields=fields,
|
|
167
|
-
values=values, ret_cfg_pkt=ret_cfg_pkt, wait=wait)
|
|
168
|
-
retries = 3
|
|
169
|
-
if not cfg_pkt:
|
|
170
|
-
fields_n_vals = fields_n_vals_dict_get(fields, values)
|
|
171
|
-
cfg_pkt = get_default_brg_pkt(test, pkt_type=module, **fields_n_vals)
|
|
172
|
-
# Search for update packet
|
|
173
|
-
test.mqttc.flush_pkts()
|
|
174
|
-
if not wait:
|
|
175
|
-
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump())
|
|
176
|
-
utPrint("Wait is set to False, not waiting for Bridge cfg ACK", "CYAN")
|
|
177
|
-
return test, DONE
|
|
178
|
-
|
|
179
|
-
for retry in range(retries):
|
|
180
|
-
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump())
|
|
181
|
-
pkts_found = False
|
|
182
|
-
seq_ids = []
|
|
183
|
-
wlt_pkt = WltPkt()
|
|
184
|
-
start_time = datetime.datetime.now()
|
|
185
|
-
while (datetime.datetime.now() - start_time).seconds < DEFAULT_BRG_FIELD_UPDATE_TIMEOUT:
|
|
186
|
-
pkts = cert_common.get_brg_cfg_pkts(test=test)
|
|
187
|
-
if pkts:
|
|
188
|
-
pkts_found = True
|
|
189
|
-
for p in pkts:
|
|
190
|
-
wlt_pkt = WltPkt(p)
|
|
191
|
-
if seq_ids == [] or wlt_pkt.pkt.seq_id not in seq_ids:
|
|
192
|
-
print(wlt_pkt.pkt)
|
|
193
|
-
if cfg_pkt.pkt == wlt_pkt.pkt:
|
|
194
|
-
utPrint("SUCCESS: Bridge cfg", "GREEN")
|
|
195
|
-
return (test, DONE) if not ret_cfg_pkt else (test, wlt_pkt)
|
|
196
|
-
seq_ids.append(wlt_pkt.pkt.seq_id)
|
|
197
|
-
print_update_wait()
|
|
198
|
-
utPrint(f"brg_configure: No pkts found retry={retry}!", "WARNING")
|
|
199
|
-
if not pkts_found:
|
|
200
|
-
utPrint(f"brg_configure: No pkts found retry={retry}!", "RED")
|
|
201
|
-
test.add_reason(f"brg_configure: No pkts found. retry={retry}")
|
|
202
|
-
test.rc = TEST_FAILED
|
|
203
|
-
if wlt_pkt.pkt:
|
|
204
|
-
# In case of failure, we want to see if it's api version issue
|
|
205
|
-
test.active_brg.api_version = wlt_pkt.pkt.api_version
|
|
206
|
-
print(f"-->> api_version:{test.active_brg.api_version}\nFailed brg_configure with pkt ({cfg_pkt.pkt.__dict__})")
|
|
207
|
-
test.add_reason(f"Failed brg_configure")
|
|
208
|
-
return test, NO_RESPONSE
|
|
209
|
-
|
|
210
|
-
def brg_configure_ble5(test, cfg_pkt=None, module=None, fields=None, values=None, ret_cfg_pkt=False, wait=True):
|
|
211
|
-
if not cfg_pkt:
|
|
212
|
-
fields_n_vals = fields_n_vals_dict_get(fields, values)
|
|
213
|
-
cfg_pkt = get_default_brg_pkt(test, pkt_type=module, **fields_n_vals)
|
|
214
|
-
# Search for update packet
|
|
215
|
-
test.mqttc.flush_pkts()
|
|
216
|
-
|
|
217
|
-
num_of_tries = 0
|
|
218
|
-
pkts_found = False
|
|
219
|
-
seq_ids = []
|
|
220
|
-
wlt_pkt = WltPkt()
|
|
221
|
-
start_time = datetime.datetime.now()
|
|
222
|
-
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), max_duration=BLE5_MAX_DURATION, max_retries=BLE5_MAX_RETRIES)
|
|
223
|
-
if wait is False:
|
|
224
|
-
return test, DONE
|
|
225
|
-
while not pkts_found:
|
|
226
|
-
if ((datetime.datetime.now() - start_time).seconds > ((ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE/1000)+1)):
|
|
227
|
-
if num_of_tries < 3:
|
|
228
|
-
num_of_tries += 1
|
|
229
|
-
start_time = datetime.datetime.now()
|
|
230
|
-
gw_downlink(test=test, raw_tx_data=cfg_pkt.dump(), max_duration=BLE5_MAX_DURATION, max_retries=BLE5_MAX_RETRIES)
|
|
231
|
-
print(f"Brg configure - BLE5 mode : No pkts found after {(ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE/1000)+1} seconds, in try number {num_of_tries}")
|
|
232
|
-
else:
|
|
233
|
-
test.add_reason(f"Brg configure - BLE5 mode : No pkts found after {BLE5_MAX_DURATION} seconds, in 3 tries")
|
|
234
|
-
test.rc = TEST_FAILED
|
|
235
|
-
time.sleep(1)
|
|
236
|
-
test.mqttc.flush_pkts()
|
|
237
|
-
return test, NO_RESPONSE
|
|
238
|
-
pkts = cert_common.get_brg_cfg_pkts(test=test)
|
|
239
|
-
if pkts:
|
|
240
|
-
for p in pkts:
|
|
241
|
-
wlt_pkt = WltPkt(p)
|
|
242
|
-
if seq_ids == [] or wlt_pkt.pkt.seq_id not in seq_ids:
|
|
243
|
-
print(wlt_pkt.pkt)
|
|
244
|
-
if cfg_pkt.pkt == wlt_pkt.pkt:
|
|
245
|
-
utPrint("SUCCESS: Bridge cfg", "GREEN")
|
|
246
|
-
time.sleep(15)
|
|
247
|
-
test.mqttc.flush_pkts()
|
|
248
|
-
return (test, DONE) if not ret_cfg_pkt else (test, wlt_pkt)
|
|
249
|
-
seq_ids.append(wlt_pkt.pkt.seq_id)
|
|
250
|
-
print_update_wait()
|
|
251
|
-
|
|
252
|
-
def brg1_configure(test, cfg_pkt=None, module=None, fields=None, values=None, wait=True, ret_cfg_pkt=False, ble5=False):
|
|
253
|
-
test.active_brg = test.brg1
|
|
254
|
-
if ble5:
|
|
255
|
-
test, res = brg_configure_ble5(test, cfg_pkt, module, fields, values, ret_cfg_pkt)
|
|
256
|
-
else:
|
|
257
|
-
test, res = brg_configure(test, cfg_pkt, module, fields, values, wait, ret_cfg_pkt)
|
|
258
|
-
test.active_brg = test.brg0
|
|
259
|
-
return test, res
|
|
260
|
-
|
|
261
|
-
def internal_brg_configure(test, cfg_pkt=None, module=None, fields=None, values=None, wait=True, ret_cfg_pkt=False):
|
|
262
|
-
test.active_brg = test.internal_brg_obj
|
|
263
|
-
if not cfg_pkt:
|
|
264
|
-
fields_n_vals = fields_n_vals_dict_get(fields, values) if fields and values else {}
|
|
265
|
-
cfg_pkt = get_default_brg_pkt(test, pkt_type=module, **fields_n_vals)
|
|
266
|
-
test, res = brg_configure(test, cfg_pkt, module, fields, values, wait, ret_cfg_pkt)
|
|
267
|
-
test.active_brg = test.brg0
|
|
268
|
-
return test, res
|
|
269
|
-
|
|
270
|
-
def send_brg_action(test, action_id, **kwargs):
|
|
271
|
-
#TODO: logging print
|
|
272
|
-
# print(f"\nSending {ag.ACTIONS_DICT[action_id]}{test.active_brg.api_version} with parameters={kwargs if kwargs else None}")
|
|
273
|
-
test.mqttc.flush_pkts()
|
|
274
|
-
action_pkt = get_default_brg_pkt(test, pkt_type=eval_pkt(f'{ag.ACTIONS_DICT[action_id]}{test.active_brg.api_version}'), **kwargs)
|
|
275
|
-
gw_downlink(test, raw_tx_data=action_pkt.dump())
|
|
276
|
-
|
|
277
|
-
def get_default_brg_pkt(test, pkt_type, group_id=ag.GROUP_ID_GW2BRG, seq_id=0, **kwargs):
|
|
278
|
-
seq_id = test.get_seq_id() if seq_id == 0 else seq_id
|
|
279
|
-
# Bypass from default sub1g ep cfg of 0 (no energizing)
|
|
280
|
-
if "ModuleEnergySub1G" in pkt_type.__name__ and BRG_PATTERN not in kwargs:
|
|
281
|
-
# TODO - Remove on next api_version update - this is a patch for parameter name change from api version 11 to 12
|
|
282
|
-
brg_pattern = "sub1g_energy_" + BRG_PATTERN if test.active_brg.api_version < ag.API_VERSION_V12 else BRG_PATTERN
|
|
283
|
-
kwargs.update({brg_pattern: ag.SUB1G_ENERGY_PATTERN_ISRAEL})
|
|
284
|
-
brg_pkt = WltPkt(hdr=ag.Hdr(group_id=group_id), pkt=pkt_type(brg_mac=test.active_brg.id_int if test.active_brg else 0, seq_id=seq_id, **kwargs))
|
|
285
|
-
return brg_pkt
|
|
286
|
-
|
|
287
|
-
def config_brg_defaults(test, modules=[], ble5=False, wait=True):
|
|
288
|
-
failed_cfg = False
|
|
289
|
-
modules = test.active_brg.modules if not modules else modules
|
|
290
|
-
for module in modules:
|
|
291
|
-
utPrint(f"Configuring {module.__name__} to defaults. board type[{test.active_brg.board_type}] api version[{test.active_brg.api_version}]", "BLUE")
|
|
292
|
-
cfg_pkt = get_default_brg_pkt(test, module)
|
|
293
|
-
if ble5:
|
|
294
|
-
test, res = brg_configure_ble5(test=test, cfg_pkt=cfg_pkt, wait=wait)
|
|
295
|
-
else:
|
|
296
|
-
test, res = brg_configure(test=test, cfg_pkt=cfg_pkt, wait=wait)
|
|
297
|
-
if res == NO_RESPONSE:
|
|
298
|
-
utPrint(f"FAILURE: {module.__name__} not configured to defaults", "RED")
|
|
299
|
-
failed_cfg = True
|
|
300
|
-
else:
|
|
301
|
-
utPrint(f"SUCCESS: {module.__name__} configured to defaults", "GREEN")
|
|
302
|
-
return (test, DONE) if not failed_cfg else (test, NO_RESPONSE)
|
|
303
|
-
|
|
304
|
-
def config_brg1_defaults(test, modules=[], ble5=False, wait=True):
|
|
305
|
-
test.active_brg = test.brg1
|
|
306
|
-
test, res = config_brg_defaults(test, modules=modules, ble5=ble5, wait=wait)
|
|
307
|
-
test.active_brg = test.brg0
|
|
308
|
-
return test, res
|
|
309
|
-
|
|
310
|
-
def print_cur_modules(test, modules):
|
|
311
|
-
start_time = datetime.datetime.now()
|
|
312
|
-
# Print all pkts
|
|
313
|
-
for module in modules:
|
|
314
|
-
pkts = cert_mqtt.get_brg2gw_mgmt_pkts(test.mqttc, test, mgmt_types=[module])
|
|
315
|
-
if pkts:
|
|
316
|
-
print("\nGot {} packet after {} sec!".format(module, (datetime.datetime.now() - start_time).seconds))
|
|
317
|
-
print(pkts[-1][MGMT_PKT].pkt)
|
|
318
|
-
|
|
319
|
-
return test
|
|
320
|
-
|
|
321
|
-
def brg_ota(test, gw_ble_version=None, search_ack=True):
|
|
322
|
-
if not gw_ble_version:
|
|
323
|
-
gw_ble_version = cert_common.get_gw_versions(test)[BLE_VERSION]
|
|
324
|
-
if not gw_ble_version:
|
|
325
|
-
test.rc = TEST_FAILED
|
|
326
|
-
test.add_reason("Couldn't get GW versions!")
|
|
327
|
-
return test
|
|
328
|
-
|
|
329
|
-
if gw_ble_version != test.active_brg.version:
|
|
330
|
-
utPrint(f"Updating BRG version to {gw_ble_version}", "BLUE")
|
|
331
|
-
ota_updates = [f"Starting OTA to BRG WLT_{test.active_brg.id_str}",
|
|
332
|
-
f"BRG OTA finished with status 0 for bridge {test.active_brg.id_str}"]
|
|
333
|
-
functionality_run_print(f"OTA for brg: {test.active_brg.id_str}")
|
|
334
|
-
action_pkt = get_default_brg_pkt(test=test, pkt_type=eval_pkt(f'ActionGenericV{test.active_brg.api_version}'), action_id=ag.ACTION_REBOOT)
|
|
335
|
-
# BRG OTA - Flash pkts ONLY before starting to avoid deletion of needed GW Logs which are in the status topic
|
|
336
|
-
test.mqttc.flush_status_pkts()
|
|
337
|
-
gw_downlink(test, raw_tx_data=action_pkt.dump(), is_ota=True, version=gw_ble_version)
|
|
338
|
-
# expected_hash=1 due to different cfgs and versions between builds
|
|
339
|
-
test = cert_common.reboot_config_analysis(test=test, expected_hash=1, ble_version=gw_ble_version, timeout=VER_UPDATE_TIMEOUT)
|
|
340
|
-
|
|
341
|
-
# for debug - print all logs to see failure reason
|
|
342
|
-
cert_common.get_gw_logs_packets(test, print_log=True)
|
|
343
|
-
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
344
|
-
return test
|
|
345
|
-
elif search_ack:
|
|
346
|
-
test = cert_common.gw_logs_search(test, ota_updates)
|
|
347
|
-
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
348
|
-
return test
|
|
349
|
-
test = cert_common.gw_action_status_search(test, ag.BRG_MGMT_MSG_TYPE_OTA_UPDATE, 0)
|
|
350
|
-
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
351
|
-
return test
|
|
352
|
-
else:
|
|
353
|
-
test.add_reason(WANTED_VER_SAME)
|
|
354
|
-
test.active_brg.version = gw_ble_version
|
|
355
|
-
test.active_brg.update_modules()
|
|
356
|
-
return test
|
|
357
|
-
|
|
358
|
-
def update_versions(test, versions, update_gw=True, update_brg=True):
|
|
359
|
-
#update gw versions
|
|
360
|
-
if update_gw:
|
|
361
|
-
config_gw_version(test, versions)
|
|
362
|
-
# Search for update packet
|
|
363
|
-
start_time = datetime.datetime.now()
|
|
364
|
-
found = {BLE_VERSION: False, WIFI_VERSION: False}
|
|
365
|
-
# First pkt received is GW "cfg ack"
|
|
366
|
-
tries = 0
|
|
367
|
-
while not all([found[version] for version in found]):
|
|
368
|
-
for p in test.mqttc._userdata["pkts"].status:
|
|
369
|
-
if GW_CONF in p.body or GW_STATUS in p.body:
|
|
370
|
-
print("\nConfig pkts:")
|
|
371
|
-
print_pkt(p.body)
|
|
372
|
-
bkv = BLE_VERSION.replace('Chip', '') if test.protobuf else BLE_VERSION
|
|
373
|
-
wkv = WIFI_VERSION.replace('Chip', '') if test.protobuf else WIFI_VERSION
|
|
374
|
-
ckv = GW_STATUS if test.protobuf else GW_CONF
|
|
375
|
-
if p.body[ckv][bkv] == versions[BLE_VERSION]:
|
|
376
|
-
found[BLE_VERSION] = True
|
|
377
|
-
if p.body[ckv][wkv] == versions[WIFI_VERSION]:
|
|
378
|
-
found[WIFI_VERSION] = True
|
|
379
|
-
if not all([found[version] for version in found]):
|
|
380
|
-
# WIFI configured, need to configure again for BLE
|
|
381
|
-
if tries > 0:
|
|
382
|
-
# First pkt received is GW "cfg ack"
|
|
383
|
-
print(f"\nVersions Update Status:\n{found}\nTries: {tries}\nUpdate Time: {(datetime.datetime.now() - start_time).seconds} seconds")
|
|
384
|
-
config_gw_version(test, versions)
|
|
385
|
-
tries += 1
|
|
386
|
-
test.mqttc.flush_pkts()
|
|
387
|
-
print_update_wait()
|
|
388
|
-
if (datetime.datetime.now() - start_time).seconds > VER_UPDATE_TIMEOUT:
|
|
389
|
-
test.rc = TEST_FAILED
|
|
390
|
-
failed_versions = " & ".join([f"{k}={v}" for k,v in versions.items() if not found[k]])
|
|
391
|
-
test.add_reason(f"{failed_versions} not found after {VER_UPDATE_TIMEOUT} seconds in {tries} tries!")
|
|
392
|
-
print(f"\n{test.reason}")
|
|
393
|
-
break
|
|
394
|
-
cert_common.wait_time_n_print(10)
|
|
395
|
-
if not test.rc:
|
|
396
|
-
if update_gw:
|
|
397
|
-
print(f"\nGW versions updated successfully in {tries if tries > 0 else 1} tries!\n")
|
|
398
|
-
# update brg version if test is not an internal_brg test
|
|
399
|
-
if update_brg and not test.internal_brg:
|
|
400
|
-
test = brg_ota(test, gw_ble_version=versions[BLE_VERSION], search_ack=False)
|
|
401
|
-
|
|
402
|
-
return test
|