wiliot-certificate 4.4.3__py3-none-any.whl → 4.5.0a1__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.
Files changed (295) hide show
  1. {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
  2. {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
  3. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2brg_ota.json +69 -0
  4. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb.json +109 -0
  5. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +45 -0
  6. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/calibration.json +96 -0
  7. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/custom.json +99 -0
  8. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/datapath.json +241 -13
  9. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energy2400.json +120 -0
  10. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energySub1g.json +96 -0
  11. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/externalSensor.json +135 -6
  12. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/interface.json +157 -0
  13. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/powerManagement.json +205 -0
  14. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json → certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +27 -11
  15. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
  16. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
  17. certificate/cert_common.py +1459 -0
  18. certificate/cert_config.py +455 -0
  19. {brg_certificate → certificate}/cert_data_sim.py +131 -46
  20. {brg_certificate → certificate}/cert_defines.py +120 -128
  21. {brg_certificate → certificate}/cert_gw_sim.py +151 -49
  22. {brg_certificate → certificate}/cert_mqtt.py +164 -59
  23. {brg_certificate → certificate}/cert_prints.py +34 -33
  24. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  25. {brg_certificate → certificate}/cert_results.py +205 -48
  26. certificate/cert_utils.py +622 -0
  27. certificate/certificate.py +198 -0
  28. certificate/certificate_cli.py +79 -0
  29. certificate/certificate_eth_test_list.txt +74 -0
  30. certificate/certificate_sanity_test_list.txt +65 -0
  31. certificate/certificate_test_list.txt +75 -0
  32. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +2 -2
  33. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  34. certificate/tests/calibration/output_power_test/output_power_test.json +22 -0
  35. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  36. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +1 -1
  37. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  38. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +14 -0
  39. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  40. certificate/tests/cloud_connectivity/acl_test/acl_test.json +14 -0
  41. certificate/tests/cloud_connectivity/acl_test/acl_test.py +98 -0
  42. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +18 -0
  43. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +39 -0
  44. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +18 -0
  45. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  46. certificate/tests/cloud_connectivity/connection_test/connection_test.json +17 -0
  47. certificate/tests/cloud_connectivity/connection_test/connection_test.py +74 -0
  48. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +20 -0
  49. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +204 -0
  50. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +16 -0
  51. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +98 -0
  52. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +17 -0
  53. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +57 -0
  54. certificate/tests/cloud_connectivity/registration_test/registration_test.json +19 -0
  55. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  56. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  57. certificate/tests/cloud_connectivity/stress_test/stress_test.json +16 -0
  58. certificate/tests/cloud_connectivity/stress_test/stress_test.py +97 -0
  59. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +24 -0
  60. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +93 -0
  61. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +19 -0
  62. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +161 -0
  63. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +1 -1
  64. certificate/tests/datapath/aging_test/aging_test.py +138 -0
  65. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +16 -0
  66. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +95 -0
  67. certificate/tests/datapath/event_test/event_test.json +16 -0
  68. certificate/tests/datapath/event_test/event_test.py +85 -0
  69. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -1
  70. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +10 -8
  71. certificate/tests/datapath/output_power_test/output_power_test.json +22 -0
  72. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  73. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +1 -1
  74. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +10 -8
  75. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +1 -1
  76. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  77. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +2 -2
  78. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  79. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +19 -0
  80. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  81. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +1 -1
  82. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +11 -10
  83. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +18 -0
  84. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +83 -0
  85. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +1 -1
  86. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  87. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +1 -1
  88. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  89. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
  90. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  91. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +5 -4
  92. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  93. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  94. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  95. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +7 -7
  96. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +112 -72
  97. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +7 -7
  98. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  99. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +3 -3
  100. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +12 -11
  101. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +3 -3
  102. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +12 -11
  103. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -1
  104. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  105. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +14 -0
  106. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  107. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +14 -0
  108. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  109. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +14 -0
  110. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  111. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +14 -0
  112. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  113. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +15 -0
  114. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  115. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +14 -0
  116. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  117. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +14 -0
  118. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  119. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +14 -0
  120. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +41 -0
  121. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +2 -2
  122. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  123. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +1 -1
  124. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  125. certificate/tests/energy2400/output_power_test/output_power_test.json +22 -0
  126. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  127. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +1 -1
  128. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  129. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +25 -0
  130. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +378 -0
  131. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +3 -3
  132. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +97 -87
  133. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +23 -0
  134. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  135. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +1 -1
  136. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  137. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +1 -1
  138. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  139. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +1 -1
  140. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  141. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +4 -4
  142. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +455 -0
  143. certificate/wlt_types.py +122 -0
  144. {gw_certificate → common}/api_if/202/status.json +6 -0
  145. {gw_certificate → common}/api_if/203/status.json +6 -0
  146. {gw_certificate → common}/api_if/204/status.json +6 -0
  147. common/api_if/206/data.json +85 -0
  148. common/api_if/206/status.json +69 -0
  149. common/api_if/api_validation.py +85 -0
  150. common/web/templates/generator.html +148 -0
  151. common/web/templates/index.html +20 -0
  152. common/web/templates/menu.html +54 -0
  153. common/web/templates/parser.html +53 -0
  154. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  155. common/web/web_utils.py +377 -0
  156. {brg_certificate → common}/wltPb_pb2.py +14 -12
  157. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  158. gui_certificate/gui_certificate_cli.py +14 -0
  159. gui_certificate/server.py +1062 -0
  160. gui_certificate/templates/cert_run.html +1207 -0
  161. wiliot_certificate-4.5.0a1.dist-info/METADATA +110 -0
  162. wiliot_certificate-4.5.0a1.dist-info/RECORD +182 -0
  163. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/WHEEL +1 -1
  164. wiliot_certificate-4.5.0a1.dist-info/entry_points.txt +5 -0
  165. wiliot_certificate-4.5.0a1.dist-info/top_level.txt +3 -0
  166. brg_certificate/ag/energous_v0_defines.py +0 -925
  167. brg_certificate/ag/energous_v1_defines.py +0 -931
  168. brg_certificate/ag/energous_v2_defines.py +0 -925
  169. brg_certificate/ag/energous_v3_defines.py +0 -925
  170. brg_certificate/ag/energous_v4_defines.py +0 -925
  171. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  172. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  173. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  174. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  175. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  176. brg_certificate/brg_certificate.py +0 -225
  177. brg_certificate/brg_certificate_cli.py +0 -63
  178. brg_certificate/cert_common.py +0 -923
  179. brg_certificate/cert_config.py +0 -402
  180. brg_certificate/cert_utils.py +0 -362
  181. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  182. brg_certificate/certificate_bcc_test_list.txt +0 -48
  183. brg_certificate/certificate_sanity_test_list.txt +0 -43
  184. brg_certificate/certificate_test_list.txt +0 -53
  185. brg_certificate/config/eclipse.json +0 -10
  186. brg_certificate/config/hivemq.json +0 -10
  187. brg_certificate/config/mosquitto.json +0 -10
  188. brg_certificate/config/mosquitto.md +0 -95
  189. brg_certificate/config/wiliot-dev.json +0 -10
  190. brg_certificate/restore_brg.py +0 -61
  191. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  192. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  193. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  194. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  195. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  196. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  197. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  198. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  199. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  200. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  201. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  204. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  205. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  206. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  208. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  209. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  210. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  211. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  213. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  215. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  216. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  217. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  218. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  219. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  220. brg_certificate/wltPb_pb2.pyi +0 -234
  221. brg_certificate/wlt_types.py +0 -113
  222. gw_certificate/ag/ut_defines.py +0 -364
  223. gw_certificate/ag/wlt_types.py +0 -85
  224. gw_certificate/ag/wlt_types_ag.py +0 -5310
  225. gw_certificate/ag/wlt_types_data.py +0 -64
  226. gw_certificate/api/extended_api.py +0 -23
  227. gw_certificate/api_if/200/data.json +0 -106
  228. gw_certificate/api_if/200/status.json +0 -47
  229. gw_certificate/api_if/201/data.json +0 -98
  230. gw_certificate/api_if/201/status.json +0 -53
  231. gw_certificate/api_if/205/logs.json +0 -12
  232. gw_certificate/api_if/api_validation.py +0 -38
  233. gw_certificate/api_if/gw_capabilities.py +0 -54
  234. gw_certificate/cert_results.py +0 -145
  235. gw_certificate/common/analysis_data_bricks.py +0 -60
  236. gw_certificate/common/debug.py +0 -42
  237. gw_certificate/common/serialization_formatter.py +0 -93
  238. gw_certificate/common/utils.py +0 -8
  239. gw_certificate/common/utils_defines.py +0 -15
  240. gw_certificate/common/wltPb_pb2.py +0 -84
  241. gw_certificate/gw_certificate.py +0 -154
  242. gw_certificate/gw_certificate_cli.py +0 -87
  243. gw_certificate/interface/4.4.93_app.zip +0 -0
  244. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  245. gw_certificate/interface/ble_simulator.py +0 -61
  246. gw_certificate/interface/ble_sniffer.py +0 -189
  247. gw_certificate/interface/flash_fw.py +0 -90
  248. gw_certificate/interface/if_defines.py +0 -36
  249. gw_certificate/interface/mqtt.py +0 -563
  250. gw_certificate/interface/nrfutil-linux +0 -0
  251. gw_certificate/interface/nrfutil-mac +0 -0
  252. gw_certificate/interface/nrfutil.exe +0 -0
  253. gw_certificate/interface/pkt_generator.py +0 -594
  254. gw_certificate/interface/uart_if.py +0 -236
  255. gw_certificate/interface/uart_ports.py +0 -20
  256. gw_certificate/templates/results.html +0 -241
  257. gw_certificate/templates/stage.html +0 -22
  258. gw_certificate/templates/table.html +0 -6
  259. gw_certificate/templates/test.html +0 -38
  260. gw_certificate/tests/__init__.py +0 -10
  261. gw_certificate/tests/actions.py +0 -289
  262. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  263. gw_certificate/tests/connection.py +0 -188
  264. gw_certificate/tests/downlink.py +0 -172
  265. gw_certificate/tests/generic.py +0 -238
  266. gw_certificate/tests/registration.py +0 -340
  267. gw_certificate/tests/static/__init__.py +0 -0
  268. gw_certificate/tests/static/connection_defines.py +0 -9
  269. gw_certificate/tests/static/downlink_defines.py +0 -9
  270. gw_certificate/tests/static/generated_packet_table.py +0 -195
  271. gw_certificate/tests/static/packet_table.csv +0 -10067
  272. gw_certificate/tests/static/references.py +0 -5
  273. gw_certificate/tests/static/uplink_defines.py +0 -14
  274. gw_certificate/tests/throughput.py +0 -240
  275. gw_certificate/tests/uplink.py +0 -853
  276. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  277. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  278. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  279. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  280. {brg_certificate → certificate}/__init__.py +0 -0
  281. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -0
  282. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -0
  283. {gw_certificate → common}/api_if/202/data.json +0 -0
  284. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  285. {gw_certificate → common}/api_if/203/data.json +0 -0
  286. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/204/data.json +0 -0
  288. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/205/data.json +0 -0
  290. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/status.json +0 -0
  292. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  293. {gw_certificate → common/api_if}/__init__.py +0 -0
  294. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  295. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -1,9 +1,7 @@
1
- from brg_certificate.cert_defines import *
1
+ from certificate.cert_defines import *
2
2
  import time, datetime
3
3
  import sys
4
4
  import json
5
- import brg_certificate.cert_mqtt as cert_mqtt
6
- import brg_certificate.cert_data_sim as cert_data_sim
7
5
  import os
8
6
  import re
9
7
 
@@ -33,7 +31,14 @@ WIL_CERT_TEXT = r'''
33
31
  '''
34
32
 
35
33
  hex_str2int = lambda s : int(s, 16)
36
- print_brg = lambda brg: brg.__dict__ if brg else None
34
+
35
+ def write_to_log_file(file, txt, mode):
36
+ file_path = os.path.join(ARTIFACTS_DIR, file)
37
+ if not os.path.exists(os.path.dirname(file_path)):
38
+ os.makedirs(os.path.dirname(file_path))
39
+ f = open(file_path, mode)
40
+ f.write(txt)
41
+ f.close()
37
42
 
38
43
  def print_pkt(p):
39
44
  print(datetime.datetime.now().strftime("%d/%m/%Y, %H:%M:%S"))
@@ -43,12 +48,16 @@ def print_warn(txt):
43
48
  if txt:
44
49
  utPrint(f"WARNING: {txt}","WARNING")
45
50
 
46
- def mqtt_scan_start(test, duration):
47
- utPrint("Scanning mqtt packets on {} for {} seconds...".format(test.gw, duration), "WARNING")
51
+ def mqtt_scan_start(test, duration, target=DUT):
52
+ gw = test.dut if target == DUT else test.tester
53
+ utPrint("Scanning mqtt packets on {} for {} seconds...".format(gw.id_str, duration), "WARNING")
48
54
  sys.stdout.flush()
49
55
 
50
- def mqtt_scan_wait(test, duration):
51
- utPrint("Scanning mqtt packets on {} for {} seconds...".format(test.gw, duration), "WARNING")
56
+
57
+ def mqtt_scan_wait(test, duration, target=DUT):
58
+ mqttc = test.get_mqttc_by_target(target)
59
+ gw = test.dut if target == DUT else test.tester
60
+ utPrint("Scanning mqtt packets on {} for {} seconds...".format(gw.id_str, duration), "WARNING")
52
61
  sys.stdout.flush()
53
62
  chars = ["|", "/", "-", "\\"]
54
63
  start_time = datetime.datetime.now()
@@ -60,22 +69,26 @@ def mqtt_scan_wait(test, duration):
60
69
  if pipeline_running():
61
70
  sys.stdout.write(".")
62
71
  else:
63
- sys.stdout.write("\r"+chars[i%4]*20+" "+str(cur_duration)+" "+chars[i%4]*20+" {} pkts captured".format(len(test.mqttc._userdata["pkts"].data)))
72
+ sys.stdout.write("\r"+chars[i%4]*20+" "+str(cur_duration)+" "+chars[i%4]*20+" {} pkts captured".format(len(mqttc._userdata[PKTS].data)))
64
73
  sys.stdout.flush()
65
74
  time.sleep(0.25)
66
75
  i += 1
67
76
  print("\n")
68
77
 
69
- def mqtt_scan_n_create_log_file(test, duration, phase):
70
- test.mqttc.flush_pkts()
71
- mqtt_scan_wait(test, duration=duration)
72
- generate_log_file(test, phase)
73
78
 
74
79
  def print_update_wait(secs=1):
75
80
  sys.stdout.write(".")
76
81
  sys.stdout.flush()
77
82
  time.sleep(secs)
78
83
 
84
+ def wait_time_n_print(secs, txt=""):
85
+ if txt:
86
+ utPrint(txt, "CYAN")
87
+ utPrint(f"Waiting for {secs} seconds", "CYAN")
88
+ while secs:
89
+ print_update_wait()
90
+ secs -= 1
91
+
79
92
  def field_functionality_pass_fail_print(test, field, value=""):
80
93
  print_string = f"{field}={value}"
81
94
  if value == "":
@@ -105,11 +118,11 @@ def test_run_print(test):
105
118
  test_json_print(test)
106
119
  utPrint("Test Configuration:", "HEADER")
107
120
  params = [{'name':p.name, 'value':p.value} for p in test.params]
108
- utPrint(f""" - internal_brg={test.internal_brg}\n - brg0={print_brg(test.brg0)}
109
- - brg1={print_brg(test.brg1)}\n - active_brg={print_brg(test.active_brg)}
121
+ utPrint(f""" - internal_brg={test.internal_brg}\n - tester={test.tester}
122
+ - dut={test.dut}\n - brg1={test.brg1}\n - active_brg={test.active_brg}
110
123
  - params={params}\n""")
111
- cert_mqtt.write_to_mqtt_log_file(log_txt)
112
- cert_data_sim.write_to_data_sim_log_file(log_txt)
124
+ write_to_log_file(DATA_SIM_LOG_FILE, log_txt, "a")
125
+ write_to_log_file(CERT_MQTT_LOG_FILE, log_txt, "a")
113
126
 
114
127
  def test_json_print(test):
115
128
  for key, value in test.test_json.items():
@@ -131,14 +144,14 @@ def test_epilog_print(test):
131
144
  def functionality_run_print(func):
132
145
  txt = "{0}==>> Running {1}\n".format(SEP, func)
133
146
  utPrint(txt, "CYAN")
134
- cert_mqtt.write_to_mqtt_log_file(txt)
135
- cert_data_sim.write_to_data_sim_log_file(txt)
147
+ write_to_log_file(DATA_SIM_LOG_FILE, txt, "a")
148
+ write_to_log_file(CERT_MQTT_LOG_FILE, txt, "a")
136
149
 
137
150
  def phase_run_print(func):
138
151
  txt = f"{SEP2}==>> Phase {func}{SEP2}\n"
139
152
  utPrint(txt, "CYAN")
140
- cert_mqtt.write_to_mqtt_log_file(txt)
141
- cert_data_sim.write_to_data_sim_log_file(txt)
153
+ write_to_log_file(DATA_SIM_LOG_FILE, txt, "a")
154
+ write_to_log_file(CERT_MQTT_LOG_FILE, txt, "a")
142
155
 
143
156
 
144
157
  def generate_print_string(fields_and_values):
@@ -147,18 +160,6 @@ def generate_print_string(fields_and_values):
147
160
  list_to_print.append(str(f) + "=" + str(fields_and_values[f]))
148
161
  return " & ".join(list_to_print)
149
162
 
150
- def generate_log_file(test, val):
151
- if type(val) == int or type(val) == str:
152
- log_string = str(val)
153
- else:
154
- log_string = str(val[0])
155
- for i in range(1,len(val)):
156
- log_string += ","+ str(val[i])
157
- if test.internal_brg:
158
- log_string += "_internal_brg"
159
-
160
- cert_mqtt.dump_pkts(test, log=log_string)
161
-
162
163
  ENERGY_GRAPH_HTML = """
163
164
  <h1 style="color:blue;text-align:center;">{}</h1>
164
165
  <div style="width:80%;margin:auto;"><canvas id="myChart"></canvas></div>
@@ -1,7 +1,7 @@
1
1
 
2
- from brg_certificate.cert_defines import *
2
+ from certificate.cert_defines import *
3
3
 
4
- import brg_certificate.wltPb_pb2 as wpb
4
+ import common.wltPb_pb2 as wpb
5
5
 
6
6
  def action_pb(msg: dict):
7
7
  pb_msg = wpb.DownlinkMessage()
@@ -15,6 +15,13 @@ def tx_pkt_pb(msg: dict):
15
15
  pb_msg.txPacket.maxRetries = int(msg[TX_MAX_RETRIES])
16
16
  return pb_msg.SerializeToString()
17
17
 
18
+ def gw_ota_pb(msg: dict):
19
+ pb_msg = wpb.DownlinkMessage()
20
+ pb_msg.gatewayUpgrade.imageDirUrl = msg[IMG_DIR_URL]
21
+ pb_msg.gatewayUpgrade.interfaceSwVersion = msg[WIFI_VERSION]
22
+ pb_msg.gatewayUpgrade.bleSwVersion = msg[BLE_VERSION]
23
+ return pb_msg.SerializeToString()
24
+
18
25
  def brg_ota_pb(msg: dict):
19
26
  pb_msg = wpb.DownlinkMessage()
20
27
  pb_msg.bridgeUpgrade.bridgeId = msg[BRIDGE_ID]
@@ -36,8 +43,8 @@ def gw_cfg_pb(msg: dict):
36
43
  pb_msg.gatewayConfig.bleSwVersion = msg[BLE_VERSION]
37
44
 
38
45
  for key, val in msg[ADDITIONAL].items():
39
- # Skip GW_MODE since it doesn't exist today and harm the parsing in PB, and skip lat & lng to create duplicate values
40
- if key == GW_MODE or key == LAT or key == LNG:
46
+ # Skip lat & lng to create duplicate values
47
+ if key == LAT or key == LNG:
41
48
  continue
42
49
  pb_value = wpb.GatewayConfigValue()
43
50
  if type(val) is int:
@@ -79,10 +86,12 @@ def custom_message_pb(msg: dict):
79
86
 
80
87
  def downlink_to_pb(msg: dict):
81
88
  if ACTION in msg.keys():
82
- if msg[ACTION] == 0:
89
+ if msg[ACTION] == ACTION_ADVERTISING:
83
90
  return tx_pkt_pb(msg)
84
- elif msg[ACTION] == 1:
91
+ elif msg[ACTION] == ACTION_BRG_OTA:
85
92
  return brg_ota_pb(msg)
93
+ elif msg[ACTION] == ACTION_GW_OTA:
94
+ return gw_ota_pb(msg)
86
95
  else:
87
96
  return action_pb(msg)
88
97
  elif GW_CONF in msg.keys():
@@ -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 brg_certificate.cert_utils as cert_utils
13
- import brg_certificate.cert_prints as cert_prints
14
- from brg_certificate.wlt_types import *
15
- from brg_certificate.cert_defines import *
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 Results"
23
- WLT_CERT_PASS_HEADLINE = "Wiliot Certificate Passed!"
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"
@@ -36,24 +36,31 @@ BLE_MAC_ADDRESS = "BLE MAC Address"
36
36
  BOARD_TYPE = "Board Type"
37
37
  BLE_VER = "BLE Version"
38
38
  SUP_API_VER = "Supported API Version"
39
+ # TODO: This is a temporary list of all schema module names - remove this when auto generated
40
+ MODULE_SCHEMA_NAMES_LIST = ["Cloud Connectivity", "Edge Management", "Calibration", "Datapath", "Energizer 2.4GHz",
41
+ "Energizer Sub-1GHz", "Power Management", "BLE Sensor", "Custom"]
39
42
 
40
43
  result_map = {TEST_FAILED: cert_prints.color("RED", "FAIL"), TEST_SKIPPED: cert_prints.color("WARNING", "SKIPPED"),
41
- TEST_PASSED: cert_prints.color("GREEN", "PASS"), TEST_INIT: cert_prints.color("CYAN", "INIT")}
44
+ TEST_PASSED: cert_prints.color("GREEN", "PASS"), TEST_ABORTED: cert_prints.color("RED", "ABORTED")}
42
45
  pass_or_fail = lambda obj : result_map[obj.rc]
46
+
47
+ result_map_txt = {TEST_FAILED: "FAIL", TEST_SKIPPED: "SKIPPED", TEST_PASSED: "PASS", TEST_ABORTED: "ABORTED"}
48
+ pass_or_fail_txt = lambda obj : result_map_txt[obj.rc]
49
+
43
50
  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
51
+ headline_get = lambda non_cert_run, suffix : WLT_NON_CERT_HEADLINE.format(suffix) if non_cert_run else WLT_CERT_HEADLINE.format(suffix)
44
52
 
45
53
  class TestResult:
46
- def __init__(self, name="", devices_to_print="", test_table=None, result=None, duration=0, purpose="", kb_link="", compliance="", test_skipped=False):
54
+ def __init__(self, name="", devices_to_print="", test_table=None, duration=0, purpose="", kb_link="", compliance="", rc=TEST_PASSED):
47
55
  self.name = name
48
56
  self.devices = devices_to_print
49
- self.result = result
50
57
  self.test_table = test_table
51
58
  self.duration = duration
52
59
  self.purpose = purpose
53
60
  self.kb_link = kb_link
54
61
  self.compliance = compliance
55
- self.test_skipped = test_skipped
56
-
62
+ self.rc = rc
63
+
57
64
  def __repr__(self):
58
65
  return self.name
59
66
 
@@ -63,13 +70,14 @@ def generate_tests_table(tests=[], html=False):
63
70
  _pass_or_fail = pass_or_fail_html if html else pass_or_fail
64
71
  tests_results = []
65
72
  for test in tests:
66
- brgs_to_print = (test.gw if not test.brg0 or test.gw_only else
67
- (f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
73
+ dut_to_print = (test.dut.internal_brg.id_str if isinstance(test.dut, cert_utils.Gateway) and test.dut.has_internal_brg()
74
+ else test.dut.id_str)
75
+ dut_to_print += f"\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else ""
68
76
  inner_table = [[phase.name, _pass_or_fail(phase), phase.reason] for phase in test.phases]
69
77
  result_breakdown_table = tabulate.tabulate(inner_table, headers=["Phase", "Result", "Notes"], tablefmt=inner_format)
70
78
  tests_results.append([cert_utils.module2name(test.test_module),
71
79
  test.module_name if (not test.internal_brg or "gw" in test.module_name) else f"{test.module_name} (internal brg)",
72
- brgs_to_print,
80
+ dut_to_print,
73
81
  result_breakdown_table,
74
82
  _pass_or_fail(test),
75
83
  test.duration])
@@ -100,18 +108,51 @@ def get_update_status_from_log_file(log_file="update_log.txt"):
100
108
  break
101
109
  return update_status
102
110
 
103
- def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), duration=0, brg=None, internal_brg=None, tests=[], error=None, pipeline=False):
111
+ def get_important_tests_info():
112
+ patterns = ["DISCONNECTED", "WLT_ERROR", "free heap size", "python_mqtt_disconnect"]
113
+ 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])])
114
+
115
+ def generate_results_files(dut=None, tester=None, html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), tests=[], error=None, non_cert_run=False):
116
+ print(cert_prints.SEP)
117
+ duration = (datetime.datetime.now()-start_time)
118
+ print("Tests duration: {}".format(str(duration).split(".")[0]))
119
+ pipeline = cert_prints.pipeline_running()
120
+ brg = None
121
+ if dut:
122
+ brg = dut.internal_brg if isinstance(dut, cert_utils.Gateway) and dut.has_internal_brg() else dut
123
+ if isinstance(brg, cert_utils.Bridge):
124
+ print("Bridge version: {}".format(brg.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
+ run_type = headline_get(non_cert_run, "").strip()
132
+ cert_prints.print_pass_or_fail(not failures and not error, run_type)
133
+
134
+ # Get internal_brg from dut or tester
135
+ internal_brg = None
136
+ if dut and isinstance(dut, cert_utils.Gateway) and dut.has_internal_brg():
137
+ internal_brg = dut.internal_brg
138
+ elif tester:
139
+ internal_brg = tester.internal_brg
140
+
104
141
  # Generate HTML file
105
142
  if html:
106
- f = open(os.path.join(BASE_DIR, UT_RESULT_FILE_HTML), "w", encoding="utf-8")
107
- f.write(HTML_START)
143
+ file_path = os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_HTML)
144
+ f = open(file_path, "w", encoding="utf-8")
145
+ html_title = headline_get(non_cert_run, "Results")
146
+ html_start_modified = HTML_START.format(html_title)
147
+ f.write(html_start_modified)
108
148
  update_status = get_update_status_from_log_file()
109
149
  if pipeline:
110
150
  p = subprocess.Popen('git log --format=%B -n 1 {}'.format(os.environ['BITBUCKET_COMMIT']),
111
151
  stdout=subprocess.PIPE, shell=True, cwd=os.environ['BITBUCKET_CLONE_DIR'])
112
152
  output, err = p.communicate()
113
153
  if error:
114
- f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_ERROR_HEADLINE}</h1><br>")
154
+ headline = headline_get(non_cert_run, "Error!")
155
+ f.write(f"<br><h1 style='color:#ab0000'>{headline}</h1><br>")
115
156
  if pipeline:
116
157
  f.write("<hr>" + output.decode("utf-8") + "<br>")
117
158
  f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
@@ -122,9 +163,11 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
122
163
  f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
123
164
  elif tests:
124
165
  if not failures and ("successfully!" in update_status or "skipped!" in update_status or not pipeline):
125
- f.write(f"<br><h1 style='color:#00AB83'>{WLT_CERT_PASS_HEADLINE}</h1>")
166
+ headline = headline_get(non_cert_run, "Passed!")
167
+ f.write(f"<br><h1 style='color:#00AB83'>{headline}</h1>")
126
168
  else:
127
- f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_FAIL_HEADLINE}</h1>")
169
+ headline = headline_get(non_cert_run, "Failed!")
170
+ f.write(f"<br><h1 style='color:#ab0000'>{headline}</h1>")
128
171
  if pipeline:
129
172
  f.write("<hr>" + output.decode("utf-8") + "<br>")
130
173
  f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
@@ -135,7 +178,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
135
178
  if internal_brg:
136
179
  f.write(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str} <br><br>")
137
180
  f.write(f"{SIM} {BLE_VER}: {internal_brg.version} <br><br>")
138
- if brg:
181
+ if isinstance(brg, cert_utils.Bridge):
139
182
  f.write(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str} <br><br>")
140
183
  f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
141
184
  f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
@@ -146,11 +189,14 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
146
189
  f.write("<img src='https://www.wiliot.com/src/img/svg/logo.svg' width='100' height='40' alt='Wiliot logo'>")
147
190
  f.write(HTML_END)
148
191
  f.close()
192
+ if pipeline:
193
+ # copy results for having it in the email
194
+ shutil.copy(file_path, os.path.join(os.getcwd(), UT_RESULT_FILE_HTML))
149
195
 
150
196
  # Generate PDF file
151
197
  if pdf:
152
- doc = SimpleDocTemplate(os.path.join(BASE_DIR, UT_RESULT_FILE_PDF), pagesize=letter)
153
- doc.title = "Wiliot Certificate Results"
198
+ doc = SimpleDocTemplate(os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_PDF), pagesize=letter)
199
+ doc.title = headline_get(non_cert_run, "Results")
154
200
  elements, hdr_page = [], []
155
201
 
156
202
  # Add Wiliot Logo
@@ -160,6 +206,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
160
206
 
161
207
  # Title and Summary
162
208
  red_header = STYLES_PDF.get("RED_HEADER", ParagraphStyle("Default"))
209
+ green_header = STYLES_PDF.get("GREEN_HEADER", ParagraphStyle("Default"))
163
210
  black_header = STYLES_PDF.get("BLACK_HEADER", ParagraphStyle("Default"))
164
211
  module_header = STYLES_PDF.get("MODULE_HEADER", ParagraphStyle("Default"))
165
212
  test_header = STYLES_PDF.get("TEST_LINK_HEADER", ParagraphStyle("Default"))
@@ -168,13 +215,25 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
168
215
  bold_right_text_style = STYLES_PDF.get("BLUE_BOLD_RIGHT", ParagraphStyle("Default"))
169
216
  centered_text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
170
217
  if error:
171
- title = Paragraph(f"<b>{WLT_CERT_ERROR_HEADLINE}</b>", red_header)
218
+ headline = headline_get(non_cert_run, "Error!")
219
+ title = Paragraph(f"<b>{headline}</b>", red_header)
172
220
  hdr_page.append(title)
173
221
  hdr_page.append(Spacer(1, 20))
174
222
  hdr_page.append(Paragraph(f"{error}", bold_text_style))
175
223
  else:
176
- title = Paragraph(f"<b>{WLT_CERT_HEADLINE}</b>", black_header)
224
+ headline = headline_get(non_cert_run, "Results")
225
+ title = Paragraph(f"<b>{headline}</b>", black_header)
177
226
  hdr_page.append(title)
227
+
228
+ # Add Passed/Failed status header
229
+ if not error:
230
+ is_passed = failures == 0
231
+ status_text = "Passed" if is_passed else "Failed"
232
+ status_header_style = green_header if is_passed else red_header
233
+ status_header = Paragraph(f"<b>{status_text}</b>", status_header_style)
234
+ hdr_page.append(Spacer(1, 10))
235
+ hdr_page.append(status_header)
236
+
178
237
  hdr_page.append(Spacer(1, 20))
179
238
  hdr_page.append(Paragraph(f"<a name='{SUMMARY_HEADLINE}'/><b>{SUMMARY_HEADLINE}</b>", module_header))
180
239
  hdr_page.append(Spacer(1, 20))
@@ -186,10 +245,11 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
186
245
  if brg:
187
246
  hdr_page.append(Paragraph(f"<u>{TESTED_DEVICE_INFO}:</u>", bold_text_style))
188
247
  hdr_page.append(Paragraph(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str}", bold_text_style))
189
- hdr_page.append(Paragraph(f"{BRG} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[brg.board_type]}", bold_text_style))
190
- hdr_page.append(Paragraph(f"{BRG} {BLE_VER}: {brg.version}", bold_text_style))
191
- hdr_page.append(Paragraph(f"{BRG} {SUP_API_VER}: {brg.api_version}", bold_text_style))
192
- hdr_page.append(Spacer(1, 10))
248
+ if isinstance(brg, cert_utils.Bridge):
249
+ hdr_page.append(Paragraph(f"{BRG} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[brg.board_type]}", bold_text_style))
250
+ hdr_page.append(Paragraph(f"{BRG} {BLE_VER}: {brg.version}", bold_text_style))
251
+ hdr_page.append(Paragraph(f"{BRG} {SUP_API_VER}: {brg.api_version}", bold_text_style))
252
+ hdr_page.append(Spacer(1, 10))
193
253
  if internal_brg:
194
254
  hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
195
255
  hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str}", bold_text_style))
@@ -198,7 +258,27 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
198
258
  hdr_page.append(Paragraph(f"{SIM} {SUP_API_VER}: {internal_brg.api_version}", bold_text_style))
199
259
  hdr_page.append(Spacer(1, 20))
200
260
 
201
- # Count Table
261
+ # Analyze results per module and generate results per module for PDF
262
+ results_per_module = generate_results_per_module_for_pdf(tests=tests)
263
+
264
+ # Modules Table
265
+ hdr_page.append(Paragraph(f"<b>Modules Overview</b>", module_header))
266
+ hdr_page.append(Spacer(1, 20))
267
+ modules_overview = get_modules_overview(results_per_module)
268
+ module_stats_table_data = []
269
+ for module_name, status in modules_overview.items():
270
+ module_stats_table_data.append([Paragraph(module_name, centered_text_style), pdf_result_map[status]])
271
+ module_stats_table = Table([["Module", "Status"]] + module_stats_table_data, colWidths=[100, 100])
272
+ module_stats_table.setStyle(inner_table_style('CENTER'))
273
+ hdr_page.append(module_stats_table)
274
+ hdr_page.append(Spacer(1, 20))
275
+ hdr_page.append(PageBreak())
276
+
277
+ # Tests Tables
278
+ hdr_page.append(Paragraph(f"<b>Tests Overview</b>", module_header))
279
+ hdr_page.append(Spacer(1, 20))
280
+
281
+ # Tests Count Table
202
282
  count_data = [
203
283
  ["PASSED", "SKIPPED", "FAILED", "TOTAL"],
204
284
  [len(tests)-(failures+skipped), skipped, failures, len(tests)]
@@ -207,26 +287,26 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
207
287
  count_table.setStyle(inner_table_style('CENTER'))
208
288
  hdr_page.append(count_table)
209
289
  hdr_page.append(Spacer(1, 20))
210
-
211
- # Test Results
212
- results_per_module = generate_results_per_module_for_pdf(tests=tests)
290
+
291
+ # Tests Results Table
213
292
  summary_data = []
214
293
  for module, test_results in results_per_module.items():
215
294
  module_objects = []
216
295
  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))
296
+ module_objects.append(Paragraph(f"<b>{module + ' Module' if (not 'Edge' in module and not 'Cloud' in module) else module}</b>", module_header))
218
297
  module_objects.append(Spacer(1, 20))
219
298
  for test_result in test_results:
299
+ test_skipped = test_result.rc == TEST_SKIPPED
220
300
  test_objects = []
221
- name = Paragraph(f'<a href="#{module}_{test_result.name}">{test_result.name}</a>', centered_text_style) if not test_result.test_skipped else test_result.name
222
- summary_data += [[module, name, test_result.result, test_result.compliance]]
301
+ name = Paragraph(f'<a href="#{module}_{test_result.name}">{test_result.name}</a>', centered_text_style) if not test_skipped else test_result.name
302
+ summary_data += [[module, name, pass_or_fail_pdf(test_result), test_result.compliance]]
223
303
  test_objects.append(Paragraph(f'<a name="{module}_{test_result.name}"/><a href="{test_result.kb_link}">{test_result.name}</a>', test_header))
224
304
  test_objects.append(Spacer(1, 10))
225
- test_objects.append(test_result.result)
305
+ test_objects.append(pass_or_fail_pdf(test_result))
226
306
  test_objects.append(Spacer(1, 10))
227
307
  test_objects.append(Paragraph(test_result.purpose, test_purpose))
228
308
  test_objects.append(Spacer(1, 10))
229
- if not test_result.test_skipped:
309
+ if not test_skipped:
230
310
  module_skipped = False # Set to False if at least one test isn't skipped
231
311
  test_objects.append(Paragraph(f"Tested devices: {test_result.devices}", bold_text_style))
232
312
  test_objects.append(Paragraph(f"Test duration: {test_result.duration}", bold_text_style))
@@ -245,6 +325,45 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
245
325
 
246
326
  doc.build(elements)
247
327
 
328
+ # Upload pipeline results to DB
329
+ if pipeline:
330
+ import boto3
331
+ import json
332
+ import io
333
+ from botocore.exceptions import ClientError
334
+
335
+ device_id = brg.id_str if brg else internal_brg.id_str if internal_brg else "NO_ID"
336
+ version = brg.version if brg else internal_brg.version if internal_brg else "0.0.0"
337
+ json_data = {
338
+ "setup_name": os.environ['PIPELINE_NAME'],
339
+ "device_id": device_id,
340
+ "version": version,
341
+ "run_type": os.environ['PIPELINE_TYPE'],
342
+ "pipeline_url": f"https://bitbucket.org/wiliot/wiliot-nordic-firmware/pipelines/results/{os.environ['BITBUCKET_BUILD_NUMBER']}",
343
+ "run_datetime": str(datetime.datetime.now(zoneinfo.ZoneInfo("Asia/Jerusalem"))),
344
+ "passed_tests": len(tests)-(failures+skipped),
345
+ "failed_tests": failures,
346
+ "skipped_tests": skipped,
347
+ "total_tests": len(tests),
348
+ "run_time_seconds": duration.total_seconds(),
349
+ "tests": generate_results_for_db(tests)
350
+ }
351
+ print(json_data)
352
+
353
+ # upload to S3
354
+ timestamp = datetime.datetime.now().strftime("%d_%m_%Y_%H_%M_%S_%f")[:-3]
355
+ key = f"triggers/projects/fm-certificate/pending/{timestamp}/payload/data.json"
356
+ bucket = "wiliot-systemlab"
357
+ s3 = boto3.client("s3", region_name="us-east-1",
358
+ aws_access_key_id=os.environ['DB_AWS_ACCESS_KEY'],
359
+ aws_secret_access_key=os.environ['DB_AWS_SECRET_ACCESS_KEY'])
360
+
361
+ try:
362
+ body = io.BytesIO(json.dumps(json_data).encode())
363
+ s3.upload_fileobj(body, bucket, key)
364
+ print(f"Uploaded successfully to s3://{bucket}/{key}")
365
+ except ClientError as e:
366
+ print(f"S3 Error: {e}")
248
367
 
249
368
  ##################################
250
369
  # HTML
@@ -261,7 +380,7 @@ COLORS_HTML = {
261
380
  }
262
381
  color_html = lambda c, t: f'<span style="{COLORS_HTML.get(c, "")}{COLORS_HTML["BOLD"]}">{t}</span>'
263
382
  html_result_map = {TEST_FAILED: color_html("RED", "FAIL"), TEST_SKIPPED: color_html("WARNING", "SKIPPED"),
264
- TEST_PASSED: color_html("GREEN", "PASS"), TEST_INIT: color_html("CYAN", "INIT")}
383
+ TEST_PASSED: color_html("GREEN", "PASS"), TEST_ABORTED: color_html("RED", "ABORTED")}
265
384
  pass_or_fail_html = lambda obj : html_result_map[obj.rc]
266
385
 
267
386
  HTML_START = """
@@ -270,7 +389,7 @@ HTML_START = """
270
389
  <head>
271
390
  <meta charset='utf-8'>
272
391
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
273
- <title>Wiliot Certificate Results</title>
392
+ <title>{}</title>
274
393
  <meta name='viewport' content='width=device-width, initial-scale=1'>
275
394
  <style>
276
395
  html, body {{
@@ -325,6 +444,8 @@ HTML_END = """
325
444
  STYLES_PDF = {
326
445
  "BLACK_HEADER": ParagraphStyle("Black Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.black, alignment=TA_CENTER),
327
446
  "RED_HEADER": ParagraphStyle("Red Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.red, alignment=TA_CENTER),
447
+ "GREEN_HEADER": ParagraphStyle("Green Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.green, alignment=TA_CENTER),
448
+ "GRAY": ParagraphStyle("Gray", fontName="Helvetica-Bold", fontSize=9, textColor=colors.grey, splitLongWords=False, alignment=TA_LEFT, wordWrap = 'CJK'),
328
449
  "MODULE_HEADER": ParagraphStyle("Module Header", fontName="Helvetica-Bold", fontSize=16, textColor=colors.navy, alignment=TA_CENTER),
329
450
  "TEST_HEADER": ParagraphStyle("Test Header", fontName="Helvetica-Bold", fontSize=12, textColor=colors.black, alignment=TA_LEFT),
330
451
  "TEST_LINK_HEADER": ParagraphStyle('Test Link Header', fontName="Helvetica-Bold", fontSize=14, textColor=colors.blue, alignment=TA_LEFT),
@@ -341,7 +462,8 @@ def color_pdf(c, t):
341
462
  style = STYLES_PDF.get(c, ParagraphStyle("Default"))
342
463
  return Paragraph(t, style)
343
464
  pdf_result_map = {TEST_FAILED: color_pdf("RED", "FAILED"), TEST_SKIPPED: color_pdf("WARNING", "SKIPPED"),
344
- TEST_PASSED: color_pdf("GREEN", "PASSED"), TEST_INIT: color_pdf("CYAN", "INIT")}
465
+ TEST_PASSED: color_pdf("GREEN", "PASSED"), TEST_ABORTED: color_pdf("RED", "ABORTED"),
466
+ MODULE_UNSUPPORTED: color_pdf("GRAY", "UNSUPPORTED")}
345
467
  pass_or_fail_pdf = lambda obj : pdf_result_map[obj.rc]
346
468
 
347
469
  inner_table_style = lambda align : TableStyle([
@@ -356,22 +478,57 @@ inner_table_style = lambda align : TableStyle([
356
478
  ('WORDWRAP', (0, 0), (-1, -1), False),
357
479
  ])
358
480
 
481
+ def get_modules_overview(results_per_module):
482
+ """Get modules overview for the tests."""
483
+ modules_overview = {}
484
+ for module_name in MODULE_SCHEMA_NAMES_LIST:
485
+ if module_name in results_per_module: # Module is in run - check if it passed/failed/skipped
486
+ test_results = results_per_module[module_name]
487
+ modules_overview[module_name] = TEST_SKIPPED # Assume all tests are skipped until proven otherwise
488
+ for test_result in test_results:
489
+ # If any test failed, the module failed
490
+ if test_result.rc == TEST_FAILED:
491
+ modules_overview[module_name] = TEST_FAILED
492
+ break
493
+ # If any test passed, the module passed until proven otherwise
494
+ elif test_result.rc == TEST_PASSED:
495
+ modules_overview[module_name] = TEST_PASSED
496
+ # If any mandatory test is skipped, the module is skipped
497
+ elif test_result.rc == TEST_SKIPPED and test_result.compliance == "Mandatory":
498
+ modules_overview[module_name] = TEST_SKIPPED
499
+ else: # Module not in run - show as Unsupported
500
+ modules_overview[module_name] = MODULE_UNSUPPORTED
501
+ return modules_overview
502
+
503
+
359
504
  def generate_results_per_module_for_pdf(tests=[]):
360
505
  text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
361
506
  results_per_module = {}
362
507
  for test in tests:
363
- devices_to_print = (test.gw if not test.brg0 or test.gw_only else
364
- (f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
508
+ 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
509
  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
510
  test_table = Table([["Phase", "Result", "Notes"]] + inner_table)
367
511
  test_table.setStyle(inner_table_style('LEFT'))
368
512
  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, result=pass_or_fail_pdf(test),
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))
513
+ test_result = TestResult(name=test.test_json[NAME], devices_to_print=devices_to_print, test_table=test_table, rc=test.rc,
514
+ duration=test.duration, purpose=str(test.test_json[PURPOSE]), compliance=compliance, kb_link=test.test_json[DOCUMENTATION])
372
515
  module_name = test.test_json[MODULE]
373
516
  if module_name not in results_per_module:
374
517
  results_per_module[module_name] = [test_result]
375
518
  else:
376
519
  results_per_module[module_name] += [test_result]
377
520
  return results_per_module
521
+
522
+ def generate_results_for_db(tests=[]):
523
+ results = []
524
+ for test in tests:
525
+ internal_brg_txt = " (internal brg)" if test.internal_brg else ""
526
+ result = {
527
+ "module_name": test.test_json[MODULE],
528
+ "test_name": test.test_json[NAME] + internal_brg_txt,
529
+ "result": pass_or_fail_txt(test),
530
+ "run_time": test.duration,
531
+ }
532
+ result["phases"] = [{"phase_name": param_name_to_title(phase.name), "result": pass_or_fail_txt(phase), "notes": phase.reason} for phase in test.phases]
533
+ results.append(result)
534
+ return results