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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.2.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.91_app.zip +0 -0
  248. gw_certificate/interface/4.4.91_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.2.dist-info/METADATA +0 -211
  281. wiliot_certificate-4.4.2.dist-info/RECORD +0 -210
  282. wiliot_certificate-4.4.2.dist-info/entry_points.txt +0 -3
  283. wiliot_certificate-4.4.2.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.2.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,289 +0,0 @@
1
- import datetime
2
- import os
3
- import time
4
- import pandas as pd
5
-
6
- from packaging import version
7
-
8
- from gw_certificate.common.debug import debug_print
9
- from gw_certificate.interface.mqtt import MqttClient, GwAction
10
- from gw_certificate.tests.generic import PassCriteria, PERFECT_SCORE, MINIMUM_SCORE, INCONCLUSIVE_MINIMUM, GenericTest, GenericStage, OPTIONAL
11
- from gw_certificate.tests.static.references import GW_ACTIONS_DOC, GW_BRIDGE_OTA_DOC
12
- from gw_certificate.ag.ut_defines import STATUS_CODE_STR
13
- from gw_certificate.interface.uart_if import FIRST_UNIFIED_BL_VERSION, UARTError
14
-
15
-
16
- BL_INACTIVITY_TIMEOUT_SEC = 120
17
-
18
-
19
- class GenericActionsStage(GenericStage):
20
- def __init__(self, mqttc:MqttClient, stage_name, **kwargs):
21
- self.__dict__.update(kwargs)
22
- super().__init__(stage_name=stage_name, **self.__dict__)
23
-
24
- #Clients
25
- self.mqttc = mqttc
26
-
27
- #Stage Params
28
- self.action = ""
29
-
30
- #Paths
31
- self.summary_csv_path = os.path.join(self.test_dir, f'{self.stage_name}_summary.csv')
32
-
33
-
34
- def prepare_stage(self):
35
- super().prepare_stage()
36
- self.mqttc.flush_messages()
37
-
38
- def generate_stage_report(self):
39
- self.add_report_header()
40
-
41
- class GatewayInfoStage(GenericActionsStage):
42
- def __init__(self, **kwargs):
43
- super().__init__(**kwargs, stage_name=type(self).__name__)
44
- self.stage_tooltip = "Issues a Gateway Info action to the gateway. Expects the gateway to publish a response"
45
- self.error_summary = "Did not receive a response to the Gateway Info action"
46
- self.action = "getGwInfo"
47
- self.response = None
48
-
49
- def run(self):
50
- super().run()
51
- timeout = datetime.datetime.now() + datetime.timedelta(seconds=20)
52
- self.gw_info = None
53
- self.mqttc.flush_messages()
54
-
55
- self.mqttc.send_action(GwAction.GET_GW_INFO)
56
- while datetime.datetime.now() < timeout and self.gw_info is None:
57
- self.gw_info = self.mqttc.get_gw_info_message()
58
- time.sleep(5)
59
-
60
-
61
- def generate_stage_report(self):
62
- super().generate_stage_report()
63
-
64
- # Calculate whether stage pass/failed
65
- if self.gw_info == None:
66
- self.stage_pass = MINIMUM_SCORE
67
- self.add_to_stage_report(f'Did not receive a response to the Gateway Info action. For more info visit:')
68
- self.add_to_stage_report(f'{GW_ACTIONS_DOC}')
69
- else:
70
- self.stage_pass = PERFECT_SCORE
71
- self.response = repr(self.gw_info)
72
- self.add_to_stage_report('A Gateway Info response was receieved:')
73
- self.add_to_stage_report(self.response)
74
-
75
- # Export all stage data
76
- csv_data = {'Action': [self.action], 'Response': [self.response], 'Pass': [self.stage_pass > self.pass_min]}
77
- pd.DataFrame(csv_data).to_csv(self.summary_csv_path)
78
- self.add_to_stage_report(f'\nStage summary saved - {self.summary_csv_path}')
79
- debug_print(self.report)
80
-
81
- # Generate HTML
82
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
83
- stage_report=self.report.split('\n'))
84
- return self.report
85
-
86
-
87
- class RebootStage(GenericActionsStage):
88
- def __init__(self, **kwargs):
89
- super().__init__(**kwargs, stage_name=type(self).__name__)
90
- self.stage_tooltip = "Issues reboot action to the gateway. Expects it to reboot"
91
- self.error_summary = "The gateway did not reboot as expected"
92
- self.action = "rebootGw"
93
-
94
- def run(self):
95
- super().run()
96
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=3)
97
- self.status_message = None
98
-
99
- debug_print("Sending a reboot action to the gateway and awaiting reboot.. (timeout = 3)")
100
- self.mqttc.send_action(GwAction.REBOOT_GW)
101
- while datetime.datetime.now() < timeout and self.status_message is None:
102
- self.status_message = self.mqttc.get_status_message()
103
- time.sleep(5)
104
-
105
- def generate_stage_report(self):
106
- super().generate_stage_report()
107
-
108
- # Calculate whether stage pass/failed
109
- if self.status_message is None:
110
- self.stage_pass = MINIMUM_SCORE
111
- self.add_to_stage_report(f"The gateway did not validly reboot")
112
- self.add_to_stage_report(f"Gateways are expected to upload a status(configuration) message upon establishing MQTT connection, which wasn't received.")
113
- else:
114
- self.stage_pass = PERFECT_SCORE
115
- self.add_to_stage_report(f"Gateway rebooted and uploaded a configuration message, as expected.")
116
-
117
- # Export all stage data
118
- csv_data = {'Action': [self.action], 'Pass': [self.stage_pass > self.pass_min]}
119
- pd.DataFrame(csv_data).to_csv(self.summary_csv_path)
120
- self.add_to_stage_report(f'\nStage summary saved - {self.summary_csv_path}')
121
-
122
- # Generate HTML
123
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
124
- stage_report=self.report.split('\n'))
125
- return self.report
126
-
127
- class BridgeOTAStage(GenericActionsStage):
128
- def __init__(self, **kwargs):
129
- super().__init__(**kwargs, stage_name=type(self).__name__)
130
- self.stage_tooltip = "Issues a bridge OTA action to the gateway. Expects it to upgrade the bridge"
131
- self.error_summary = "Bridge wasn't upgraded."
132
- self.action = "Bridge Upgrade"
133
-
134
- OTA_VERSIONS_TO_USE = ("4.4.91", "4.4.92")
135
- if version.parse(OTA_VERSIONS_TO_USE[0]) != self.uart.fw_version:
136
- self.desired_version = version.parse(OTA_VERSIONS_TO_USE[0])
137
- else:
138
- self.desired_version = version.parse(OTA_VERSIONS_TO_USE[1])
139
-
140
- def prepare_stage(self):
141
- super().prepare_stage()
142
- debug_print(f"Important: For the gateway to be able to download the file, it must use a valid token in the HTTP GET request.")
143
- debug_print(f"Meaning It must be registered under an owner, and the certificate '-env' should correspond to that owner.")
144
- debug_print(f"BridgeOTAStage attempt: {str(self.uart.fw_version)} -> {str(self.desired_version)}")
145
- # Reset to remove any log/cert mode we had in the kit so it behaves as a bridge
146
- self.uart.reset_gw()
147
-
148
- def is_final_action_status(self, msg):
149
- LAST_OTA_STEP = 7
150
- if not isinstance(msg, dict):
151
- return False
152
-
153
- step = msg.get('step')
154
- progress = msg.get('progress')
155
- status = msg.get('statusCode')
156
- if status == None:
157
- # Both json/pb
158
- status = msg.get('status')
159
-
160
- if step == None:
161
- # Old action status
162
- if status != None:
163
- return True
164
- else:
165
- # New progress action status
166
- if (step == LAST_OTA_STEP and progress == 100) or (status != 0):
167
- return True
168
- return False
169
-
170
- def run(self):
171
- super().run()
172
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=10)
173
- self.action_status = None
174
- self.status_code = None
175
- self.reboot_packet_ts = None
176
- self.action_status_ts = None
177
-
178
- self.mqttc.send_bridge_ota_action(self.uart.mac, str(self.desired_version), 200, False, self.gw_id, "aws", self.env)
179
- debug_print("Sent a BridgeOTA action to the gateway")
180
- debug_print("Waiting for an actionStatus message from the gateway... (timeout=10)")
181
-
182
- while datetime.datetime.now() < timeout and self.action_status is None:
183
- line = self.uart.read_line()
184
- if line != None and 'reset' in line:
185
- self.reboot_packet_ts = datetime.datetime.now()
186
- debug_print("A reboot packet was received by the bridge")
187
- self.uart.reset_gw(stop_advertising=False)
188
-
189
- # Ignoring progress report until test supported
190
- msg = self.mqttc.get_action_status_message()
191
- if self.is_final_action_status(msg):
192
- self.action_status = msg
193
- time.sleep(2)
194
-
195
- debug_print(f'{self.action_status}')
196
- if self.action_status != None:
197
- debug_print("actionStatus was received from the gateway")
198
- self.action_status_ts = datetime.datetime.now()
199
- self.status_code = self.action_status.get(STATUS_CODE_STR)
200
- if self.status_code == None:
201
- self.status_code = self.action_status.get('status')
202
-
203
- if self.status_code != 0 and self.reboot_packet_ts != None:
204
- debug_print(f"Reported status {self.status_code} indicates failure, waiting for the bridge bootloader inactivity timer (2 minutes)..")
205
- time.sleep(BL_INACTIVITY_TIMEOUT_SEC)
206
-
207
- debug_print('Waiting for the bridge to boot...')
208
- time.sleep(40)
209
-
210
- cur_ver = self.uart.get_version()
211
- if cur_ver == None:
212
- debug_print("ERROR: The certificate kit, acting as bridge in this stage, is not responding.")
213
- self.uart.flush(request_power_cycle=True)
214
- cur_ver = self.uart.get_version()
215
- if cur_ver == None:
216
- raise UARTError("Communication to the certificate kit halted! "
217
- "Please unplug and replug its power source, wait for 5 minutes and retry. "
218
- "If the error persist, contact Wiliot Support and attach your results directory.")
219
- self.current_version = version.parse(cur_ver)
220
-
221
- def generate_stage_report(self):
222
- super().generate_stage_report()
223
-
224
- # Calculate whether stage pass/failed
225
- if self.action_status is None or self.status_code != 0:
226
- debug_print("Failed to receive an actionStatus message.")
227
- self.stage_pass = MINIMUM_SCORE
228
- self.add_to_stage_report(f"The bridge OTA test failed")
229
- if self.action_status is None:
230
- self.add_to_stage_report(f"Gateways are expected to upload an actionStatus message upon establishing MQTT connection, which wasn't received.")
231
- elif self.status_code is None:
232
- self.add_to_stage_report(f"Uploaded actionStatus messages should contain the status field, which wasn't detected.")
233
- elif self.status_code != 0:
234
- self.add_to_stage_report(f"Uploaded actionStatus status value received is {self.status_code}.")
235
- if self.current_version == self.desired_version:
236
- debug_print("Bridge was upgraded successfully")
237
- self.error_summary = "Failed to receive actionStatus message."
238
- self.add_to_stage_report(f"Note that the bridge was actually upgraded successfully.")
239
- self.add_to_stage_report(f"Reboot packet received {(self.reboot_packet_ts - self.start_time).total_seconds():.1f}s after start.")
240
- self.add_to_stage_report(f"{GW_BRIDGE_OTA_DOC}")
241
- else:
242
- if self.current_version == self.desired_version:
243
- self.stage_pass = PERFECT_SCORE
244
- debug_print("Bridge was upgraded successfully, actionStatus message received")
245
- self.add_to_stage_report(f"Bridge was upgraded and an actionStatus message was received from the gateway.")
246
- self.add_to_stage_report(f"Action status received {(self.action_status_ts - self.start_time).total_seconds():.1f}s after start.")
247
- self.add_to_stage_report(f"Reboot packet received {(self.reboot_packet_ts - self.start_time).total_seconds():.1f}s after start.")
248
- self.add_to_stage_report(f"Action status received {(self.action_status_ts - self.reboot_packet_ts).total_seconds():.1f}s after reboot.")
249
- else:
250
- self.stage_pass = MINIMUM_SCORE
251
- debug_print("Bridge failed to upgrade")
252
- self.add_to_stage_report(f"The bridge OTA test failed")
253
- self.add_to_stage_report(f"Uploaded actionStatus message indicated success although the bridge was not upgraded.")
254
-
255
- # Export all stage data
256
- csv_data = {'Action': [self.action], 'Pass': [self.stage_pass > self.pass_min]}
257
- if self.stage_pass == PERFECT_SCORE:
258
- csv_data.update({'start_ts': self.start_time, 'reboot_packet_ts': self.reboot_packet_ts, 'action_status_ts': self.action_status_ts})
259
- pd.DataFrame(csv_data).to_csv(self.summary_csv_path)
260
- self.add_to_stage_report(f'\nStage summary saved - {self.summary_csv_path}')
261
-
262
- # Generate HTML
263
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
264
- stage_report=self.report.split('\n'))
265
- return self.report
266
-
267
- ACTIONS_STAGES = [GatewayInfoStage, RebootStage, BridgeOTAStage]
268
-
269
- class ActionsTest(GenericTest):
270
- def __init__(self, **kwargs):
271
- self.__dict__.update(kwargs)
272
- super().__init__(**self.__dict__, test_name=type(self).__name__)
273
- self.test_tooltip = "Stages publishing different actions (via the 'update' topic). Optional"
274
- self.result_indication = OPTIONAL
275
- # Actions stages are determined by the CLI argument
276
- stages = self.actions
277
-
278
- if BridgeOTAStage in stages and self.uart.fw_version < FIRST_UNIFIED_BL_VERSION:
279
- debug_print("Certificate kit's firmware should be upgraded with the '-update' flag to run the BridgeOTAStage")
280
- stages.remove(BridgeOTAStage)
281
- self.stages = [stage(**self.__dict__) for stage in stages]
282
-
283
- def run(self):
284
- super().run()
285
- for stage in self.stages:
286
- stage.prepare_stage()
287
- stage.run()
288
- self.add_to_test_report(stage.generate_stage_report())
289
- self.test_pass = PassCriteria.calc_for_test(self, stage)
@@ -1,51 +0,0 @@
1
- bad_crc_percent,per_percent
2
- 2,7
3
- 4,11
4
- 6,16
5
- 8,20
6
- 10,25
7
- 12,29
8
- 14,33
9
- 16,37
10
- 18,41
11
- 20,45
12
- 22,49
13
- 24,52
14
- 26,55
15
- 28,58
16
- 30,61
17
- 32,64
18
- 34,67
19
- 36,69
20
- 38,72
21
- 40,74
22
- 42,76
23
- 44,78
24
- 46,81
25
- 48,83
26
- 50,84
27
- 52,86
28
- 54,87
29
- 56,89
30
- 58,90.5
31
- 60,91.5
32
- 62,92.5
33
- 64,93.5
34
- 66,94.5
35
- 68,95.5
36
- 70,96.5
37
- 72,97
38
- 74,97.5
39
- 76,98
40
- 78,98.5
41
- 80,99
42
- 82,99.25
43
- 84,99.5
44
- 86,99.75
45
- 88,100
46
- 90,100
47
- 92,100
48
- 94,100
49
- 96,100
50
- 98,100
51
- 100,100
@@ -1,188 +0,0 @@
1
- import datetime
2
- import json
3
- import time
4
- import pkg_resources
5
- import pandas as pd
6
- from packaging import version
7
-
8
- from gw_certificate.tests.static.connection_defines import *
9
- from gw_certificate.common.debug import debug_print
10
- from gw_certificate.api_if.gw_capabilities import GWCapabilities
11
- from gw_certificate.tests.generic import INCONCLUSIVE_MINIMUM, PassCriteria, MINIMUM_SCORE, PERFECT_SCORE, GenericStage, GenericTest, INFORMATIVE
12
- from gw_certificate.api_if.api_validation import validate_message, MESSAGE_TYPES
13
- from gw_certificate.interface.mqtt import MqttClient, Serialization
14
- from gw_certificate.interface.ble_sniffer import BLESniffer, BLESnifferContext
15
- from gw_certificate.tests.static.references import GW_MQTT_DOC
16
-
17
- STATUS_MSG_TIMEOUT = 5
18
-
19
- class ConnectionStage(GenericStage):
20
- def __init__(self, mqttc:MqttClient, **kwargs):
21
- self.mqttc = mqttc
22
- self.stage_tooltip = "Awaits the gateway to establish MQTT connection and upload it's configurations via the 'status' topic as it's first message"
23
- self.__dict__.update(kwargs)
24
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
25
-
26
- def run(self):
27
- super().run()
28
- self.stage_pass = MINIMUM_SCORE
29
- input('The GW is expected to publish a configuration JSON/Protobuf message through the status topic upon connecting to mqtt:\n'
30
- 'Please unplug GW from power. Press enter when unplugged')
31
- self.mqttc.flush_messages()
32
- input('Please plug GW back to power. Press enter when plugged')
33
- debug_print(f'Waiting for GW to connect... (Timeout {STATUS_MSG_TIMEOUT} minutes)')
34
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=STATUS_MSG_TIMEOUT)
35
- self.status_message = None
36
-
37
- while datetime.datetime.now() < timeout and self.status_message is None:
38
- time.sleep(2)
39
- self.status_message = self.mqttc.get_status_message()
40
-
41
- if self.status_message is not None:
42
- ser = self.mqttc.get_serialization()
43
- debug_print(self.status_message)
44
- if ser == Serialization.JSON:
45
- self.validation = validate_message(MESSAGE_TYPES.STATUS, self.status_message)
46
- self.stage_pass = PERFECT_SCORE if self.validation[0] else MINIMUM_SCORE
47
- else:
48
- self.stage_pass = PERFECT_SCORE
49
- # set GW Capabilities:
50
- for key, value in self.status_message.items():
51
- if key in GWCapabilities.get_capabilities() and type(value) is bool:
52
- self.gw_capabilities.set_capability(key, value)
53
- self.cfg_data.status_msg_set(self.status_message, self.mqttc.get_serialization())
54
-
55
- def generate_stage_report(self):
56
- self.add_report_header()
57
-
58
- if self.status_message is not None:
59
- ser = self.mqttc.get_serialization()
60
- debug_print(f'{ser.value} serialization detected')
61
- self.add_to_stage_report(f'{ser.value} serialization detected')
62
- self.add_to_stage_report('GW Status packet received:')
63
- self.add_to_stage_report(f'{json.dumps(self.status_message)}\n')
64
-
65
- for key, value in self.status_message.items():
66
- if key in GWCapabilities.get_capabilities() and type(value) is bool:
67
- self.add_to_stage_report(f'Capability set: {key} - {value}')
68
- # Add reason test failed to report if neccessary
69
- if self.stage_pass == MINIMUM_SCORE:
70
- self.error_summary = "API (JSON structure) is invalid. "
71
- self.add_to_stage_report(f'\n{len(self.validation[1])} validation errors:')
72
- for error in self.validation[1]:
73
- self.add_to_stage_report(error.message)
74
- self.add_to_stage_report(f"Please look into the Status section in:\n{GW_MQTT_DOC}")
75
-
76
- self.add_report_topic_validation('status')
77
- else:
78
- self.error_summary = f"No message recieved from GW in status topic after {STATUS_MSG_TIMEOUT} mins."
79
- self.add_to_stage_report(self.error_summary)
80
-
81
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
82
- stage_report=self.report.split('\n'))
83
- debug_print(self.report)
84
- return super().generate_stage_report()
85
-
86
-
87
- class InterferenceAnalysisStage(GenericStage):
88
- def __init__(self, sniffer:BLESniffer, **kwargs):
89
- self.sniffer = sniffer
90
- self.conversion_table_df = None
91
- self.stage_tooltip = "Analyze BLE interference level (Bad CRC %)"
92
- self.__dict__.update(kwargs)
93
-
94
- # Stage shows warning if CER is >=50%
95
- self.result_indication = INFORMATIVE
96
- self.pass_min = 51
97
-
98
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
99
-
100
- def get_data_from_quantization_csv(self):
101
- relative_path = CSV_NAME
102
- csv_path = pkg_resources.resource_filename(__name__, relative_path)
103
- conversion_table_df = pd.read_csv(csv_path)
104
- self.conversion_table_df = conversion_table_df
105
-
106
- def interference_analysis(self):
107
- """Analyze the interference level (PER) before the test begins"""
108
- self.report_buffer = []
109
-
110
- def handle_wrap_around(a):
111
- "handle a wrap around of the counter"
112
- if a < 0:
113
- a = a + MAX_UNSIGNED_32_BIT
114
- return a
115
-
116
- for channel in CHANNELS_TO_ANALYZE:
117
- # Send the sniffer a command to retrive the counters and convert them to dict
118
- start_cntrs = self.sniffer.get_pkts_cntrs(channel[0])
119
- debug_print(f'Analyzing channel {channel[0]}... (30 seconds)')
120
- time.sleep(CNTRS_LISTEN_TIME_SEC)
121
- end_cntrs = self.sniffer.get_pkts_cntrs(channel[0])
122
-
123
- if start_cntrs == None or end_cntrs == None:
124
- debug_print(f'Channel {channel[0]} ({channel[1]} MHz) interference analysis was skipped beacause at least one counter is missing.')
125
- self.report_buffer.append(f'Channel {channel[0]} ({channel[1]} MHz) Ambient Interference was not calculated, missing at least one counter.')
126
- self.stage_pass = INCONCLUSIVE_MINIMUM
127
- continue
128
-
129
- # Calculate the bad CRC percentage
130
- diff_dict = dict()
131
- for key in CNTRS_KEYS:
132
- diff_dict[key] = handle_wrap_around(end_cntrs[key] - start_cntrs[key])
133
- if (diff_dict[WLT_RX] + diff_dict[NON_WLT_RX]) > 0:
134
- bad_crc_percentage = round((diff_dict[BAD_CRC] / (diff_dict[WLT_RX] + diff_dict[NON_WLT_RX])) * 100)
135
- else:
136
- bad_crc_percentage = 0
137
- self.report_buffer.append(f'Channel {channel[0]} ({channel[1]} MHz) Ambient Interference (bad CRC percentage) is: {bad_crc_percentage}%.')
138
- self.report_buffer.append(f'Good CRC packets = {diff_dict[NON_WLT_RX] + diff_dict[WLT_RX] - diff_dict[BAD_CRC]}, bad CRC packets: {diff_dict[BAD_CRC]}')
139
-
140
- good_crc_percentage = 100 - bad_crc_percentage
141
- if (self.stage_pass == MINIMUM_SCORE) or (good_crc_percentage < self.stage_pass):
142
- self.stage_pass = good_crc_percentage
143
- if self.stage_pass < self.pass_min:
144
- self.error_summary = "High bad CRC rate within the current environment."
145
-
146
- # Uncomment if you want to see PER of the site (will require print adjustments). Below, we use the truth table from the csv to match PER the bad CRC percentage. Require an update of the CSV to the bridge-GW case
147
- # closest_index = (self.conversion_table_df['bad_crc_percent'] - bad_crc_percentage).abs().idxmin()
148
- # per_percent = self.conversion_table_df.iloc[closest_index]['per_percent']
149
- # self.add_to_stage_report(f'Channel {channel} PER is: {per_percent}%')
150
-
151
- def run(self):
152
- super().run()
153
- # Run interference analysis
154
- # Note: there is an infrastructure for converting bad_CRC % to PER, currently unused and commented since the quantization_csv does not match the bridge to GW case.
155
- debug_print(f"Starting interference analysis for channels {[ch[0] for ch in CHANNELS_TO_ANALYZE]}. This will take {30 * len(CHANNELS_TO_ANALYZE)} seconds (total)")
156
- # self.get_data_from_quantization_csv()
157
- self.interference_analysis()
158
-
159
- def generate_stage_report(self):
160
- self.add_report_header()
161
- for line in self.report_buffer:
162
- self.add_to_stage_report(line)
163
-
164
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
165
- stage_report=self.report.split('\n'))
166
- debug_print(self.report)
167
- return super().generate_stage_report()
168
-
169
- STAGES = [ConnectionStage]
170
-
171
- class ConnectionTest(GenericTest):
172
- def __init__(self, **kwargs):
173
- self.test_tooltip = "Stages related to cloud connectivity and environment"
174
- self.__dict__.update(kwargs)
175
- super().__init__(**self.__dict__, test_name=type(self).__name__)
176
- stages = STAGES
177
- current_version = self.uart.get_version()
178
- if current_version != None and version.parse(current_version) >= version.parse(INTERFERENCE_ANALYSIS_FW_VER):
179
- stages.append(InterferenceAnalysisStage)
180
- self.stages = [stage(**self.__dict__) for stage in stages]
181
-
182
- def run(self):
183
- super().run()
184
- for stage in self.stages:
185
- stage.prepare_stage()
186
- stage.run()
187
- self.add_to_test_report(stage.generate_stage_report())
188
- self.test_pass = PassCriteria.calc_for_test(self, stage)