wiliot-certificate 4.4.3__py3-none-any.whl → 4.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) 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. certificate/cert_common.py +1488 -0
  4. certificate/cert_config.py +480 -0
  5. {brg_certificate → certificate}/cert_data_sim.py +134 -46
  6. {brg_certificate → certificate}/cert_defines.py +129 -128
  7. {brg_certificate → certificate}/cert_gw_sim.py +183 -53
  8. {brg_certificate → certificate}/cert_mqtt.py +179 -64
  9. {brg_certificate → certificate}/cert_prints.py +35 -33
  10. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  11. {brg_certificate → certificate}/cert_results.py +240 -64
  12. certificate/cert_utils.py +634 -0
  13. certificate/certificate.py +205 -0
  14. certificate/certificate_cli.py +76 -0
  15. certificate/certificate_eth_test_list.txt +76 -0
  16. certificate/certificate_sanity_test_list.txt +66 -0
  17. certificate/certificate_test_list.txt +76 -0
  18. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +3 -2
  19. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  20. certificate/tests/calibration/output_power_test/output_power_test.json +23 -0
  21. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  22. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +2 -1
  23. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  24. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +15 -0
  25. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  26. certificate/tests/cloud_connectivity/acl_test/acl_test.json +15 -0
  27. certificate/tests/cloud_connectivity/acl_test/acl_test.py +96 -0
  28. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +19 -0
  29. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +41 -0
  30. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +19 -0
  31. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  32. certificate/tests/cloud_connectivity/connection_test/connection_test.json +18 -0
  33. certificate/tests/cloud_connectivity/connection_test/connection_test.py +67 -0
  34. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +15 -0
  35. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +80 -0
  36. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +21 -0
  37. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +201 -0
  38. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +17 -0
  39. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +104 -0
  40. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +18 -0
  41. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +59 -0
  42. certificate/tests/cloud_connectivity/registration_test/registration_test.json +20 -0
  43. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  44. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  45. certificate/tests/cloud_connectivity/stress_test/stress_test.json +17 -0
  46. certificate/tests/cloud_connectivity/stress_test/stress_test.py +101 -0
  47. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +25 -0
  48. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +92 -0
  49. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +20 -0
  50. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +169 -0
  51. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +2 -1
  52. certificate/tests/datapath/aging_test/aging_test.py +142 -0
  53. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +17 -0
  54. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +89 -0
  55. certificate/tests/datapath/event_test/event_test.json +17 -0
  56. certificate/tests/datapath/event_test/event_test.py +80 -0
  57. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +4 -3
  58. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +19 -13
  59. certificate/tests/datapath/output_power_test/output_power_test.json +23 -0
  60. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  61. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +2 -1
  62. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -11
  63. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -1
  64. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  65. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +3 -2
  66. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  67. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +20 -0
  68. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  69. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +2 -1
  70. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +15 -14
  71. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +19 -0
  72. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +85 -0
  73. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -1
  74. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  75. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -1
  76. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  77. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -2
  78. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  79. 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
  80. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  81. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +3 -2
  82. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  83. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +8 -7
  84. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +113 -73
  85. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +8 -7
  86. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  87. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +4 -3
  88. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +15 -11
  89. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +4 -3
  90. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +15 -11
  91. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +3 -1
  92. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  93. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +15 -0
  94. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  95. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +15 -0
  96. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  97. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +15 -0
  98. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  99. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +15 -0
  100. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  101. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +16 -0
  102. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  103. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +15 -0
  104. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  105. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +15 -0
  106. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  107. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +15 -0
  108. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +45 -0
  109. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +3 -2
  110. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  111. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +2 -1
  112. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  113. certificate/tests/energy2400/output_power_test/output_power_test.json +23 -0
  114. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  115. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +2 -1
  116. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  117. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +26 -0
  118. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +379 -0
  119. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +20 -0
  120. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +173 -0
  121. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +24 -0
  122. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  123. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -1
  124. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  125. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +2 -1
  126. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  127. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +2 -1
  128. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  129. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +5 -4
  130. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +450 -0
  131. certificate/wlt_types.py +122 -0
  132. {gw_certificate → common}/api_if/202/status.json +6 -0
  133. {gw_certificate → common}/api_if/203/status.json +6 -0
  134. {gw_certificate → common}/api_if/204/status.json +6 -0
  135. common/api_if/206/data.json +85 -0
  136. common/api_if/206/status.json +69 -0
  137. common/api_if/api_validation.py +91 -0
  138. common/web/templates/generator.html +210 -0
  139. common/web/templates/index.html +20 -0
  140. common/web/templates/menu.html +54 -0
  141. common/web/templates/parser.html +53 -0
  142. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  143. common/web/web_utils.py +399 -0
  144. {brg_certificate → common}/wltPb_pb2.py +14 -12
  145. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  146. gui_certificate/gui_certificate_cli.py +14 -0
  147. gui_certificate/server.py +1267 -0
  148. gui_certificate/templates/cert_run.html +1273 -0
  149. wiliot_certificate-4.5.0.dist-info/METADATA +99 -0
  150. wiliot_certificate-4.5.0.dist-info/RECORD +168 -0
  151. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/WHEEL +1 -1
  152. wiliot_certificate-4.5.0.dist-info/entry_points.txt +5 -0
  153. wiliot_certificate-4.5.0.dist-info/top_level.txt +3 -0
  154. brg_certificate/ag/energous_v0_defines.py +0 -925
  155. brg_certificate/ag/energous_v1_defines.py +0 -931
  156. brg_certificate/ag/energous_v2_defines.py +0 -925
  157. brg_certificate/ag/energous_v3_defines.py +0 -925
  158. brg_certificate/ag/energous_v4_defines.py +0 -925
  159. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  160. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  161. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  162. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  163. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -142
  164. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -785
  165. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -139
  166. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -394
  167. brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -515
  168. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +0 -672
  169. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -550
  170. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -595
  171. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -598
  172. brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -938
  173. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1234
  174. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
  175. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
  176. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  177. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -110
  178. brg_certificate/brg_certificate.py +0 -225
  179. brg_certificate/brg_certificate_cli.py +0 -63
  180. brg_certificate/cert_common.py +0 -923
  181. brg_certificate/cert_config.py +0 -402
  182. brg_certificate/cert_utils.py +0 -362
  183. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  184. brg_certificate/certificate_bcc_test_list.txt +0 -48
  185. brg_certificate/certificate_sanity_test_list.txt +0 -43
  186. brg_certificate/certificate_test_list.txt +0 -53
  187. brg_certificate/config/eclipse.json +0 -10
  188. brg_certificate/config/hivemq.json +0 -10
  189. brg_certificate/config/mosquitto.json +0 -10
  190. brg_certificate/config/mosquitto.md +0 -95
  191. brg_certificate/config/wiliot-dev.json +0 -10
  192. brg_certificate/restore_brg.py +0 -61
  193. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  194. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  195. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  196. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  197. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  198. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  199. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  200. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  201. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  204. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  205. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  206. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  208. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  209. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  210. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  211. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  213. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +0 -321
  215. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  216. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  217. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  218. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  219. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  220. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  221. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  222. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  223. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  224. brg_certificate/wltPb_pb2.pyi +0 -234
  225. brg_certificate/wlt_types.py +0 -113
  226. gw_certificate/ag/ut_defines.py +0 -364
  227. gw_certificate/ag/wlt_types.py +0 -85
  228. gw_certificate/ag/wlt_types_ag.py +0 -5310
  229. gw_certificate/ag/wlt_types_data.py +0 -64
  230. gw_certificate/api/extended_api.py +0 -23
  231. gw_certificate/api_if/200/data.json +0 -106
  232. gw_certificate/api_if/200/status.json +0 -47
  233. gw_certificate/api_if/201/data.json +0 -98
  234. gw_certificate/api_if/201/status.json +0 -53
  235. gw_certificate/api_if/205/logs.json +0 -12
  236. gw_certificate/api_if/api_validation.py +0 -38
  237. gw_certificate/api_if/gw_capabilities.py +0 -54
  238. gw_certificate/cert_results.py +0 -145
  239. gw_certificate/common/analysis_data_bricks.py +0 -60
  240. gw_certificate/common/debug.py +0 -42
  241. gw_certificate/common/serialization_formatter.py +0 -93
  242. gw_certificate/common/utils.py +0 -8
  243. gw_certificate/common/utils_defines.py +0 -15
  244. gw_certificate/common/wltPb_pb2.py +0 -84
  245. gw_certificate/gw_certificate.py +0 -154
  246. gw_certificate/gw_certificate_cli.py +0 -87
  247. gw_certificate/interface/4.4.93_app.zip +0 -0
  248. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  249. gw_certificate/interface/ble_simulator.py +0 -61
  250. gw_certificate/interface/ble_sniffer.py +0 -189
  251. gw_certificate/interface/flash_fw.py +0 -90
  252. gw_certificate/interface/if_defines.py +0 -36
  253. gw_certificate/interface/mqtt.py +0 -563
  254. gw_certificate/interface/nrfutil-linux +0 -0
  255. gw_certificate/interface/nrfutil-mac +0 -0
  256. gw_certificate/interface/nrfutil.exe +0 -0
  257. gw_certificate/interface/pkt_generator.py +0 -594
  258. gw_certificate/interface/uart_if.py +0 -236
  259. gw_certificate/interface/uart_ports.py +0 -20
  260. gw_certificate/templates/results.html +0 -241
  261. gw_certificate/templates/stage.html +0 -22
  262. gw_certificate/templates/table.html +0 -6
  263. gw_certificate/templates/test.html +0 -38
  264. gw_certificate/tests/__init__.py +0 -10
  265. gw_certificate/tests/actions.py +0 -289
  266. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  267. gw_certificate/tests/connection.py +0 -188
  268. gw_certificate/tests/downlink.py +0 -172
  269. gw_certificate/tests/generic.py +0 -238
  270. gw_certificate/tests/registration.py +0 -340
  271. gw_certificate/tests/static/__init__.py +0 -0
  272. gw_certificate/tests/static/connection_defines.py +0 -9
  273. gw_certificate/tests/static/downlink_defines.py +0 -9
  274. gw_certificate/tests/static/generated_packet_table.py +0 -195
  275. gw_certificate/tests/static/packet_table.csv +0 -10067
  276. gw_certificate/tests/static/references.py +0 -5
  277. gw_certificate/tests/static/uplink_defines.py +0 -14
  278. gw_certificate/tests/throughput.py +0 -240
  279. gw_certificate/tests/uplink.py +0 -853
  280. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  281. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  282. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  283. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  284. {brg_certificate → certificate}/__init__.py +0 -0
  285. {gw_certificate → common}/api_if/202/data.json +0 -0
  286. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/203/data.json +0 -0
  288. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/204/data.json +0 -0
  290. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/data.json +0 -0
  292. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  293. {gw_certificate → common}/api_if/205/status.json +0 -0
  294. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  295. {gw_certificate → common/api_if}/__init__.py +0 -0
  296. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  297. {wiliot_certificate-4.4.3.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 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"
@@ -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"), TEST_INIT: cert_prints.color("CYAN", "INIT")}
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, result=None, duration=0, purpose="", kb_link="", compliance="", test_skipped=False):
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.test_skipped = test_skipped
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
- 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))
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
- brgs_to_print,
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 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):
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
- f = open(os.path.join(BASE_DIR, UT_RESULT_FILE_HTML), "w", encoding="utf-8")
107
- f.write(HTML_START)
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
- f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_ERROR_HEADLINE}</h1><br>")
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 brg:
122
- f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
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
- f.write(f"<br><h1 style='color:#00AB83'>{WLT_CERT_PASS_HEADLINE}</h1>")
160
+ headline = headline_get(non_cert_run, "Passed!")
161
+ f.write(f"<br><h1 style='color:#00AB83'>{headline}</h1>")
126
162
  else:
127
- f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_FAIL_HEADLINE}</h1>")
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 internal_brg:
136
- f.write(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str} <br><br>")
137
- f.write(f"{SIM} {BLE_VER}: {internal_brg.version} <br><br>")
138
- if brg:
139
- f.write(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str} <br><br>")
140
- f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
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(BASE_DIR, UT_RESULT_FILE_PDF), pagesize=letter)
153
- doc.title = "Wiliot Certificate Results"
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
- title = Paragraph(f"<b>{WLT_CERT_ERROR_HEADLINE}</b>", red_header)
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
- title = Paragraph(f"<b>{WLT_CERT_HEADLINE}</b>", black_header)
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, 20))
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 brg:
247
+ if test:
187
248
  hdr_page.append(Paragraph(f"<u>{TESTED_DEVICE_INFO}:</u>", bold_text_style))
188
- 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))
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
- if internal_brg:
194
- hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
195
- hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str}", bold_text_style))
196
- hdr_page.append(Paragraph(f"{SIM} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[internal_brg.board_type]}", bold_text_style))
197
- hdr_page.append(Paragraph(f"{SIM} {BLE_VER}: {internal_brg.version}", bold_text_style))
198
- hdr_page.append(Paragraph(f"{SIM} {SUP_API_VER}: {internal_brg.api_version}", bold_text_style))
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, 20))
210
-
211
- # Test Results
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 test_result.test_skipped else test_result.name
222
- summary_data += [[module, name, test_result.result, test_result.compliance]]
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.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 test_result.test_skipped:
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"), TEST_INIT: color_html("CYAN", "INIT")}
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>Wiliot Certificate Results</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"), TEST_INIT: color_pdf("CYAN", "INIT")}
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.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))
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, 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))
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