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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
  2. {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
  3. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2brg_ota.json +69 -0
  4. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb.json +109 -0
  5. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +45 -0
  6. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/calibration.json +96 -0
  7. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/custom.json +99 -0
  8. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/datapath.json +241 -13
  9. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energy2400.json +120 -0
  10. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/energySub1g.json +96 -0
  11. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/externalSensor.json +135 -6
  12. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/interface.json +157 -0
  13. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/powerManagement.json +205 -0
  14. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json → certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +27 -11
  15. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
  16. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
  17. certificate/cert_common.py +1459 -0
  18. certificate/cert_config.py +455 -0
  19. {brg_certificate → certificate}/cert_data_sim.py +131 -46
  20. {brg_certificate → certificate}/cert_defines.py +120 -128
  21. {brg_certificate → certificate}/cert_gw_sim.py +151 -49
  22. {brg_certificate → certificate}/cert_mqtt.py +164 -59
  23. {brg_certificate → certificate}/cert_prints.py +34 -33
  24. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  25. {brg_certificate → certificate}/cert_results.py +205 -48
  26. certificate/cert_utils.py +622 -0
  27. certificate/certificate.py +198 -0
  28. certificate/certificate_cli.py +79 -0
  29. certificate/certificate_eth_test_list.txt +74 -0
  30. certificate/certificate_sanity_test_list.txt +65 -0
  31. certificate/certificate_test_list.txt +75 -0
  32. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +2 -2
  33. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  34. certificate/tests/calibration/output_power_test/output_power_test.json +22 -0
  35. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  36. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +1 -1
  37. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  38. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +14 -0
  39. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  40. certificate/tests/cloud_connectivity/acl_test/acl_test.json +14 -0
  41. certificate/tests/cloud_connectivity/acl_test/acl_test.py +98 -0
  42. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +18 -0
  43. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +39 -0
  44. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +18 -0
  45. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  46. certificate/tests/cloud_connectivity/connection_test/connection_test.json +17 -0
  47. certificate/tests/cloud_connectivity/connection_test/connection_test.py +74 -0
  48. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +20 -0
  49. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +204 -0
  50. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +16 -0
  51. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +98 -0
  52. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +17 -0
  53. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +57 -0
  54. certificate/tests/cloud_connectivity/registration_test/registration_test.json +19 -0
  55. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  56. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  57. certificate/tests/cloud_connectivity/stress_test/stress_test.json +16 -0
  58. certificate/tests/cloud_connectivity/stress_test/stress_test.py +97 -0
  59. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +24 -0
  60. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +93 -0
  61. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +19 -0
  62. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +161 -0
  63. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +1 -1
  64. certificate/tests/datapath/aging_test/aging_test.py +138 -0
  65. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +16 -0
  66. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +95 -0
  67. certificate/tests/datapath/event_test/event_test.json +16 -0
  68. certificate/tests/datapath/event_test/event_test.py +85 -0
  69. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -1
  70. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +10 -8
  71. certificate/tests/datapath/output_power_test/output_power_test.json +22 -0
  72. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  73. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +1 -1
  74. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +10 -8
  75. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +1 -1
  76. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  77. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +2 -2
  78. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  79. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +19 -0
  80. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  81. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +1 -1
  82. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +11 -10
  83. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +18 -0
  84. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +83 -0
  85. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +1 -1
  86. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  87. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +1 -1
  88. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  89. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
  90. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  91. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +5 -4
  92. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  93. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  94. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  95. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +7 -7
  96. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +112 -72
  97. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +7 -7
  98. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  99. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +3 -3
  100. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +12 -11
  101. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +3 -3
  102. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +12 -11
  103. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -1
  104. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  105. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +14 -0
  106. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  107. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +14 -0
  108. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  109. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +14 -0
  110. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  111. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +14 -0
  112. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  113. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +15 -0
  114. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  115. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +14 -0
  116. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  117. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +14 -0
  118. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  119. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +14 -0
  120. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +41 -0
  121. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +2 -2
  122. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  123. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +1 -1
  124. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  125. certificate/tests/energy2400/output_power_test/output_power_test.json +22 -0
  126. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  127. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +1 -1
  128. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  129. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +25 -0
  130. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +378 -0
  131. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +3 -3
  132. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py → certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +97 -87
  133. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +23 -0
  134. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  135. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +1 -1
  136. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  137. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +1 -1
  138. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  139. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +1 -1
  140. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  141. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +4 -4
  142. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +455 -0
  143. certificate/wlt_types.py +122 -0
  144. {gw_certificate → common}/api_if/202/status.json +6 -0
  145. {gw_certificate → common}/api_if/203/status.json +6 -0
  146. {gw_certificate → common}/api_if/204/status.json +6 -0
  147. common/api_if/206/data.json +85 -0
  148. common/api_if/206/status.json +69 -0
  149. common/api_if/api_validation.py +85 -0
  150. common/web/templates/generator.html +148 -0
  151. common/web/templates/index.html +20 -0
  152. common/web/templates/menu.html +54 -0
  153. common/web/templates/parser.html +53 -0
  154. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  155. common/web/web_utils.py +377 -0
  156. {brg_certificate → common}/wltPb_pb2.py +14 -12
  157. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  158. gui_certificate/gui_certificate_cli.py +14 -0
  159. gui_certificate/server.py +1062 -0
  160. gui_certificate/templates/cert_run.html +1207 -0
  161. wiliot_certificate-4.5.0a1.dist-info/METADATA +110 -0
  162. wiliot_certificate-4.5.0a1.dist-info/RECORD +182 -0
  163. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/WHEEL +1 -1
  164. wiliot_certificate-4.5.0a1.dist-info/entry_points.txt +5 -0
  165. wiliot_certificate-4.5.0a1.dist-info/top_level.txt +3 -0
  166. brg_certificate/ag/energous_v0_defines.py +0 -925
  167. brg_certificate/ag/energous_v1_defines.py +0 -931
  168. brg_certificate/ag/energous_v2_defines.py +0 -925
  169. brg_certificate/ag/energous_v3_defines.py +0 -925
  170. brg_certificate/ag/energous_v4_defines.py +0 -925
  171. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  172. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  173. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  174. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  175. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  176. brg_certificate/brg_certificate.py +0 -225
  177. brg_certificate/brg_certificate_cli.py +0 -63
  178. brg_certificate/cert_common.py +0 -923
  179. brg_certificate/cert_config.py +0 -402
  180. brg_certificate/cert_utils.py +0 -362
  181. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  182. brg_certificate/certificate_bcc_test_list.txt +0 -48
  183. brg_certificate/certificate_sanity_test_list.txt +0 -43
  184. brg_certificate/certificate_test_list.txt +0 -53
  185. brg_certificate/config/eclipse.json +0 -10
  186. brg_certificate/config/hivemq.json +0 -10
  187. brg_certificate/config/mosquitto.json +0 -10
  188. brg_certificate/config/mosquitto.md +0 -95
  189. brg_certificate/config/wiliot-dev.json +0 -10
  190. brg_certificate/restore_brg.py +0 -61
  191. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  192. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  193. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  194. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  195. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  196. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  197. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  198. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  199. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  200. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  201. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  204. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  205. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  206. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  208. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  209. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  210. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  211. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  213. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  215. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  216. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  217. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  218. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  219. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  220. brg_certificate/wltPb_pb2.pyi +0 -234
  221. brg_certificate/wlt_types.py +0 -113
  222. gw_certificate/ag/ut_defines.py +0 -364
  223. gw_certificate/ag/wlt_types.py +0 -85
  224. gw_certificate/ag/wlt_types_ag.py +0 -5310
  225. gw_certificate/ag/wlt_types_data.py +0 -64
  226. gw_certificate/api/extended_api.py +0 -23
  227. gw_certificate/api_if/200/data.json +0 -106
  228. gw_certificate/api_if/200/status.json +0 -47
  229. gw_certificate/api_if/201/data.json +0 -98
  230. gw_certificate/api_if/201/status.json +0 -53
  231. gw_certificate/api_if/205/logs.json +0 -12
  232. gw_certificate/api_if/api_validation.py +0 -38
  233. gw_certificate/api_if/gw_capabilities.py +0 -54
  234. gw_certificate/cert_results.py +0 -145
  235. gw_certificate/common/analysis_data_bricks.py +0 -60
  236. gw_certificate/common/debug.py +0 -42
  237. gw_certificate/common/serialization_formatter.py +0 -93
  238. gw_certificate/common/utils.py +0 -8
  239. gw_certificate/common/utils_defines.py +0 -15
  240. gw_certificate/common/wltPb_pb2.py +0 -84
  241. gw_certificate/gw_certificate.py +0 -154
  242. gw_certificate/gw_certificate_cli.py +0 -87
  243. gw_certificate/interface/4.4.93_app.zip +0 -0
  244. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  245. gw_certificate/interface/ble_simulator.py +0 -61
  246. gw_certificate/interface/ble_sniffer.py +0 -189
  247. gw_certificate/interface/flash_fw.py +0 -90
  248. gw_certificate/interface/if_defines.py +0 -36
  249. gw_certificate/interface/mqtt.py +0 -563
  250. gw_certificate/interface/nrfutil-linux +0 -0
  251. gw_certificate/interface/nrfutil-mac +0 -0
  252. gw_certificate/interface/nrfutil.exe +0 -0
  253. gw_certificate/interface/pkt_generator.py +0 -594
  254. gw_certificate/interface/uart_if.py +0 -236
  255. gw_certificate/interface/uart_ports.py +0 -20
  256. gw_certificate/templates/results.html +0 -241
  257. gw_certificate/templates/stage.html +0 -22
  258. gw_certificate/templates/table.html +0 -6
  259. gw_certificate/templates/test.html +0 -38
  260. gw_certificate/tests/__init__.py +0 -10
  261. gw_certificate/tests/actions.py +0 -289
  262. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  263. gw_certificate/tests/connection.py +0 -188
  264. gw_certificate/tests/downlink.py +0 -172
  265. gw_certificate/tests/generic.py +0 -238
  266. gw_certificate/tests/registration.py +0 -340
  267. gw_certificate/tests/static/__init__.py +0 -0
  268. gw_certificate/tests/static/connection_defines.py +0 -9
  269. gw_certificate/tests/static/downlink_defines.py +0 -9
  270. gw_certificate/tests/static/generated_packet_table.py +0 -195
  271. gw_certificate/tests/static/packet_table.csv +0 -10067
  272. gw_certificate/tests/static/references.py +0 -5
  273. gw_certificate/tests/static/uplink_defines.py +0 -14
  274. gw_certificate/tests/throughput.py +0 -240
  275. gw_certificate/tests/uplink.py +0 -853
  276. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  277. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  278. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  279. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  280. {brg_certificate → certificate}/__init__.py +0 -0
  281. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -0
  282. {brg_certificate → certificate}/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -0
  283. {gw_certificate → common}/api_if/202/data.json +0 -0
  284. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  285. {gw_certificate → common}/api_if/203/data.json +0 -0
  286. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/204/data.json +0 -0
  288. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/205/data.json +0 -0
  290. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/status.json +0 -0
  292. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  293. {gw_certificate → common/api_if}/__init__.py +0 -0
  294. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  295. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -1,8 +1,10 @@
1
- from brg_certificate.cert_prints import *
2
- from brg_certificate.cert_defines import *
3
- from brg_certificate.wlt_types import *
4
- import brg_certificate.cert_common as cert_common
5
- import brg_certificate.cert_config as cert_config
1
+ from certificate.cert_prints import *
2
+ from certificate.cert_defines import *
3
+ from certificate.wlt_types import *
4
+ import certificate.cert_data_sim as cert_data_sim
5
+ import certificate.cert_mqtt as cert_mqtt
6
+ import certificate.cert_common as cert_common
7
+ import certificate.cert_config as cert_config
6
8
 
7
9
 
8
10
  def run(test):
@@ -17,10 +19,13 @@ def run(test):
17
19
 
18
20
  for param in test.params:
19
21
  # A special verification for 38_38_39, which is irrelevant for bridge with cloud connectivity
20
- if param.value == ag.CALIBRATION_PATTERN_38_38_39 and not cert_common.is_bcc_running(test):
22
+ if param.value == ag.CALIBRATION_PATTERN_38_38_39 and not test.dut_is_combo():
21
23
  utPrint("\nCALIBRATION_PATTERN_38_38_39 was configured - checking the GW doesn't receive tag packets", "BLUE")
22
- # Config internal_brg's rx_channel to CHANNEL_37
23
- test = cert_config.internal_brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_37], module=datapath_module)[0]
24
+ # Config tester's rx_channel to CHANNEL_37
25
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL],
26
+ values=[ag.RX_CHANNEL_37],
27
+ module=test.tester.internal_brg.datapath,
28
+ target=TESTER)[0]
24
29
  if test.rc != TEST_FAILED:
25
30
  # Configure the BRG, wait=False
26
31
  test = cert_config.brg_configure(test, fields=[BRG_PATTERN, BRG_CALIB_INTERVAL],
@@ -31,7 +36,7 @@ def run(test):
31
36
  else:
32
37
  test.reset_result() # reset result
33
38
  continue # skip the current phase and continue to next param
34
- cert_common.wait_time_n_print(CLEAR_DATA_PATH_TIMEOUT)
39
+ wait_time_n_print(CLEAR_DATA_PATH_TIMEOUT)
35
40
  # MQTT scan
36
41
  if test.data == DATA_SIMULATION:
37
42
  # start generating pkts and send them using data simulator
@@ -44,16 +49,16 @@ def run(test):
44
49
  time.sleep(5)
45
50
 
46
51
  # Analyze pass/fail
47
- gw_tags_pkts = len(df.query('src_id == gw_id'))
48
- brg_tags_pkts = len(df.query('src_id != gw_id'))
52
+ gw_tags_pkts = len(df.query(f'src_id == {GW_ID}'))
53
+ brg_tags_pkts = len(df.query(f'src_id != {GW_ID}'))
49
54
  print(f"Found gw_tags_pkts={gw_tags_pkts}, brg_tags_pkts={brg_tags_pkts}")
50
55
  if (gw_tags_pkts == 0 and test.data == DATA_REAL_TAGS) or brg_tags_pkts != 0:
51
56
  test.rc = TEST_FAILED
52
57
  test.add_reason(f"gw_tags_pkts={gw_tags_pkts} brg_tags_pkts={brg_tags_pkts} for BRG 38,38,39 calibration, "
53
58
  "and GW scanning on ch 37")
54
- # Revert internal_brg
55
- test = cert_config.internal_brg_configure(test, module=datapath_module)[0]
56
- generate_log_file(test, param.name)
59
+ # Revert tester
60
+ test = cert_config.brg_configure(test, module=test.tester.internal_brg.datapath, target=TESTER)[0]
61
+ cert_mqtt.generate_log_file(test, param.name)
57
62
  field_functionality_pass_fail_print(test, fields[0], value=param.name)
58
63
  test.set_phase_rc(param.name, test.rc)
59
64
  test.add_phase_reason(param.name, test.reason)
@@ -63,7 +68,7 @@ def run(test):
63
68
  test.reset_result() # reset result and continue to next param
64
69
  else:
65
70
  test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=calib_module)[0]
66
- generate_log_file(test, param.name)
71
+ cert_mqtt.generate_log_file(test, param.name)
67
72
  field_functionality_pass_fail_print(test, fields[0], value=param.name)
68
73
  test.set_phase_rc(param.name, test.rc)
69
74
  test.add_phase_reason(param.name, test.reason)
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Access Control List using Extended Advertising",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Test the access control list (ACL) functionality, configure allow list and deny list and test the behavior, while the Bridge is transmitting in extended advertising",
5
+ "documentation": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "Gateway configured to defaults",
7
+ "procedure": ["Test prolog", "configure the brg to be on the deny list", "configure the brg to be on the allow list", "Test epilog"],
8
+ "expectedOutcome": "For the deny list - no unified packets are found, for the allow list - unified packets are found",
9
+ "mandatory": 0,
10
+ "multiBridgeTest": 0,
11
+ "gwOnlyTest": 1,
12
+ "dataSimOnlyTest": 1,
13
+ "allSupportedValues": ["deny", "allow"]
14
+ }
@@ -0,0 +1,140 @@
1
+ from certificate.cert_prints import *
2
+ from certificate.cert_defines import *
3
+ from certificate.wlt_types import *
4
+ import certificate.cert_mqtt as cert_mqtt
5
+ import certificate.cert_common as cert_common
6
+ import certificate.cert_config as cert_config
7
+ import certificate.cert_data_sim as cert_data_sim
8
+ from certificate.ag.wlt_types_ag import *
9
+ import certificate.cert_gw_sim as cert_gw_sim
10
+
11
+
12
+ # DEFINES
13
+ DUPLICATES = 5
14
+ DELAY = 20
15
+ test_indicator = cert_data_sim.PIXEL_SIM_INDICATOR
16
+
17
+
18
+ def generate_expected_pkts(acl_bridge_ids, non_acl_bridge_id, pixels_pkts, mgmt_pkts):
19
+ expected_pkts_allow, expected_pkts_deny = [], []
20
+ # This payload is hardcoded in !ble_sim_ext_adv when adding extra data packets after mgmt packets
21
+ extra_data_payload = "1E16C6FC000039019F8BB88B5EE6CB0F5760B70AA55C87A494776400000000" * 5
22
+
23
+ for pkt in pixels_pkts:
24
+ brg_id = cert_common.change_endianness(pkt.adva)
25
+ (expected_pkts_allow if brg_id in acl_bridge_ids else expected_pkts_deny).append(brg_id + pkt.payload * 7)
26
+ for pkt in mgmt_pkts:
27
+ brg_id = cert_common.change_endianness(pkt.adva)
28
+ if brg_id in acl_bridge_ids:
29
+ expected_pkts_allow.append(brg_id + pkt.payload * 2 + extra_data_payload)
30
+ expected_pkts_deny.append(brg_id + pkt.payload * 2)
31
+ elif brg_id == non_acl_bridge_id:
32
+ expected_pkts_allow.append(brg_id + pkt.payload * 2)
33
+ expected_pkts_deny.append(brg_id + pkt.payload * 2 + extra_data_payload)
34
+ return expected_pkts_allow, expected_pkts_deny
35
+
36
+
37
+ def run(test):
38
+
39
+ test = cert_common.test_prolog(test)
40
+ if test.rc == TEST_FAILED:
41
+ return cert_common.test_epilog(test)
42
+
43
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER)
44
+
45
+ # Generate management and data packets
46
+ pixels_pkts, bridge_ids = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=100, num_of_brgs=4,
47
+ pkt_type=PIXELS_PKT, indicator=test_indicator)
48
+ mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=100, num_of_brgs=4, brgs_list=bridge_ids,
49
+ pkt_type=MGMT_PKT, indicator=test_indicator)
50
+
51
+ # Use first 3 bridges for ACL, 4th bridge is not in ACL
52
+ acl_bridge_ids = bridge_ids[:3]
53
+ non_acl_bridge_id = bridge_ids[3]
54
+
55
+ expected_pkts_allow, expected_pkts_deny = generate_expected_pkts(acl_bridge_ids, non_acl_bridge_id, pixels_pkts, mgmt_pkts)
56
+
57
+ for param in test.params:
58
+ phase_run_print(f"ACL Extended Advertising Test - Mode: {param.value}")
59
+
60
+ cfg = cert_config.get_default_gw_dict(test)
61
+ cfg[ACL][ACL_BRIDGE_IDS] = acl_bridge_ids
62
+ cfg[ACL][ACL_MODE] = param.value
63
+ test, ret = cert_config.gw_configure(test, cfg=cfg, wait=True)
64
+ print_update_wait(1)
65
+
66
+ test.get_mqttc_by_target(DUT).flush_pkts()
67
+
68
+ # We provide the tester with the first pkt only. It concatenates the packets to an aggregated packet.
69
+ for pkt in mgmt_pkts:
70
+ # Here the aggregated packet is 2 mgmt pkts and 5 hardcoded data pkts
71
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_EXT_ADV} {pkt.get_pkt()} {DUPLICATES} '
72
+ f'{OUTPUT_POWER_2_4_MAX} {DELAY} {1} {1}', TESTER)
73
+ print_update_wait(0.1)
74
+ for pkt in pixels_pkts:
75
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_EXT_ADV} {pkt.get_pkt()} {DUPLICATES} '
76
+ f'{OUTPUT_POWER_2_4_MAX} {DELAY}', TESTER)
77
+ print_update_wait(0.1)
78
+ print_update_wait(1)
79
+
80
+ cert_mqtt.dump_pkts(test, log=param.name)
81
+
82
+ # Analyze pass/fail
83
+ # Get all received aggregated packets with the test indicator
84
+ received_pkts = cert_mqtt.get_all_aggregated_data_pkts(test.get_mqttc_by_target(DUT), indicator=test_indicator)
85
+
86
+ # Validate that received packets match expected packets
87
+ expected_pkts = set(expected_pkts_deny if param.value == ACL_DENY else expected_pkts_allow)
88
+ for p in received_pkts:
89
+ pkt = p[ALIAS_BRIDGE_ID] + p[AGGREGATED_PAYLOAD]
90
+ if pkt not in expected_pkts:
91
+ test.rc = TEST_FAILED
92
+ test.add_reason(f"Phase failed! Received unexpected packet from brg {p[ALIAS_BRIDGE_ID]} in {param.value} mode")
93
+ break
94
+
95
+ # Filter packets by bridge IDs in ACL list
96
+ received_data_pkts = [pkt for pkt in received_pkts if MGMT_PKT not in pkt]
97
+ acl_bridge_pkts = [pkt for pkt in received_data_pkts if pkt[ALIAS_BRIDGE_ID] in acl_bridge_ids]
98
+ non_acl_bridge_pkts = [pkt for pkt in received_data_pkts if pkt[ALIAS_BRIDGE_ID] == non_acl_bridge_id]
99
+
100
+ # In deny mode - we want to make sure bridges in ACL list are filtered
101
+ if param.value == ACL_DENY:
102
+ if len(non_acl_bridge_pkts) == 0:
103
+ test.rc = TEST_FAILED
104
+ test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not in the deny list "
105
+ f"and packets were not found from it")
106
+ if len(acl_bridge_pkts) != 0:
107
+ test.rc = TEST_FAILED
108
+ test.add_reason("Phase failed! Received packets from bridges that were on the deny list")
109
+
110
+ # In allow mode - we want to make sure only bridges in ACL list are not filtered
111
+ if param.value == ACL_ALLOW:
112
+ if len(non_acl_bridge_pkts) != 0:
113
+ test.rc = TEST_FAILED
114
+ test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not on the allow list "
115
+ f"and {len(non_acl_bridge_pkts)} packets were found from it")
116
+ # Check that we received packets from all expected bridges
117
+ received_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
118
+ if received_bridge_ids != set(acl_bridge_ids):
119
+ test.rc = TEST_FAILED
120
+ test.add_reason("Phase failed! Didn't receive packets from all bridges that were on the allow list")
121
+
122
+ # Check that management packets are received from all bridges (ACL doesn't filter mgmt packets)
123
+ all_mgmt_pkts = cert_mqtt.get_all_mgmt_pkts(test.get_mqttc_by_target(DUT), indicator=test_indicator)
124
+ mgmt_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
125
+ if not set(bridge_ids).issubset(mgmt_bridge_ids):
126
+ test.rc = TEST_FAILED
127
+ missing_bridges = set(bridge_ids) - mgmt_bridge_ids
128
+ test.add_reason(f"Phase failed! Expected management packets from all bridges, "
129
+ f"whether they are on the ACL or not, but missing from BRG {missing_bridges}")
130
+
131
+ field_functionality_pass_fail_print(test, "ACL", value=param.value)
132
+ test.set_phase_rc(param.name, test.rc)
133
+ test.add_phase_reason(param.name, test.reason)
134
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
135
+ break
136
+ else:
137
+ test.reset_result()
138
+
139
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
140
+ return cert_common.test_epilog(test, revert_gws=True)
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Access Control List",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Test the access control list (ACL) functionality, configure allow list and deny list and test the behavior",
5
+ "documentation": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "Gateway configured to defaults",
7
+ "procedure": ["Test prolog", "configure the brg to be on the deny list", "configure the brg to be on the allow list", "Test epilog"],
8
+ "expectedOutcome": "For the deny list - no unified packets are found, for the allow list - unified packets are found",
9
+ "mandatory": 0,
10
+ "multiBridgeTest": 0,
11
+ "gwOnlyTest": 1,
12
+ "dataSimOnlyTest": 1,
13
+ "allSupportedValues": ["deny", "allow"]
14
+ }
@@ -0,0 +1,98 @@
1
+ from certificate.cert_prints import *
2
+ from certificate.cert_defines import *
3
+ from certificate.wlt_types import *
4
+ import certificate.cert_mqtt as cert_mqtt
5
+ import certificate.cert_common as cert_common
6
+ import certificate.cert_config as cert_config
7
+ import certificate.cert_data_sim as cert_data_sim
8
+ from certificate.ag.wlt_types_ag import *
9
+
10
+ SCAN_TIMEOUT = 30
11
+
12
+ # DEFINES
13
+ test_indicator = cert_data_sim.PIXEL_SIM_INDICATOR
14
+
15
+
16
+ def run(test):
17
+
18
+ test = cert_common.test_prolog(test)
19
+ if test.rc == TEST_FAILED:
20
+ return cert_common.test_epilog(test)
21
+
22
+ # Generate management and data packets
23
+ bridge_ids = []
24
+ pixels_pkts, bridge_ids = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=20, num_of_brgs=4,
25
+ pkt_type=PIXELS_PKT, indicator=test_indicator)
26
+
27
+ mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=4, brgs_list=bridge_ids,
28
+ pkt_type=MGMT_PKT, indicator=test_indicator)
29
+ # Use first 3 bridges for ACL, 4th bridge is not in ACL
30
+ acl_bridge_ids = bridge_ids[:3]
31
+ non_acl_bridge_id = bridge_ids[3]
32
+ pkts = pixels_pkts + mgmt_pkts
33
+
34
+ sim_thread = cert_data_sim.GenericSimThread(test=test, pkts=pkts)
35
+ sim_thread.start()
36
+
37
+ for param in test.params:
38
+ phase_run_print(f"ACL Test - Mode: {param.value}")
39
+ test.flush_all_mqtt_packets()
40
+
41
+ cfg = cert_config.get_default_gw_dict(test)
42
+ cfg[ACL][ACL_BRIDGE_IDS] = acl_bridge_ids
43
+ cfg[ACL][ACL_MODE] = param.value
44
+ test, ret = cert_config.gw_configure(test, cfg=cfg, wait=True)
45
+ print_update_wait(1)
46
+
47
+ test.get_mqttc_by_target(DUT).flush_pkts()
48
+ mqtt_scan_wait(test, SCAN_TIMEOUT)
49
+ cert_mqtt.dump_pkts(test, log=param.name)
50
+
51
+ # Analyze pass/fail
52
+ # Get all received packets with the test indicator and filter packets by bridge IDs in ACL list
53
+ received_pkts = cert_mqtt.get_unified_data_pkts(test, only_active_brg=False, indicator=test_indicator)
54
+ acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in acl_bridge_ids]
55
+ non_acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in non_acl_bridge_id]
56
+
57
+ # In deny mode - we want to make sure bridges in ACL list are filtered
58
+ if param.value == ACL_DENY:
59
+ if len(non_acl_bridge_pkts) == 0:
60
+ test.rc = TEST_FAILED
61
+ test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not in the deny list "
62
+ f"and packets were not found from it")
63
+ if len(acl_bridge_pkts) != 0:
64
+ test.rc = TEST_FAILED
65
+ test.add_reason("Phase failed! Received packets from bridges that were on the deny list")
66
+
67
+ # In allow mode - we want to make sure only bridges in ACL list are not filtered
68
+ if param.value == ACL_ALLOW:
69
+ if len(non_acl_bridge_pkts) != 0:
70
+ test.rc = TEST_FAILED
71
+ test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not on the allow list "
72
+ f"and {len(non_acl_bridge_pkts)} packets were found from it")
73
+ # Check that we received packets from all expected bridges
74
+ received_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
75
+ if received_bridge_ids != set(acl_bridge_ids):
76
+ test.rc = TEST_FAILED
77
+ test.add_reason("Phase failed! Didn't receive packets from all bridges that were on the allow list")
78
+
79
+ # Check that management packets are received from all bridges (ACL doesn't filter mgmt packets)
80
+ all_mgmt_pkts = cert_mqtt.get_all_mgmt_pkts(test.get_mqttc_by_target(DUT), indicator=test_indicator)
81
+ mgmt_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
82
+
83
+ if not set(bridge_ids).issubset(mgmt_bridge_ids):
84
+ test.rc = TEST_FAILED
85
+ missing_bridges = set(bridge_ids) - mgmt_bridge_ids
86
+ test.add_reason(f"Phase failed! Expected management packets from all bridges, "
87
+ f"whether they are on the ACL or not, but missing from BRG {missing_bridges}")
88
+
89
+ field_functionality_pass_fail_print(test, "ACL", value=param.value)
90
+ test.set_phase_rc(param.name, test.rc)
91
+ test.add_phase_reason(param.name, test.reason)
92
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
93
+ break
94
+ else:
95
+ test.reset_result()
96
+
97
+ sim_thread.stop()
98
+ return cert_common.test_epilog(test, revert_gws=True, modules=[])
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "Bridge OTA",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Verify the device can perform bridge firmware upgrade over the air",
5
+ "documentation": ["https://community.wiliot.com/customers/s/article/Bridge-OTA"],
6
+ "initialCondition": "Gateway online, with bridgeOtaUpgradeSupported and in current latest version",
7
+ "procedure": ["Test prolog",
8
+ "Publish an OTA action to the gateway",
9
+ "Analyze if bridge was upgraded and action status message was uploaded",
10
+ "Test epilog"],
11
+ "expectedOutcome": "Tester brg advertises ModuleIF packet with the new version and DUT Gateway publish an actionStatus message indicating success and within timeout",
12
+ "mandatory": 1,
13
+ "multiBridgeTest": 0,
14
+ "gwOnlyTest": 1,
15
+ "internalBridge": 1,
16
+ "allSupportedValues": []
17
+
18
+ }
@@ -0,0 +1,39 @@
1
+
2
+ from certificate.cert_prints import *
3
+ from certificate.cert_defines import *
4
+ from certificate.wlt_types import *
5
+ from certificate.cert_utils import TESTER_FW_VERSIONS
6
+ from certificate.cert_gw_sim import STOP_ADVERTISING, GW_SIM_RESET_TS
7
+ import certificate.cert_common as cert_common
8
+ import certificate.cert_config as cert_config
9
+ import certificate.cert_mqtt as cert_mqtt
10
+
11
+
12
+ def run(test):
13
+ test = cert_common.test_prolog(test)
14
+ if test.rc == TEST_FAILED:
15
+ return cert_common.test_epilog(test)
16
+
17
+ phase_run_print("BRG OTA started")
18
+ utPrint("Important: For the gateway to be able to download the file, it must use a valid token in the HTTP GET request.", "WARNING")
19
+ utPrint("Meaning It must be registered under an owner, and the certificate '-env' should correspond to that owner.", "WARNING")
20
+ test.flush_all_mqtt_packets()
21
+ target_brg = test.tester.internal_brg
22
+ desired_ver = TESTER_FW_VERSIONS[0] if target_brg.version != TESTER_FW_VERSIONS[0] else TESTER_FW_VERSIONS[1]
23
+
24
+ # Initiate action
25
+ utPrint(f"Publishing OTA action to DUT: {test.dut.mqttc.update_topic}. Awaiting OTA.. (timeout is {VER_UPDATE_TIMEOUT} minutes)")
26
+ # Set active_brg to be the tester, for reboot_config_analysis within brg_ota
27
+ test.active_brg = target_brg
28
+ test = cert_config.brg_ota(test, ble_version=desired_ver, search_ack=True, target=TESTER, upgrader=DUT)
29
+
30
+ # Stop advertising on tester in case it just rebooted after getting OTA. So it is ready for next tests
31
+ cert_config.gw_action(test, STOP_ADVERTISING, target=TESTER)
32
+
33
+ cert_mqtt.generate_log_file(test, "brg_ota")
34
+
35
+ if test.rc == TEST_PASSED and GW_SIM_RESET_TS is not None:
36
+ reboot_pkt_time = int((GW_SIM_RESET_TS - test.start_time).total_seconds())
37
+ test.reason = f"Reboot pkt received after {reboot_pkt_time} seconds"
38
+
39
+ return cert_common.test_epilog(test)
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "Gateway Channel behavior",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Test gateway's channel scanning time cycles on all main channels",
5
+ "documentation": "<TEST_DOCUMENTATION_LINK>",
6
+ "initialCondition": "Gateway configured with default settings",
7
+ "procedure": ["Test prolog",
8
+ "Send packets as close as possible to continuously on all 3 channels, with a unique channel identifier",
9
+ "Scan for packets and identify scanning behaviour",
10
+ "Test epilog"],
11
+ "expectedOutcome": "There is no expected outcome from the GW (Only behaviour analysis)",
12
+ "mandatory": 1,
13
+ "multiBridgeTest": 0,
14
+ "gwOnlyTest": 1,
15
+ "dataSimOnlyTest": 1,
16
+ "internalBridge": 1,
17
+ "allSupportedValues": []
18
+ }
@@ -0,0 +1,215 @@
1
+ from certificate.cert_prints import *
2
+ from certificate.cert_defines import *
3
+ from certificate.wlt_types import *
4
+ from certificate.ag.wlt_types_ag import OUTPUT_POWER_2_4_MAX
5
+ import certificate.cert_common as cert_common
6
+ import certificate.cert_utils as cert_utils
7
+ import certificate.cert_mqtt as cert_mqtt
8
+ import certificate.cert_config as cert_config
9
+ import certificate.cert_gw_sim as cert_gw_sim
10
+ import os
11
+ import math
12
+ import pandas as pd
13
+ import plotly.express as px
14
+ import time
15
+ from collections import defaultdict
16
+
17
+
18
+ # DEFINES
19
+ CHANNELS = [37, 38, 39] # channel to check in DUT
20
+ DEFAULT_WAIT_TIME = 5 # How much extra time to wait after the transmition is over
21
+ SCAN_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6) # Unique identifier for the pkt sent
22
+ ADV_DURATION = 20 # How long to transmit to the DUT
23
+ # cmd_ble_sm defines
24
+ BLE_SIM_RADIO_1MBPS = 1
25
+ BLE_SIM_SINGLE_UNIQUE_PKT = 1
26
+ SCAN_DUPLICATES = 1
27
+ BLE_SIM_ADV_37_38_39 = 0
28
+ UNIQUE_CONTENT = 1
29
+ PPS = 20
30
+
31
+ # HELPER FUNCTIONS
32
+
33
+
34
+ def interpolation(payload, next_payload, channel_pkt_counter):
35
+ cur_pkt_num = int.from_bytes(bytes.fromhex(payload[-8:]), byteorder="little")
36
+ next_pkt_num = int.from_bytes(bytes.fromhex(next_payload[-8:]), byteorder="little")
37
+ diff = next_pkt_num - cur_pkt_num
38
+ if diff > 1:
39
+ channel_pkt_counter += diff - 1
40
+ return channel_pkt_counter
41
+
42
+
43
+ def compute_channels_windows(timeline_df):
44
+ """
45
+ Build contiguous channel windows: for each run of the same channel, return (channel, start_ts, end_ts).
46
+ The result is and array of these windows. For exmaple: [(37, 0.004), (38, 0.038), .....]
47
+ """
48
+ windows = []
49
+ current_ch = timeline_df.iloc[0]['channel']
50
+ start_ts = timeline_df.iloc[0]['timestamp_ms']
51
+
52
+ for _, row in timeline_df.iloc[1:].iterrows():
53
+ if row['channel'] != current_ch:
54
+ windows.append((current_ch, start_ts))
55
+ current_ch = row['channel']
56
+ start_ts = row['timestamp_ms']
57
+
58
+ windows.append((current_ch, start_ts))
59
+ return windows
60
+
61
+
62
+ def compute_listening_stats(windows):
63
+ per_channel_starts = defaultdict(list)
64
+ avg_start_to_start_ms = {}
65
+
66
+ for ch, start_ts in windows:
67
+ per_channel_starts[ch].append(start_ts)
68
+
69
+ # Calculating the avg for each channel of the compelte cycle it does (that inclues all channels listend to)
70
+ for ch in CHANNELS:
71
+ starts = sorted(per_channel_starts.get(ch, []))
72
+ start_gaps = [curr - prev for prev, curr in zip(starts, starts[1:])]
73
+ avg_start_to_start_ms[ch] = sum(start_gaps) / len(start_gaps) if start_gaps else 0
74
+
75
+ return avg_start_to_start_ms
76
+
77
+
78
+ def analyze_listening_timeline(test, all_pkts_received_from_tester, num_of_sent_pkts, start_timestamp_ms):
79
+ """
80
+ Build a timeline graph and print channel listening percentages.
81
+ """
82
+ timeline_entries = []
83
+ channel_pkt_counter = defaultdict(int)
84
+ channel_cards = []
85
+
86
+ # Parse data into {ts, channel pairs} - X and Y axis
87
+ for idx, pkt in enumerate(all_pkts_received_from_tester):
88
+ payload = pkt.get(PAYLOAD)
89
+ channel = int(payload[-10:-8], 16)
90
+ time_stamp = float(pkt.get(TIMESTAMP))
91
+
92
+ # Add dropped packts in the middle of listening windows to neglect it from not scanning window
93
+ # Those complitions will not apear in the graph, only on % calculations
94
+ # If there are packets dropped at the ed of a window - it can not detect that
95
+ if idx < len(all_pkts_received_from_tester) - 1:
96
+ next_pkt = all_pkts_received_from_tester[idx + 1]
97
+ next_channel = int(next_pkt.get(PAYLOAD)[-10:-8], 16)
98
+ if next_channel == channel:
99
+ next_payload = next_pkt.get(PAYLOAD)
100
+ channel_pkt_counter[channel] = interpolation(payload, next_payload, channel_pkt_counter[channel])
101
+
102
+ timeline_entries.append({'timestamp_ms': time_stamp, 'channel': channel})
103
+ channel_pkt_counter[channel] += 1
104
+
105
+ if not timeline_entries or not channel_pkt_counter:
106
+ utPrint("No packets were received; skipping timeline graph", "RED")
107
+ test.rc = TEST_FAILED
108
+ test.reason = "No packets were received in all channels"
109
+ return
110
+
111
+ # Create graph
112
+ timeline_df = pd.DataFrame(timeline_entries).sort_values('timestamp_ms')
113
+ timeline_df['relative_time_s'] = (timeline_df['timestamp_ms'] - start_timestamp_ms) / 1000
114
+ timeline_path = os.path.join(ARTIFACTS_DIR, test.dir, 'channel_scan_behavior.html')
115
+ color_map = {37: "#1f77b4", 38: "#ff7f0e", 39: "#2ca02c"}
116
+ timeline_fig = px.scatter(timeline_df, x='relative_time_s', y='channel', color='channel', color_discrete_map=color_map,
117
+ title='Channel scanning timeline',
118
+ labels={'relative_time_s': 'Time (s)', 'channel': 'Scanning Channel'})
119
+ timeline_fig.update_layout(height=350, yaxis=dict(tickmode='array', tickvals=CHANNELS, ticktext=[str(ch) for ch in CHANNELS],
120
+ range=[min(CHANNELS) - 0.5, max(CHANNELS) + 0.5]))
121
+ timeline_fig.update_coloraxes(showscale=False)
122
+
123
+ # Build contiguous channel windows and compute averages
124
+ windows = compute_channels_windows(timeline_df[['timestamp_ms', 'channel']])
125
+ avg_start_to_start_ms = compute_listening_stats(windows)
126
+ positive_start_gaps = [v for v in avg_start_to_start_ms.values() if v > 0]
127
+ avg_cycle_from_starts_ms = sum(positive_start_gaps) / len(positive_start_gaps) if positive_start_gaps else None
128
+
129
+ # Build per-channel cards for the HTML summary
130
+ for ch in CHANNELS:
131
+ pct_recievied_vs_sent = channel_pkt_counter[ch] * 100 / num_of_sent_pkts
132
+ cycle_ms = int(avg_start_to_start_ms[ch]) if int(avg_start_to_start_ms[ch]) != 0 else None
133
+ duration_ms = int(pct_recievied_vs_sent * cycle_ms / 100) if cycle_ms else None
134
+ # pct_recievied_vs_sent: packets on this channel / sent; cycle_ms: avg start-to-start; duration_ms: pct_recievied_vs_sent * cycle
135
+ channel_cards.append({"title": f"Channel {ch}",
136
+ "pct_recievied_vs_sent": round(pct_recievied_vs_sent, 4),
137
+ "cycle_ms": cycle_ms,
138
+ "duration_ms": duration_ms})
139
+
140
+ # Not‑scanning stats are the residual to 100% after the three channels
141
+ # Interpolation smooths dropouts so this reflects actual not-scannning time
142
+ observed_pct_recievied_vs_sent = sum(card["pct_recievied_vs_sent"] for card in channel_cards)
143
+ channel_cards.append({"title": "Not scanning",
144
+ "pct_recievied_vs_sent": max(0, round(100 - observed_pct_recievied_vs_sent, 2)),
145
+ "cycle_ms": int(avg_cycle_from_starts_ms) if avg_cycle_from_starts_ms else None,
146
+ "duration_ms": int((max(0, round(100 - observed_pct_recievied_vs_sent, 2)) *
147
+ (int(avg_cycle_from_starts_ms) if avg_cycle_from_starts_ms else 0)) / 100)
148
+ if avg_cycle_from_starts_ms else None})
149
+
150
+ # Embed summary text into the HTML alongside the plot
151
+ cards_html = "".join([
152
+ (
153
+ "<div style='flex:1; min-width:200px; border:1px solid #ddd; border-radius:8px; padding:12px; background:#fafafa;'>"
154
+ f"<div style='font-weight:700; margin-bottom:8px;'>{card['title']}</div>"
155
+ f"<div>% scanning: {card['pct_recievied_vs_sent']}% </div>"
156
+ f"<div>Scan cycle: {card['cycle_ms']} ms </div>"
157
+ f"<div>Scan duration: {card['duration_ms']} ms </div>"
158
+ "</div>"
159
+ )
160
+ for card in channel_cards
161
+ ])
162
+ summary_html = (
163
+ "<div style=\"font-family: Arial, sans-serif; font-size:16px; line-height:1.5; margin-bottom:16px;\">"
164
+ f"<h3 style=\"margin:0 0 8px 0;\">Scan Summary</h3>"
165
+ f"<div style='display:flex; gap:12px; margin-top:12px; flex-wrap:wrap;'>{cards_html}</div>"
166
+ "</div>"
167
+ )
168
+ full_html = f"<html><head></head><body>{summary_html}{timeline_fig.to_html(full_html=False, include_plotlyjs='cdn')}</body></html>"
169
+ with open(timeline_path, "w") as f:
170
+ f.write(full_html)
171
+
172
+
173
+ def run(test):
174
+ test = cert_common.test_prolog(test)
175
+ if test.rc == TEST_FAILED:
176
+ return cert_common.test_epilog(test)
177
+
178
+ # Setup
179
+ phase_run_print("Running scan channel behavior")
180
+ all_messages_in_test = []
181
+ all_data_pkts = []
182
+ all_data_pkts_from_tester = []
183
+
184
+ # Prepairation for advertisment
185
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER) # Move BLE to sim mode
186
+ delay = math.floor(1000 / PPS)
187
+ upload_wait_time = test.dut.upload_wait_time + DEFAULT_WAIT_TIME
188
+ payload = cert_common.generate_adv_payload(SCAN_TEST_INDICATOR, unique_pkt=True)
189
+
190
+ # Transmitting packets on all channels
191
+ utPrint(f"Transmitting in parallel on all 3 main cahnnels for {ADV_DURATION} seconds", "WARNING")
192
+ num_of_sent_pkts = ADV_DURATION * PPS
193
+ strat_trans_time_ms = time.time() * 1000
194
+
195
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM} '
196
+ f'{payload} {SCAN_DUPLICATES} {OUTPUT_POWER_2_4_MAX} '
197
+ f'{BLE_SIM_ADV_37_38_39} {delay} {BLE_SIM_RADIO_1MBPS} {num_of_sent_pkts} {BLE_SIM_SINGLE_UNIQUE_PKT}',
198
+ TESTER)
199
+ mqtt_scan_wait(test, ADV_DURATION + upload_wait_time)
200
+
201
+ all_data_pkts_from_tester.extend(cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(DUT), indicator=SCAN_TEST_INDICATOR))
202
+ all_data_pkts.extend(cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(DUT)))
203
+ all_messages_in_test.extend(test.get_mqttc_by_target(DUT)._userdata[PKTS].data)
204
+
205
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
206
+ time.sleep(1) # To allow all packets to show in the log
207
+
208
+ cert_mqtt.generate_log_file(test, 'channel_scan', target=DUT)
209
+ cert_mqtt.generate_log_file(test, 'channel_scan_tester', target=TESTER)
210
+
211
+ analyze_listening_timeline(test, all_data_pkts_from_tester, num_of_sent_pkts, strat_trans_time_ms)
212
+
213
+ test = cert_common.wiliot_pkts_validation(test, all_messages_in_test, all_data_pkts)
214
+
215
+ return cert_common.test_epilog(test)
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "Gateway Connection",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Verify that the device uploads its status message to the MQTT status topic upon connecting to the MQTT, after manual disconnect",
5
+ "documentation": ["https://community.wiliot.com/customers/s/article/Sending-Wiliot-Packets-to-the-Wiliot-Cloud"],
6
+ "initialCondition": "Device is connected to MQTT and ready at hand to be manually turned off",
7
+ "procedure": ["Test prolog",
8
+ "Disconnect sequence - Device gets powered off and then on according to the instructions",
9
+ "Wait for device to connect to MQTT by verifying a status message or fail when timeout occurs",
10
+ "Test epilog"],
11
+ "expectedOutcome": "Device reconnects and publishes its configuration to the MQTT status topic before timeout",
12
+ "mandatory": 1,
13
+ "multiBridgeTest": 0,
14
+ "gwOnlyTest": 1,
15
+ "allSupportedValues": []
16
+
17
+ }