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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import shutil
|
|
2
3
|
import tabulate
|
|
3
4
|
import subprocess
|
|
4
5
|
import datetime
|
|
6
|
+
import zoneinfo
|
|
5
7
|
from reportlab.lib import colors
|
|
6
8
|
from reportlab.lib.pagesizes import letter
|
|
7
9
|
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, PageBreak, KeepTogether, Image
|
|
@@ -9,20 +11,18 @@ from reportlab.lib.styles import ParagraphStyle
|
|
|
9
11
|
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
|
|
10
12
|
|
|
11
13
|
# Local imports
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
from
|
|
15
|
-
from
|
|
14
|
+
import certificate.cert_prints as cert_prints
|
|
15
|
+
import certificate.cert_utils as cert_utils
|
|
16
|
+
from certificate.wlt_types import *
|
|
17
|
+
from certificate.cert_defines import *
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
##################################
|
|
19
21
|
# GENERIC
|
|
20
22
|
##################################
|
|
21
23
|
# Defines
|
|
22
|
-
WLT_CERT_HEADLINE = "Wiliot Certificate
|
|
23
|
-
|
|
24
|
-
WLT_CERT_FAIL_HEADLINE = "Wiliot Certificate Failed!"
|
|
25
|
-
WLT_CERT_ERROR_HEADLINE = "Wiliot Certificate Error!"
|
|
24
|
+
WLT_CERT_HEADLINE = "Wiliot Certificate {}"
|
|
25
|
+
WLT_NON_CERT_HEADLINE = "Wiliot Non-Certifying Run {}"
|
|
26
26
|
SUMMARY_HEADLINE = "Summary"
|
|
27
27
|
RUN_INFO = "Run Information"
|
|
28
28
|
RUN_DATETIME = "Run Time & Date"
|
|
@@ -31,29 +31,38 @@ CERT_VER = "Certificate Version"
|
|
|
31
31
|
TESTING_DEVICE_INFO = "Testing Device Information"
|
|
32
32
|
TESTED_DEVICE_INFO = "Tested Device Information"
|
|
33
33
|
SIM = "Simulator"
|
|
34
|
+
GATEWAY = "Gateway"
|
|
34
35
|
BRG = "Bridge"
|
|
35
36
|
BLE_MAC_ADDRESS = "BLE MAC Address"
|
|
36
37
|
BOARD_TYPE = "Board Type"
|
|
37
38
|
BLE_VER = "BLE Version"
|
|
38
39
|
SUP_API_VER = "Supported API Version"
|
|
40
|
+
ADD_INFO = "Additional information"
|
|
41
|
+
# TODO: This is a temporary list of all schema module names - remove this when auto generated
|
|
42
|
+
MODULE_SCHEMA_NAMES_LIST = ["Cloud Connectivity", "Edge Management", "Calibration", "Datapath", "Energizer 2.4GHz",
|
|
43
|
+
"Energizer Sub-1GHz", "Power Management", "BLE Sensor", "Custom"]
|
|
39
44
|
|
|
40
45
|
result_map = {TEST_FAILED: cert_prints.color("RED", "FAIL"), TEST_SKIPPED: cert_prints.color("WARNING", "SKIPPED"),
|
|
41
|
-
TEST_PASSED: cert_prints.color("GREEN", "PASS"),
|
|
46
|
+
TEST_PASSED: cert_prints.color("GREEN", "PASS"), TEST_ABORTED: cert_prints.color("RED", "ABORTED")}
|
|
42
47
|
pass_or_fail = lambda obj : result_map[obj.rc]
|
|
48
|
+
|
|
49
|
+
result_map_txt = {TEST_FAILED: "FAIL", TEST_SKIPPED: "SKIPPED", TEST_PASSED: "PASS", TEST_ABORTED: "ABORTED"}
|
|
50
|
+
pass_or_fail_txt = lambda obj : result_map_txt[obj.rc]
|
|
51
|
+
|
|
43
52
|
param_name_to_title = lambda s : ' '.join(word.lower().capitalize() for word in s.split('_')).replace('2 4', '2.4') if '_' in s else s
|
|
53
|
+
headline_get = lambda non_cert_run, suffix : WLT_NON_CERT_HEADLINE.format(suffix) if non_cert_run else WLT_CERT_HEADLINE.format(suffix)
|
|
44
54
|
|
|
45
55
|
class TestResult:
|
|
46
|
-
def __init__(self, name="", devices_to_print="", test_table=None,
|
|
56
|
+
def __init__(self, name="", devices_to_print="", test_table=None, duration=0, purpose="", kb_link="", compliance="", rc=TEST_PASSED):
|
|
47
57
|
self.name = name
|
|
48
58
|
self.devices = devices_to_print
|
|
49
|
-
self.result = result
|
|
50
59
|
self.test_table = test_table
|
|
51
60
|
self.duration = duration
|
|
52
61
|
self.purpose = purpose
|
|
53
62
|
self.kb_link = kb_link
|
|
54
63
|
self.compliance = compliance
|
|
55
|
-
self.
|
|
56
|
-
|
|
64
|
+
self.rc = rc
|
|
65
|
+
|
|
57
66
|
def __repr__(self):
|
|
58
67
|
return self.name
|
|
59
68
|
|
|
@@ -63,13 +72,14 @@ def generate_tests_table(tests=[], html=False):
|
|
|
63
72
|
_pass_or_fail = pass_or_fail_html if html else pass_or_fail
|
|
64
73
|
tests_results = []
|
|
65
74
|
for test in tests:
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
dut_to_print = (test.dut.internal_brg.id_str if isinstance(test.dut, cert_utils.Gateway) and test.dut.has_internal_brg()
|
|
76
|
+
else test.dut.id_str)
|
|
77
|
+
dut_to_print += f"\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else ""
|
|
68
78
|
inner_table = [[phase.name, _pass_or_fail(phase), phase.reason] for phase in test.phases]
|
|
69
79
|
result_breakdown_table = tabulate.tabulate(inner_table, headers=["Phase", "Result", "Notes"], tablefmt=inner_format)
|
|
70
80
|
tests_results.append([cert_utils.module2name(test.test_module),
|
|
71
81
|
test.module_name if (not test.internal_brg or "gw" in test.module_name) else f"{test.module_name} (internal brg)",
|
|
72
|
-
|
|
82
|
+
dut_to_print,
|
|
73
83
|
result_breakdown_table,
|
|
74
84
|
_pass_or_fail(test),
|
|
75
85
|
test.duration])
|
|
@@ -100,31 +110,58 @@ def get_update_status_from_log_file(log_file="update_log.txt"):
|
|
|
100
110
|
break
|
|
101
111
|
return update_status
|
|
102
112
|
|
|
103
|
-
def
|
|
113
|
+
def get_important_tests_info():
|
|
114
|
+
patterns = ["DISCONNECTED", "WLT_ERROR", "free heap size", "python_mqtt_disconnect"]
|
|
115
|
+
return "".join([l.strip(' "') for l in open(os.path.join(ARTIFACTS_DIR, CERT_MQTT_LOG_FILE)).readlines() if any([p in l for p in patterns])])
|
|
116
|
+
|
|
117
|
+
def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), tests=[], error=None, non_cert_run=False):
|
|
118
|
+
print(cert_prints.SEP)
|
|
119
|
+
duration = (datetime.datetime.now()-start_time)
|
|
120
|
+
print("Tests duration: {}".format(str(duration).split(".")[0]))
|
|
121
|
+
pipeline = cert_prints.pipeline_running()
|
|
122
|
+
test = tests[-1] if tests else None
|
|
123
|
+
if test and test.dut_is_bridge():
|
|
124
|
+
print("Bridge version: {}".format(test.dut.version))
|
|
125
|
+
if not error:
|
|
126
|
+
print(generate_tests_table(tests))
|
|
127
|
+
print(tabulate.tabulate([[len(tests), len(tests)-(failures+skipped), skipped, failures, len(tests)]],
|
|
128
|
+
headers=["FINISHED", "PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="pretty"))
|
|
129
|
+
print(cert_prints.WIL_CERT_TEXT)
|
|
130
|
+
cert_prints.print_warn(get_important_tests_info())
|
|
131
|
+
print(f"Run artifacts saved in \"{ARTIFACTS_DIR}\" directory")
|
|
132
|
+
run_type = headline_get(non_cert_run, "").strip()
|
|
133
|
+
cert_prints.print_pass_or_fail(not failures and not error, run_type)
|
|
134
|
+
|
|
104
135
|
# Generate HTML file
|
|
105
136
|
if html:
|
|
106
|
-
|
|
107
|
-
f
|
|
137
|
+
file_path = os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_HTML)
|
|
138
|
+
f = open(file_path, "w", encoding="utf-8")
|
|
139
|
+
html_title = headline_get(non_cert_run, "Results")
|
|
140
|
+
html_start_modified = HTML_START.format(html_title)
|
|
141
|
+
f.write(html_start_modified)
|
|
108
142
|
update_status = get_update_status_from_log_file()
|
|
109
143
|
if pipeline:
|
|
110
144
|
p = subprocess.Popen('git log --format=%B -n 1 {}'.format(os.environ['BITBUCKET_COMMIT']),
|
|
111
145
|
stdout=subprocess.PIPE, shell=True, cwd=os.environ['BITBUCKET_CLONE_DIR'])
|
|
112
146
|
output, err = p.communicate()
|
|
113
147
|
if error:
|
|
114
|
-
|
|
148
|
+
headline = headline_get(non_cert_run, "Error!")
|
|
149
|
+
f.write(f"<br><h1 style='color:#ab0000'>{headline}</h1><br>")
|
|
115
150
|
if pipeline:
|
|
116
151
|
f.write("<hr>" + output.decode("utf-8") + "<br>")
|
|
117
152
|
f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
|
|
118
153
|
f.write(update_status + "<br><br>")
|
|
119
154
|
f.write(error + "<br><br>")
|
|
120
155
|
f.write(f"{RUN_DUR}: {str(duration).split('.')[0]} <br><br>")
|
|
121
|
-
if
|
|
122
|
-
f.write(f"{BRG} {BLE_VER}: {
|
|
156
|
+
if test and test.dut_is_bridge():
|
|
157
|
+
f.write(f"{BRG} {BLE_VER}: {test.dut.version} <br><br>")
|
|
123
158
|
elif tests:
|
|
124
159
|
if not failures and ("successfully!" in update_status or "skipped!" in update_status or not pipeline):
|
|
125
|
-
|
|
160
|
+
headline = headline_get(non_cert_run, "Passed!")
|
|
161
|
+
f.write(f"<br><h1 style='color:#00AB83'>{headline}</h1>")
|
|
126
162
|
else:
|
|
127
|
-
|
|
163
|
+
headline = headline_get(non_cert_run, "Failed!")
|
|
164
|
+
f.write(f"<br><h1 style='color:#ab0000'>{headline}</h1>")
|
|
128
165
|
if pipeline:
|
|
129
166
|
f.write("<hr>" + output.decode("utf-8") + "<br>")
|
|
130
167
|
f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
|
|
@@ -132,12 +169,20 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
132
169
|
f.write(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')} <br><br>")
|
|
133
170
|
f.write(f"{RUN_DUR}: {str(duration).split('.')[0]} <br><br>")
|
|
134
171
|
f.write(f"{CERT_VER}: {CERT_VERSION} <br><br>")
|
|
135
|
-
if
|
|
136
|
-
f.write(f"{
|
|
137
|
-
f.write(f"{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
172
|
+
if test and test.dut_is_gateway():
|
|
173
|
+
f.write(f"{GATEWAY} ID: {test.dut.id_str} <br><br>")
|
|
174
|
+
f.write(f"{GATEWAY} {SUP_API_VER}: {test.dut.gw_api_version} <br><br>")
|
|
175
|
+
f.write(f"{GATEWAY} {SERIALIZATION_FORMAT}: {PROTOBUF if test.dut.protobuf else JSON} <br><br>")
|
|
176
|
+
if test.dut_is_combo():
|
|
177
|
+
f.write(f"{BRG} {BLE_MAC_ADDRESS}: {test.dut.internal_brg.id_str} <br><br>")
|
|
178
|
+
f.write(f"{BRG} {BLE_VER}: {test.dut.internal_brg.version} <br><br>")
|
|
179
|
+
if test.dut_is_bridge():
|
|
180
|
+
f.write(f"{BRG} {BLE_MAC_ADDRESS}: {test.dut.id_str} <br><br>")
|
|
181
|
+
f.write(f"{BRG} {BLE_VER}: {test.dut.version} <br><br>")
|
|
182
|
+
if test.tester:
|
|
183
|
+
f.write(f"{SIM} {BLE_MAC_ADDRESS}: {test.tester.internal_brg.id_str} <br><br>")
|
|
184
|
+
f.write(f"{SIM} {BLE_VER}: {test.tester.internal_brg.version} <br><br>")
|
|
185
|
+
|
|
141
186
|
f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
|
|
142
187
|
f.write(generate_tests_table(tests, html=True))
|
|
143
188
|
f.write("<br><br>")
|
|
@@ -146,11 +191,14 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
146
191
|
f.write("<img src='https://www.wiliot.com/src/img/svg/logo.svg' width='100' height='40' alt='Wiliot logo'>")
|
|
147
192
|
f.write(HTML_END)
|
|
148
193
|
f.close()
|
|
194
|
+
if pipeline:
|
|
195
|
+
# copy results for having it in the email
|
|
196
|
+
shutil.copy(file_path, os.path.join(os.getcwd(), UT_RESULT_FILE_HTML))
|
|
149
197
|
|
|
150
198
|
# Generate PDF file
|
|
151
199
|
if pdf:
|
|
152
|
-
doc = SimpleDocTemplate(os.path.join(
|
|
153
|
-
doc.title = "
|
|
200
|
+
doc = SimpleDocTemplate(os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_PDF), pagesize=letter)
|
|
201
|
+
doc.title = headline_get(non_cert_run, "Results")
|
|
154
202
|
elements, hdr_page = [], []
|
|
155
203
|
|
|
156
204
|
# Add Wiliot Logo
|
|
@@ -160,6 +208,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
160
208
|
|
|
161
209
|
# Title and Summary
|
|
162
210
|
red_header = STYLES_PDF.get("RED_HEADER", ParagraphStyle("Default"))
|
|
211
|
+
green_header = STYLES_PDF.get("GREEN_HEADER", ParagraphStyle("Default"))
|
|
163
212
|
black_header = STYLES_PDF.get("BLACK_HEADER", ParagraphStyle("Default"))
|
|
164
213
|
module_header = STYLES_PDF.get("MODULE_HEADER", ParagraphStyle("Default"))
|
|
165
214
|
test_header = STYLES_PDF.get("TEST_LINK_HEADER", ParagraphStyle("Default"))
|
|
@@ -168,37 +217,83 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
168
217
|
bold_right_text_style = STYLES_PDF.get("BLUE_BOLD_RIGHT", ParagraphStyle("Default"))
|
|
169
218
|
centered_text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
170
219
|
if error:
|
|
171
|
-
|
|
220
|
+
headline = headline_get(non_cert_run, "Error!")
|
|
221
|
+
title = Paragraph(f"<b>{headline}</b>", red_header)
|
|
172
222
|
hdr_page.append(title)
|
|
173
223
|
hdr_page.append(Spacer(1, 20))
|
|
174
224
|
hdr_page.append(Paragraph(f"{error}", bold_text_style))
|
|
175
225
|
else:
|
|
176
|
-
|
|
226
|
+
headline = headline_get(non_cert_run, "Results")
|
|
227
|
+
title = Paragraph(f"<b>{headline}</b>", black_header)
|
|
177
228
|
hdr_page.append(title)
|
|
229
|
+
|
|
230
|
+
# Add Passed/Failed status header
|
|
231
|
+
if not error:
|
|
232
|
+
is_passed = failures == 0
|
|
233
|
+
status_text = "Passed" if is_passed else "Failed"
|
|
234
|
+
status_header_style = green_header if is_passed else red_header
|
|
235
|
+
status_header = Paragraph(f"<b>{status_text}</b>", status_header_style)
|
|
236
|
+
hdr_page.append(Spacer(1, 10))
|
|
237
|
+
hdr_page.append(status_header)
|
|
238
|
+
|
|
178
239
|
hdr_page.append(Spacer(1, 20))
|
|
179
240
|
hdr_page.append(Paragraph(f"<a name='{SUMMARY_HEADLINE}'/><b>{SUMMARY_HEADLINE}</b>", module_header))
|
|
180
|
-
hdr_page.append(Spacer(1,
|
|
241
|
+
hdr_page.append(Spacer(1, 10))
|
|
181
242
|
hdr_page.append(Paragraph(f"<u>{RUN_INFO}:</u>", bold_text_style))
|
|
182
243
|
hdr_page.append(Paragraph(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')}", bold_text_style))
|
|
183
244
|
hdr_page.append(Paragraph(f"{RUN_DUR}: {str(duration).split('.')[0]}", bold_text_style))
|
|
184
245
|
hdr_page.append(Paragraph(f"{CERT_VER}: {CERT_VERSION}", bold_text_style))
|
|
185
246
|
hdr_page.append(Spacer(1, 10))
|
|
186
|
-
if
|
|
247
|
+
if test:
|
|
187
248
|
hdr_page.append(Paragraph(f"<u>{TESTED_DEVICE_INFO}:</u>", bold_text_style))
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
249
|
+
if test.dut_is_gateway():
|
|
250
|
+
hdr_page.append(Paragraph(f"{GATEWAY} ID: {test.dut.id_str}", bold_text_style))
|
|
251
|
+
hdr_page.append(Paragraph(f"{GATEWAY} {SUP_API_VER}: {test.dut.gw_api_version}", bold_text_style))
|
|
252
|
+
hdr_page.append(Paragraph(f"{GATEWAY} {SERIALIZATION_FORMAT}: {PROTOBUF if test.dut.protobuf else JSON}", bold_text_style))
|
|
253
|
+
if test.dut_is_combo() or test.dut_is_bridge():
|
|
254
|
+
brg = test.dut.internal_brg if test.dut_is_combo() else test.dut
|
|
255
|
+
hdr_page.append(Paragraph(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str}", bold_text_style))
|
|
256
|
+
hdr_page.append(Paragraph(f"{BRG} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[brg.board_type]}", bold_text_style))
|
|
257
|
+
hdr_page.append(Paragraph(f"{BRG} {BLE_VER}: {brg.version}", bold_text_style))
|
|
258
|
+
hdr_page.append(Paragraph(f"{BRG} {SUP_API_VER}: {brg.api_version}", bold_text_style))
|
|
192
259
|
hdr_page.append(Spacer(1, 10))
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
260
|
+
|
|
261
|
+
# In wlt-cert-reg there is no tester
|
|
262
|
+
if test.tester:
|
|
263
|
+
hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
|
|
264
|
+
hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {test.tester.internal_brg.id_str}", bold_text_style))
|
|
265
|
+
hdr_page.append(Paragraph(f"{SIM} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[test.tester.internal_brg.board_type]}", bold_text_style))
|
|
266
|
+
hdr_page.append(Paragraph(f"{SIM} {BLE_VER}: {test.tester.internal_brg.version}", bold_text_style))
|
|
267
|
+
hdr_page.append(Spacer(1, 10))
|
|
268
|
+
notes_file_path = os.path.join(ARTIFACTS_DIR, RESULT_NOTES_FILE)
|
|
269
|
+
if os.path.exists(notes_file_path):
|
|
270
|
+
hdr_page.append(Paragraph(f"<u>{ADD_INFO}:</u>", bold_text_style))
|
|
271
|
+
with open(notes_file_path, 'r') as f:
|
|
272
|
+
for line in f.readlines():
|
|
273
|
+
hdr_page.append(Paragraph(f"{line}", bold_text_style))
|
|
274
|
+
|
|
275
|
+
hdr_page.append(Spacer(1, 15))
|
|
276
|
+
|
|
277
|
+
# Analyze results per module and generate results per module for PDF
|
|
278
|
+
results_per_module = generate_results_per_module_for_pdf(tests=tests)
|
|
279
|
+
|
|
280
|
+
# Modules Table
|
|
281
|
+
hdr_page.append(Paragraph(f"<b>Modules Overview</b>", module_header))
|
|
282
|
+
hdr_page.append(Spacer(1, 15))
|
|
283
|
+
modules_overview = get_modules_overview(results_per_module)
|
|
284
|
+
module_stats_table_data = []
|
|
285
|
+
for module_name, status in modules_overview.items():
|
|
286
|
+
module_stats_table_data.append([Paragraph(module_name, centered_text_style), pdf_result_map[status]])
|
|
287
|
+
module_stats_table = Table([["Module", "Status"]] + module_stats_table_data, colWidths=[100, 100])
|
|
288
|
+
module_stats_table.setStyle(inner_table_style('CENTER'))
|
|
289
|
+
hdr_page.append(module_stats_table)
|
|
290
|
+
hdr_page.append(PageBreak())
|
|
291
|
+
|
|
292
|
+
# Tests Tables
|
|
293
|
+
hdr_page.append(Paragraph(f"<b>Tests Overview</b>", module_header))
|
|
199
294
|
hdr_page.append(Spacer(1, 20))
|
|
200
295
|
|
|
201
|
-
# Count Table
|
|
296
|
+
# Tests Count Table
|
|
202
297
|
count_data = [
|
|
203
298
|
["PASSED", "SKIPPED", "FAILED", "TOTAL"],
|
|
204
299
|
[len(tests)-(failures+skipped), skipped, failures, len(tests)]
|
|
@@ -206,27 +301,27 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
206
301
|
count_table = Table(count_data)
|
|
207
302
|
count_table.setStyle(inner_table_style('CENTER'))
|
|
208
303
|
hdr_page.append(count_table)
|
|
209
|
-
hdr_page.append(Spacer(1,
|
|
210
|
-
|
|
211
|
-
#
|
|
212
|
-
results_per_module = generate_results_per_module_for_pdf(tests=tests)
|
|
304
|
+
hdr_page.append(Spacer(1, 10))
|
|
305
|
+
|
|
306
|
+
# Tests Results Table
|
|
213
307
|
summary_data = []
|
|
214
308
|
for module, test_results in results_per_module.items():
|
|
215
309
|
module_objects = []
|
|
216
310
|
module_skipped = True # Remains True if all tests are skipped
|
|
217
|
-
module_objects.append(Paragraph(f"<b>{module + ' Module' if not 'Edge' in module else module}</b>", module_header))
|
|
311
|
+
module_objects.append(Paragraph(f"<b>{module + ' Module' if (not 'Edge' in module and not 'Cloud' in module) else module}</b>", module_header))
|
|
218
312
|
module_objects.append(Spacer(1, 20))
|
|
219
313
|
for test_result in test_results:
|
|
314
|
+
test_skipped = test_result.rc == TEST_SKIPPED
|
|
220
315
|
test_objects = []
|
|
221
|
-
name = Paragraph(f'<a href="#{module}_{test_result.name}">{test_result.name}</a>', centered_text_style) if not
|
|
222
|
-
summary_data += [[module, name, test_result
|
|
316
|
+
name = Paragraph(f'<a href="#{module}_{test_result.name}">{test_result.name}</a>', centered_text_style) if not test_skipped else test_result.name
|
|
317
|
+
summary_data += [[module, name, pass_or_fail_pdf(test_result), test_result.compliance]]
|
|
223
318
|
test_objects.append(Paragraph(f'<a name="{module}_{test_result.name}"/><a href="{test_result.kb_link}">{test_result.name}</a>', test_header))
|
|
224
319
|
test_objects.append(Spacer(1, 10))
|
|
225
|
-
test_objects.append(test_result
|
|
320
|
+
test_objects.append(pass_or_fail_pdf(test_result))
|
|
226
321
|
test_objects.append(Spacer(1, 10))
|
|
227
322
|
test_objects.append(Paragraph(test_result.purpose, test_purpose))
|
|
228
323
|
test_objects.append(Spacer(1, 10))
|
|
229
|
-
if not
|
|
324
|
+
if not test_skipped:
|
|
230
325
|
module_skipped = False # Set to False if at least one test isn't skipped
|
|
231
326
|
test_objects.append(Paragraph(f"Tested devices: {test_result.devices}", bold_text_style))
|
|
232
327
|
test_objects.append(Paragraph(f"Test duration: {test_result.duration}", bold_text_style))
|
|
@@ -245,6 +340,49 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
245
340
|
|
|
246
341
|
doc.build(elements)
|
|
247
342
|
|
|
343
|
+
# Upload pipeline results to DB
|
|
344
|
+
if pipeline:
|
|
345
|
+
import boto3
|
|
346
|
+
import json
|
|
347
|
+
import io
|
|
348
|
+
from botocore.exceptions import ClientError
|
|
349
|
+
|
|
350
|
+
if test:
|
|
351
|
+
device_id = f"{test.dut.id_str}:{test.dut.internal_brg.id_str}" if test.dut_is_combo() else test.dut.id_str
|
|
352
|
+
version = test.dut.internal_brg.version if test.dut_is_combo() else test.dut.version
|
|
353
|
+
else:
|
|
354
|
+
device_id = "NO_ID"
|
|
355
|
+
version = "0.0.0"
|
|
356
|
+
json_data = {
|
|
357
|
+
"setup_name": os.environ['PIPELINE_NAME'],
|
|
358
|
+
"device_id": device_id,
|
|
359
|
+
"version": version,
|
|
360
|
+
"run_type": os.environ['PIPELINE_TYPE'],
|
|
361
|
+
"pipeline_url": f"https://bitbucket.org/wiliot/wiliot-nordic-firmware/pipelines/results/{os.environ['BITBUCKET_BUILD_NUMBER']}",
|
|
362
|
+
"run_datetime": str(datetime.datetime.now(zoneinfo.ZoneInfo("Asia/Jerusalem"))),
|
|
363
|
+
"passed_tests": len(tests)-(failures+skipped),
|
|
364
|
+
"failed_tests": failures,
|
|
365
|
+
"skipped_tests": skipped,
|
|
366
|
+
"total_tests": len(tests),
|
|
367
|
+
"run_time_seconds": duration.total_seconds(),
|
|
368
|
+
"tests": generate_results_for_db(tests)
|
|
369
|
+
}
|
|
370
|
+
print(json_data)
|
|
371
|
+
|
|
372
|
+
# upload to S3
|
|
373
|
+
timestamp = datetime.datetime.now().strftime("%d_%m_%Y_%H_%M_%S_%f")[:-3]
|
|
374
|
+
key = f"triggers/projects/fm-certificate/pending/{timestamp}/payload/data.json"
|
|
375
|
+
bucket = "wiliot-systemlab"
|
|
376
|
+
s3 = boto3.client("s3", region_name="us-east-1",
|
|
377
|
+
aws_access_key_id=os.environ['DB_AWS_ACCESS_KEY'],
|
|
378
|
+
aws_secret_access_key=os.environ['DB_AWS_SECRET_ACCESS_KEY'])
|
|
379
|
+
|
|
380
|
+
try:
|
|
381
|
+
body = io.BytesIO(json.dumps(json_data).encode())
|
|
382
|
+
s3.upload_fileobj(body, bucket, key)
|
|
383
|
+
print(f"Uploaded successfully to s3://{bucket}/{key}")
|
|
384
|
+
except ClientError as e:
|
|
385
|
+
print(f"S3 Error: {e}")
|
|
248
386
|
|
|
249
387
|
##################################
|
|
250
388
|
# HTML
|
|
@@ -261,7 +399,7 @@ COLORS_HTML = {
|
|
|
261
399
|
}
|
|
262
400
|
color_html = lambda c, t: f'<span style="{COLORS_HTML.get(c, "")}{COLORS_HTML["BOLD"]}">{t}</span>'
|
|
263
401
|
html_result_map = {TEST_FAILED: color_html("RED", "FAIL"), TEST_SKIPPED: color_html("WARNING", "SKIPPED"),
|
|
264
|
-
TEST_PASSED: color_html("GREEN", "PASS"),
|
|
402
|
+
TEST_PASSED: color_html("GREEN", "PASS"), TEST_ABORTED: color_html("RED", "ABORTED")}
|
|
265
403
|
pass_or_fail_html = lambda obj : html_result_map[obj.rc]
|
|
266
404
|
|
|
267
405
|
HTML_START = """
|
|
@@ -270,7 +408,7 @@ HTML_START = """
|
|
|
270
408
|
<head>
|
|
271
409
|
<meta charset='utf-8'>
|
|
272
410
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
|
273
|
-
<title>
|
|
411
|
+
<title>{}</title>
|
|
274
412
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
|
275
413
|
<style>
|
|
276
414
|
html, body {{
|
|
@@ -325,6 +463,8 @@ HTML_END = """
|
|
|
325
463
|
STYLES_PDF = {
|
|
326
464
|
"BLACK_HEADER": ParagraphStyle("Black Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.black, alignment=TA_CENTER),
|
|
327
465
|
"RED_HEADER": ParagraphStyle("Red Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.red, alignment=TA_CENTER),
|
|
466
|
+
"GREEN_HEADER": ParagraphStyle("Green Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.green, alignment=TA_CENTER),
|
|
467
|
+
"GRAY": ParagraphStyle("Gray", fontName="Helvetica-Bold", fontSize=9, textColor=colors.grey, splitLongWords=False, alignment=TA_LEFT, wordWrap = 'CJK'),
|
|
328
468
|
"MODULE_HEADER": ParagraphStyle("Module Header", fontName="Helvetica-Bold", fontSize=16, textColor=colors.navy, alignment=TA_CENTER),
|
|
329
469
|
"TEST_HEADER": ParagraphStyle("Test Header", fontName="Helvetica-Bold", fontSize=12, textColor=colors.black, alignment=TA_LEFT),
|
|
330
470
|
"TEST_LINK_HEADER": ParagraphStyle('Test Link Header', fontName="Helvetica-Bold", fontSize=14, textColor=colors.blue, alignment=TA_LEFT),
|
|
@@ -341,7 +481,8 @@ def color_pdf(c, t):
|
|
|
341
481
|
style = STYLES_PDF.get(c, ParagraphStyle("Default"))
|
|
342
482
|
return Paragraph(t, style)
|
|
343
483
|
pdf_result_map = {TEST_FAILED: color_pdf("RED", "FAILED"), TEST_SKIPPED: color_pdf("WARNING", "SKIPPED"),
|
|
344
|
-
TEST_PASSED: color_pdf("GREEN", "PASSED"),
|
|
484
|
+
TEST_PASSED: color_pdf("GREEN", "PASSED"), TEST_ABORTED: color_pdf("RED", "ABORTED"),
|
|
485
|
+
MODULE_UNSUPPORTED: color_pdf("GRAY", "UNSUPPORTED")}
|
|
345
486
|
pass_or_fail_pdf = lambda obj : pdf_result_map[obj.rc]
|
|
346
487
|
|
|
347
488
|
inner_table_style = lambda align : TableStyle([
|
|
@@ -356,22 +497,57 @@ inner_table_style = lambda align : TableStyle([
|
|
|
356
497
|
('WORDWRAP', (0, 0), (-1, -1), False),
|
|
357
498
|
])
|
|
358
499
|
|
|
500
|
+
def get_modules_overview(results_per_module):
|
|
501
|
+
"""Get modules overview for the tests."""
|
|
502
|
+
modules_overview = {}
|
|
503
|
+
for module_name in MODULE_SCHEMA_NAMES_LIST:
|
|
504
|
+
if module_name in results_per_module: # Module is in run - check if it passed/failed/skipped
|
|
505
|
+
test_results = results_per_module[module_name]
|
|
506
|
+
modules_overview[module_name] = TEST_SKIPPED # Assume all tests are skipped until proven otherwise
|
|
507
|
+
for test_result in test_results:
|
|
508
|
+
# If any test failed, the module failed
|
|
509
|
+
if test_result.rc == TEST_FAILED:
|
|
510
|
+
modules_overview[module_name] = TEST_FAILED
|
|
511
|
+
break
|
|
512
|
+
# If any test passed, the module passed until proven otherwise
|
|
513
|
+
elif test_result.rc == TEST_PASSED:
|
|
514
|
+
modules_overview[module_name] = TEST_PASSED
|
|
515
|
+
# If any mandatory test is skipped, the module is skipped
|
|
516
|
+
elif test_result.rc == TEST_SKIPPED and test_result.compliance == "Mandatory":
|
|
517
|
+
modules_overview[module_name] = TEST_SKIPPED
|
|
518
|
+
else: # Module not in run - show as Unsupported
|
|
519
|
+
modules_overview[module_name] = MODULE_UNSUPPORTED
|
|
520
|
+
return modules_overview
|
|
521
|
+
|
|
522
|
+
|
|
359
523
|
def generate_results_per_module_for_pdf(tests=[]):
|
|
360
524
|
text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
361
525
|
results_per_module = {}
|
|
362
526
|
for test in tests:
|
|
363
|
-
devices_to_print = (test.
|
|
364
|
-
(f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
|
|
527
|
+
devices_to_print = (f"{test.dut.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.dut.id_str)
|
|
365
528
|
inner_table = [[Paragraph(param_name_to_title(phase.name), text_style), pass_or_fail_pdf(phase), Paragraph(phase.reason, text_style)] for phase in test.phases]
|
|
366
529
|
test_table = Table([["Phase", "Result", "Notes"]] + inner_table)
|
|
367
530
|
test_table.setStyle(inner_table_style('LEFT'))
|
|
368
531
|
compliance = "Mandatory" if test.test_json[MANDATORY] else "Optional"
|
|
369
|
-
test_result = TestResult(name=test.test_json[NAME], devices_to_print=devices_to_print, test_table=test_table,
|
|
370
|
-
duration=test.duration, purpose=str(test.test_json[PURPOSE]), compliance=compliance,
|
|
371
|
-
kb_link=test.test_json[DOCUMENTATION], test_skipped=(test.rc == TEST_SKIPPED))
|
|
532
|
+
test_result = TestResult(name=test.test_json[NAME], devices_to_print=devices_to_print, test_table=test_table, rc=test.rc,
|
|
533
|
+
duration=test.duration, purpose=str(test.test_json[PURPOSE]), compliance=compliance, kb_link=test.test_json[DOCUMENTATION])
|
|
372
534
|
module_name = test.test_json[MODULE]
|
|
373
535
|
if module_name not in results_per_module:
|
|
374
536
|
results_per_module[module_name] = [test_result]
|
|
375
537
|
else:
|
|
376
538
|
results_per_module[module_name] += [test_result]
|
|
377
539
|
return results_per_module
|
|
540
|
+
|
|
541
|
+
def generate_results_for_db(tests=[]):
|
|
542
|
+
results = []
|
|
543
|
+
for test in tests:
|
|
544
|
+
internal_brg_txt = " (internal brg)" if test.internal_brg else ""
|
|
545
|
+
result = {
|
|
546
|
+
"module_name": test.test_json[MODULE],
|
|
547
|
+
"test_name": test.test_json[NAME] + internal_brg_txt,
|
|
548
|
+
"result": pass_or_fail_txt(test),
|
|
549
|
+
"run_time": test.duration,
|
|
550
|
+
}
|
|
551
|
+
result["phases"] = [{"phase_name": param_name_to_title(phase.name), "result": pass_or_fail_txt(phase), "notes": phase.reason} for phase in test.phases]
|
|
552
|
+
results.append(result)
|
|
553
|
+
return results
|