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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
  2. {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
  3. certificate/cert_common.py +1488 -0
  4. certificate/cert_config.py +480 -0
  5. {brg_certificate → certificate}/cert_data_sim.py +134 -46
  6. {brg_certificate → certificate}/cert_defines.py +129 -128
  7. {brg_certificate → certificate}/cert_gw_sim.py +183 -53
  8. {brg_certificate → certificate}/cert_mqtt.py +179 -64
  9. {brg_certificate → certificate}/cert_prints.py +35 -33
  10. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  11. {brg_certificate → certificate}/cert_results.py +240 -64
  12. certificate/cert_utils.py +634 -0
  13. certificate/certificate.py +205 -0
  14. certificate/certificate_cli.py +76 -0
  15. certificate/certificate_eth_test_list.txt +76 -0
  16. certificate/certificate_sanity_test_list.txt +66 -0
  17. certificate/certificate_test_list.txt +76 -0
  18. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +3 -2
  19. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  20. certificate/tests/calibration/output_power_test/output_power_test.json +23 -0
  21. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  22. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +2 -1
  23. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  24. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +15 -0
  25. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  26. certificate/tests/cloud_connectivity/acl_test/acl_test.json +15 -0
  27. certificate/tests/cloud_connectivity/acl_test/acl_test.py +96 -0
  28. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +19 -0
  29. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +41 -0
  30. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +19 -0
  31. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  32. certificate/tests/cloud_connectivity/connection_test/connection_test.json +18 -0
  33. certificate/tests/cloud_connectivity/connection_test/connection_test.py +67 -0
  34. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +15 -0
  35. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +80 -0
  36. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +21 -0
  37. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +201 -0
  38. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +17 -0
  39. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +104 -0
  40. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +18 -0
  41. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +59 -0
  42. certificate/tests/cloud_connectivity/registration_test/registration_test.json +20 -0
  43. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  44. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  45. certificate/tests/cloud_connectivity/stress_test/stress_test.json +17 -0
  46. certificate/tests/cloud_connectivity/stress_test/stress_test.py +101 -0
  47. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +25 -0
  48. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +92 -0
  49. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +20 -0
  50. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +169 -0
  51. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +2 -1
  52. certificate/tests/datapath/aging_test/aging_test.py +142 -0
  53. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +17 -0
  54. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +89 -0
  55. certificate/tests/datapath/event_test/event_test.json +17 -0
  56. certificate/tests/datapath/event_test/event_test.py +80 -0
  57. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +4 -3
  58. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +19 -13
  59. certificate/tests/datapath/output_power_test/output_power_test.json +23 -0
  60. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  61. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +2 -1
  62. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -11
  63. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -1
  64. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  65. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +3 -2
  66. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  67. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +20 -0
  68. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  69. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +2 -1
  70. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +15 -14
  71. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +19 -0
  72. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +85 -0
  73. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -1
  74. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  75. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -1
  76. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  77. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -2
  78. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  79. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +6 -4
  80. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  81. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +3 -2
  82. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  83. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +8 -7
  84. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +113 -73
  85. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +8 -7
  86. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  87. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +4 -3
  88. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +15 -11
  89. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +4 -3
  90. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +15 -11
  91. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +3 -1
  92. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  93. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +15 -0
  94. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  95. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +15 -0
  96. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  97. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +15 -0
  98. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  99. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +15 -0
  100. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  101. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +16 -0
  102. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  103. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +15 -0
  104. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  105. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +15 -0
  106. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  107. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +15 -0
  108. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +45 -0
  109. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +3 -2
  110. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  111. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +2 -1
  112. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  113. certificate/tests/energy2400/output_power_test/output_power_test.json +23 -0
  114. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  115. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +2 -1
  116. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  117. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +26 -0
  118. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +379 -0
  119. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +20 -0
  120. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +173 -0
  121. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +24 -0
  122. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  123. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -1
  124. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  125. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +2 -1
  126. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  127. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +2 -1
  128. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  129. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +5 -4
  130. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +450 -0
  131. certificate/wlt_types.py +122 -0
  132. {gw_certificate → common}/api_if/202/status.json +6 -0
  133. {gw_certificate → common}/api_if/203/status.json +6 -0
  134. {gw_certificate → common}/api_if/204/status.json +6 -0
  135. common/api_if/206/data.json +85 -0
  136. common/api_if/206/status.json +69 -0
  137. common/api_if/api_validation.py +91 -0
  138. common/web/templates/generator.html +210 -0
  139. common/web/templates/index.html +20 -0
  140. common/web/templates/menu.html +54 -0
  141. common/web/templates/parser.html +53 -0
  142. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  143. common/web/web_utils.py +399 -0
  144. {brg_certificate → common}/wltPb_pb2.py +14 -12
  145. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  146. gui_certificate/gui_certificate_cli.py +14 -0
  147. gui_certificate/server.py +1267 -0
  148. gui_certificate/templates/cert_run.html +1273 -0
  149. wiliot_certificate-4.5.0.dist-info/METADATA +99 -0
  150. wiliot_certificate-4.5.0.dist-info/RECORD +168 -0
  151. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/WHEEL +1 -1
  152. wiliot_certificate-4.5.0.dist-info/entry_points.txt +5 -0
  153. wiliot_certificate-4.5.0.dist-info/top_level.txt +3 -0
  154. brg_certificate/ag/energous_v0_defines.py +0 -925
  155. brg_certificate/ag/energous_v1_defines.py +0 -931
  156. brg_certificate/ag/energous_v2_defines.py +0 -925
  157. brg_certificate/ag/energous_v3_defines.py +0 -925
  158. brg_certificate/ag/energous_v4_defines.py +0 -925
  159. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  160. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  161. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  162. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  163. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -142
  164. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -785
  165. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -139
  166. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -394
  167. brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -515
  168. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +0 -672
  169. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -550
  170. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -595
  171. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -598
  172. brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -938
  173. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1234
  174. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
  175. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
  176. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  177. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -110
  178. brg_certificate/brg_certificate.py +0 -225
  179. brg_certificate/brg_certificate_cli.py +0 -63
  180. brg_certificate/cert_common.py +0 -923
  181. brg_certificate/cert_config.py +0 -402
  182. brg_certificate/cert_utils.py +0 -362
  183. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  184. brg_certificate/certificate_bcc_test_list.txt +0 -48
  185. brg_certificate/certificate_sanity_test_list.txt +0 -43
  186. brg_certificate/certificate_test_list.txt +0 -53
  187. brg_certificate/config/eclipse.json +0 -10
  188. brg_certificate/config/hivemq.json +0 -10
  189. brg_certificate/config/mosquitto.json +0 -10
  190. brg_certificate/config/mosquitto.md +0 -95
  191. brg_certificate/config/wiliot-dev.json +0 -10
  192. brg_certificate/restore_brg.py +0 -61
  193. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  194. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  195. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  196. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  197. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  198. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  199. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  200. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  201. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  204. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  205. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  206. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  208. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  209. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  210. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  211. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  213. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +0 -321
  215. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  216. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  217. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  218. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  219. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  220. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  221. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  222. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  223. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  224. brg_certificate/wltPb_pb2.pyi +0 -234
  225. brg_certificate/wlt_types.py +0 -113
  226. gw_certificate/ag/ut_defines.py +0 -364
  227. gw_certificate/ag/wlt_types.py +0 -85
  228. gw_certificate/ag/wlt_types_ag.py +0 -5310
  229. gw_certificate/ag/wlt_types_data.py +0 -64
  230. gw_certificate/api/extended_api.py +0 -23
  231. gw_certificate/api_if/200/data.json +0 -106
  232. gw_certificate/api_if/200/status.json +0 -47
  233. gw_certificate/api_if/201/data.json +0 -98
  234. gw_certificate/api_if/201/status.json +0 -53
  235. gw_certificate/api_if/205/logs.json +0 -12
  236. gw_certificate/api_if/api_validation.py +0 -38
  237. gw_certificate/api_if/gw_capabilities.py +0 -54
  238. gw_certificate/cert_results.py +0 -145
  239. gw_certificate/common/analysis_data_bricks.py +0 -60
  240. gw_certificate/common/debug.py +0 -42
  241. gw_certificate/common/serialization_formatter.py +0 -93
  242. gw_certificate/common/utils.py +0 -8
  243. gw_certificate/common/utils_defines.py +0 -15
  244. gw_certificate/common/wltPb_pb2.py +0 -84
  245. gw_certificate/gw_certificate.py +0 -154
  246. gw_certificate/gw_certificate_cli.py +0 -87
  247. gw_certificate/interface/4.4.93_app.zip +0 -0
  248. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  249. gw_certificate/interface/ble_simulator.py +0 -61
  250. gw_certificate/interface/ble_sniffer.py +0 -189
  251. gw_certificate/interface/flash_fw.py +0 -90
  252. gw_certificate/interface/if_defines.py +0 -36
  253. gw_certificate/interface/mqtt.py +0 -563
  254. gw_certificate/interface/nrfutil-linux +0 -0
  255. gw_certificate/interface/nrfutil-mac +0 -0
  256. gw_certificate/interface/nrfutil.exe +0 -0
  257. gw_certificate/interface/pkt_generator.py +0 -594
  258. gw_certificate/interface/uart_if.py +0 -236
  259. gw_certificate/interface/uart_ports.py +0 -20
  260. gw_certificate/templates/results.html +0 -241
  261. gw_certificate/templates/stage.html +0 -22
  262. gw_certificate/templates/table.html +0 -6
  263. gw_certificate/templates/test.html +0 -38
  264. gw_certificate/tests/__init__.py +0 -10
  265. gw_certificate/tests/actions.py +0 -289
  266. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  267. gw_certificate/tests/connection.py +0 -188
  268. gw_certificate/tests/downlink.py +0 -172
  269. gw_certificate/tests/generic.py +0 -238
  270. gw_certificate/tests/registration.py +0 -340
  271. gw_certificate/tests/static/__init__.py +0 -0
  272. gw_certificate/tests/static/connection_defines.py +0 -9
  273. gw_certificate/tests/static/downlink_defines.py +0 -9
  274. gw_certificate/tests/static/generated_packet_table.py +0 -195
  275. gw_certificate/tests/static/packet_table.csv +0 -10067
  276. gw_certificate/tests/static/references.py +0 -5
  277. gw_certificate/tests/static/uplink_defines.py +0 -14
  278. gw_certificate/tests/throughput.py +0 -240
  279. gw_certificate/tests/uplink.py +0 -853
  280. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  281. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  282. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  283. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  284. {brg_certificate → certificate}/__init__.py +0 -0
  285. {gw_certificate → common}/api_if/202/data.json +0 -0
  286. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/203/data.json +0 -0
  288. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/204/data.json +0 -0
  290. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/data.json +0 -0
  292. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  293. {gw_certificate → common}/api_if/205/status.json +0 -0
  294. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  295. {gw_certificate → common/api_if}/__init__.py +0 -0
  296. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  297. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,67 @@
1
+ import datetime
2
+
3
+ from certificate import cert_config
4
+ from certificate.cert_prints import *
5
+ from certificate.cert_defines import *
6
+ from certificate.wlt_types import *
7
+ import certificate.cert_common as cert_common
8
+ import certificate.cert_mqtt as cert_mqtt
9
+ from common.api_if.api_validation import api_validation
10
+
11
+ # DEFINES
12
+ TIMEOUT_IN_MINUTES = 3
13
+
14
+
15
+ def run(test):
16
+ test = cert_common.test_prolog(test)
17
+ if test.rc == TEST_FAILED:
18
+ return cert_common.test_epilog(test)
19
+
20
+ # Stage setup
21
+ phase_run_print("Connection test started")
22
+ dut_mqttc = test.get_mqttc_by_target(DUT)
23
+
24
+ # Initiate action
25
+ if not cert_common.pipeline_running():
26
+ warning_prefix = COLORS["WARNING"]
27
+ warning_suffix = COLORS["ENDC"]
28
+ dut_mqttc.flush_pkts()
29
+ input((f'{warning_prefix}TESTING CONNECTION RECOVERY AFTER POWER CYCLE OF THE GATEWAY\n'
30
+ "Please unplug and then plug GW back into power. Press enter when finished"
31
+ f"{warning_suffix}"))
32
+ else:
33
+ # If this test runs as part of a pipeline, act like the reboot test and don't demand a manual disconnect & connect
34
+ utPrint(f"Publishing reboot action to {dut_mqttc.update_topic}. Awaiting reconnect.. (timeout is {TIMEOUT_IN_MINUTES} minutes)")
35
+ dut_mqttc.flush_pkts()
36
+ cert_config.gw_action(test, f"{REBOOT_GW_ACTION}", target=DUT)
37
+
38
+ # Wait for response
39
+ gw_type = None
40
+ utPrint(f'Waiting for GW to connect... (Timeout {TIMEOUT_IN_MINUTES} minutes)')
41
+ timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
42
+ while datetime.datetime.now() < timeout:
43
+ gw_type, msg = cert_common.get_gw_type(dut_mqttc)
44
+ gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
45
+ if gw_type is not None:
46
+ break
47
+ print_update_wait(5)
48
+ test.dut.gw_api_version = gw_api_version
49
+
50
+ # generate logs
51
+ cert_mqtt.generate_log_file(test, "connection")
52
+
53
+ # Analyze results
54
+ if gw_type is None:
55
+ test.rc = TEST_FAILED
56
+ test.reason = "The gateway did not reboot properly, status message was not received"
57
+ elif gw_type == "other":
58
+ test.rc = TEST_FAILED
59
+ test.reason = f"gatewayType must be defined in the status message {msg}"
60
+ else:
61
+ utPrint("Gateway rebooted and uploaded a configuration message as expected.", "GREEN")
62
+ utPrint(f"The configuration message received:\n {msg}")
63
+
64
+ utPrint("Checking the status message matches API format...")
65
+ test = api_validation(test)
66
+
67
+ return cert_common.test_epilog(test)
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "Gateway Deduplication",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Test gateway's packet deduplication capability when receiving identical BLE packets",
5
+ "documentation": "",
6
+ "initialCondition": "Gateway configured to defaults",
7
+ "procedure": ["Test prolog", "Send mixed packet types (pixels, mgmt, sensor, side_info_sensor) via data simulator", "Collect received packets from MQTT", "Analyze duplicate packets and calculate duplicate percentage", "Test epilog"],
8
+ "expectedOutcome": "Duplicate percentage should be <= 5% of total received packets",
9
+ "mandatory": 0,
10
+ "multiBridgeTest": 0,
11
+ "gwOnlyTest": 1,
12
+ "dataSimOnlyTest": 1,
13
+ "SupportedFromApiVersion": 203,
14
+ "allSupportedValues": []
15
+ }
@@ -0,0 +1,80 @@
1
+ # This test meant to show the GW performance when is put in a pkt stress generated from the BLE via the UART
2
+ from certificate.cert_prints import *
3
+ from certificate.cert_defines import *
4
+ from certificate.wlt_types import *
5
+ import certificate.cert_common as cert_common
6
+ import certificate.cert_mqtt as cert_mqtt
7
+ import certificate.cert_data_sim as cert_data_sim
8
+ import pandas as pd
9
+
10
+
11
+ # DEFINES
12
+ UPLINK_TEST_INDICATOR = get_random_hex_str(6)
13
+ NUM_OF_BRGS = 3
14
+
15
+
16
+ # HELPER FUNCTIONS
17
+ def duplication_analysis(test, sent_pkts, received_pkts):
18
+ if len(received_pkts) == 0:
19
+ test.rc = TEST_FAILED
20
+ test.reason = "No packets were received!"
21
+ return test
22
+
23
+ _sent_pkts = [p.get_pkt()[12:] for p in sent_pkts]
24
+ sent_df = pd.DataFrame(_sent_pkts, columns=[PACKETS])
25
+ received_pkts = [p[PAYLOAD] for p in received_pkts]
26
+ received_df = pd.DataFrame(received_pkts, columns=[PACKETS])
27
+
28
+ merged_df = pd.merge(sent_df, received_df, on=PACKETS, how='inner')
29
+ # Count total received packets (including duplicates) and unique packets
30
+ pkts_received_total = len(merged_df)
31
+ merged_df_unique = merged_df.drop_duplicates(subset=[PACKETS])
32
+ pkts_duplicates = pkts_received_total - len(merged_df_unique)
33
+
34
+ # Prints
35
+ print(f'Number of packets sent: {len(sent_df)}')
36
+ print(f'Number of packets received in total: {pkts_received_total}, out of them {pkts_duplicates} are duplicates')
37
+
38
+ duplicate_percentage = (pkts_duplicates / pkts_received_total) * 100
39
+ print(f'{duplicate_percentage:.2f}% of the received packets are duplicates')
40
+
41
+ if duplicate_percentage > 5.0:
42
+ test.rc = TEST_FAILED
43
+ test.reason = f"{duplicate_percentage:.2f}% of the received packets are duplicates"
44
+ return test
45
+
46
+ return test
47
+
48
+
49
+ def run(test):
50
+ test = cert_common.test_prolog(test)
51
+ if test.rc == TEST_FAILED:
52
+ return cert_common.test_epilog(test)
53
+
54
+ dut_mqttc = test.get_mqttc_by_target(DUT)
55
+ dut_mqttc.flush_pkts()
56
+ pkts = []
57
+
58
+ # generate pkts and send them using data simulator
59
+ data_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS,
60
+ pkt_type=PIXELS_PKT, indicator=UPLINK_TEST_INDICATOR)
61
+
62
+ mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS,
63
+ pkt_type=MGMT_PKT, indicator=UPLINK_TEST_INDICATOR)
64
+ sensor_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS,
65
+ pkt_type=SENSOR_PKT, indicator=UPLINK_TEST_INDICATOR)
66
+ si_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS,
67
+ pkt_type=SIDE_INFO_SENSOR_PKT, indicator=UPLINK_TEST_INDICATOR)
68
+ pkts = data_pkts + mgmt_pkts + sensor_pkts + si_pkts
69
+
70
+ pixel_sim_thread = cert_data_sim.GenericSimThread(test=test, pkts=pkts, send_single_cycle=True)
71
+ pixel_sim_thread.start()
72
+
73
+ mqtt_scan_wait(test, 12 + test.dut.upload_wait_time)
74
+ cert_mqtt.dump_pkts(test, log="deduplication_test")
75
+ recieved_pkts = cert_mqtt.get_all_data_pkts(dut_mqttc, indicator=UPLINK_TEST_INDICATOR)
76
+ pixel_sim_thread.stop()
77
+
78
+ test = duplication_analysis(test, pkts, recieved_pkts)
79
+
80
+ return cert_common.test_epilog(test)
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "Gateway Downlink",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Validate device advertises requested txPackets uniformly across primary channels",
5
+ "documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Gateway-Actions"],
6
+ "initialCondition": "Device is online, connected to MQTT and supports downlink",
7
+ "procedure": [
8
+ "Test prolog",
9
+ "Correlation - Trigger downlink packet; validate advertised packets increase in time and count per txMaxDuration",
10
+ "Uniformity - Confirm equal distribution across the 3 primary channels",
11
+ "Test epilog"
12
+ ],
13
+ "expectedOutcome": "Equal advertising across 3 primary channels with constant intervals over the specified txMaxDuration",
14
+ "mandatory": 1,
15
+ "multiBridgeTest": 0,
16
+ "gwOnlyTest": 1,
17
+ "dataSimOnlyTest": 0,
18
+ "SupportedFromApiVersion": 203,
19
+ "allSupportedValues": []
20
+
21
+ }
@@ -0,0 +1,201 @@
1
+ import time
2
+ import pandas as pd
3
+ import plotly.express as px
4
+
5
+ from certificate.cert_prints import *
6
+ from certificate.cert_defines import *
7
+ from certificate.wlt_types import *
8
+ import certificate.cert_common as cert_common
9
+ import certificate.cert_config as cert_config
10
+ import certificate.cert_mqtt as cert_mqtt
11
+ from certificate.cert_gw_sim import DEDUPLICATION_PKTS
12
+
13
+
14
+ # DEFINES
15
+ RAW_TX_DATA = "1E16C6FC123456789123456789123456789123456789123456789100000000"
16
+ STAGE_DURATIONS = [100, 1000, 16000]
17
+ DOWNLINK_PUBLISH_COUNT = range(3)
18
+ CHANNELS = [(37, ag.RX_CHANNEL_37), (38, ag.RX_CHANNEL_38), (39, ag.RX_CHANNEL_39)]
19
+
20
+ # HELPER FUNCTIONS
21
+
22
+
23
+ def create_unique_raw_packet(base_raw_packet: str, duration: int, retry: int, channel: int) -> str:
24
+ """
25
+ Modifies the base_raw_packet string by replacing its tail with a padded duration (5 digits) and retry digit.
26
+ Examples:
27
+ create_unique_raw_packet(RAW_TX_DATA, 700, 2, 37) -> '...0000000000000000000000000 00700237'
28
+ create_unique_raw_packet(RAW_TX_DATA, 1500, 1, 38) -> '...0000000000000000000000000 01500138'
29
+ create_unique_raw_packet(RAW_TX_DATA, 16000, 9, 39) -> '...0000000000000000000000000 16000939'
30
+ """
31
+ return f"{base_raw_packet[:-8]}{duration:05d}{retry:01d}{channel:02d}"
32
+
33
+
34
+ def send_tested_payloads(test, rx_channel, tx_max_durations, downlink_publish_count, sniffed_pkts):
35
+ for duration in tx_max_durations:
36
+ for count_num in downlink_publish_count:
37
+ retries = duration // 20
38
+ raw_tx_data = create_unique_raw_packet(RAW_TX_DATA, duration, count_num, rx_channel)
39
+ dut_mqttc = test.get_mqttc_by_target(DUT)
40
+ utPrint(
41
+ f'Publishing to topic: {dut_mqttc.update_topic} packets with Duration of: {duration} for channel {rx_channel}',
42
+ "BLUE"
43
+ )
44
+ cert_config.gw_downlink(test, raw_tx_data=raw_tx_data, max_duration=duration, max_retries=retries)
45
+ sniffed_pkts[rx_channel][raw_tx_data] = {
46
+ 'tx_max_duration': duration,
47
+ 'tx_max_retries': retries,
48
+ 'retry': count_num,
49
+ 'num_pkts_received': 0
50
+ }
51
+ scan_duration = max(0.5, (duration / 1000) * 1.2)
52
+ mqtt_scan_wait(test, duration=scan_duration, target=TESTER)
53
+
54
+
55
+ def process_sniffed_packets(test, channel, sniffed_pkts):
56
+ data_pkts = cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(TESTER))
57
+ for pkt in data_pkts:
58
+ for sent_pkt in sniffed_pkts[channel]:
59
+ if sent_pkt in pkt[PAYLOAD]:
60
+ sniffed_pkts[channel][sent_pkt]['num_pkts_received'] += 1
61
+
62
+
63
+ def calc_for_stage_downlink(rsquared, slope):
64
+ error_msg = ''
65
+ if slope == 0: # Meaning no packets received
66
+ error_msg = (
67
+ "Actions were sent to the GW to advertise packets, but no packets "
68
+ "were received by the tester"
69
+ )
70
+ return "failed", error_msg
71
+ elif rsquared > 0.6 and slope > 0:
72
+ return "passed", error_msg
73
+ else:
74
+ error_msg = (
75
+ "The correlation between increasing advertising duration and the "
76
+ "number of packets received by the tester is weak"
77
+ )
78
+ return "failed", error_msg
79
+
80
+
81
+ def report_and_results(test, sniffed_pkts):
82
+ utPrint('-' * 50)
83
+ for channel, pkt_map in sniffed_pkts.items():
84
+ if not pkt_map:
85
+ continue
86
+ received_width = max(len(str(meta.get('num_pkts_received', 0))) for meta in pkt_map.values())
87
+ sent_width = max(len(str(meta.get('tx_max_retries', 0))) for meta in pkt_map.values())
88
+ duration_width = max(len(str(meta.get('tx_max_duration', ''))) for meta in pkt_map.values())
89
+ retry_width = max(len(str(meta.get('retry', ''))) for meta in pkt_map.values())
90
+ for _, meta in pkt_map.items():
91
+ received_raw = meta.get('num_pkts_received', 0)
92
+ # Guard against fractional artifacts; display only whole packets
93
+ received = int(received_raw)
94
+ sent = int(meta.get('tx_max_retries', 0))
95
+ percentage = (received / sent * 100) if sent else 0.0
96
+ duration = meta.get('tx_max_duration', '')
97
+ retry = meta.get('retry', '')
98
+ print(
99
+ f"Number of pkts received on channel {channel} for duration {duration:>{duration_width}} "
100
+ f"and retry {retry:>{retry_width}} got {received:>{received_width}} packets | "
101
+ f"Sent: {sent:>{sent_width}} [{percentage:6.2f}%]"
102
+ )
103
+ utPrint('-' * 50)
104
+ # Flatten nested dict into list of row dicts
105
+ rows = []
106
+ for channel, pkt_map in sniffed_pkts.items():
107
+ for raw_payload, meta in pkt_map.items():
108
+ row = {'channel': str(channel),
109
+ 'raw_tx_data': raw_payload,
110
+ 'tx_max_duration': meta.get('tx_max_duration'),
111
+ 'tx_max_retries': meta.get('tx_max_retries'),
112
+ 'retry': meta.get('retry'),
113
+ 'num_pkts_received': meta.get('num_pkts_received')
114
+ }
115
+ rows.append(row)
116
+ df_received_pkts = pd.DataFrame(rows)
117
+
118
+ if df_received_pkts.empty:
119
+ utPrint('No packets collected; skipping graph generation.', 'WARNING')
120
+ test.rc = TEST_FAILED
121
+ test.reason = 'No packets collected.'
122
+ return
123
+
124
+ x_value = ('tx_max_duration', 'TX Max Duration')
125
+
126
+ # Create scatter with OLS trendline per channel
127
+ fig = px.scatter(
128
+ df_received_pkts,
129
+ x=x_value[0], y='num_pkts_received', color='channel', title=f'Packets Received by Sniffer / {x_value[1]}', trendline='ols',
130
+ labels={x_value[0]: x_value[1], 'num_pkts_received': 'Number of packets received', 'channel': 'BLE Adv. Channel'}
131
+ )
132
+ fig.update_layout(scattermode='group', scattergap=0.95)
133
+
134
+ # Extract regression results
135
+ trendline_info = px.get_trendline_results(fig)
136
+
137
+ # Calculate whether stage pass/failed
138
+ for channel, channel_df in trendline_info.groupby('BLE Adv. Channel'):
139
+ channel_pkts = df_received_pkts[df_received_pkts['channel'] == channel]
140
+ channel_trendline = channel_df['px_fit_results'].iloc[0]
141
+ slope = channel_trendline.params[1]
142
+ rsquared = channel_trendline.rsquared
143
+ total_received = int(channel_pkts['num_pkts_received'].sum())
144
+ channel_rc, channel_err_summary = calc_for_stage_downlink(rsquared, slope)
145
+
146
+ utPrint(f'Channel {channel}: {channel_rc}')
147
+ utPrint(f'- Total {len(channel_pkts)} MQTT payloads sent')
148
+ utPrint(f'- Total {total_received} BLE packets received by sniffer (including duplicates)')
149
+ utPrint(f'- R Value: {rsquared} | Slope: {slope}')
150
+
151
+ if channel_rc == 'failed':
152
+ test.rc = TEST_FAILED
153
+ test.reason = channel_err_summary
154
+
155
+ # Export graph
156
+ html_file_path = os.path.join(ARTIFACTS_DIR, test.dir, 'downlink_graph.html')
157
+ fig.write_html(html_file_path)
158
+ utPrint('-' * 50)
159
+
160
+
161
+ def run(test):
162
+ test = cert_common.test_prolog(test)
163
+ if test.rc == TEST_FAILED:
164
+ return cert_common.test_epilog(test)
165
+
166
+ # Stage setup
167
+ utPrint("Setting TESTER GW to allow duplicate packets", "GREEN")
168
+ cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 0", target=TESTER)
169
+
170
+ # Clean
171
+ sniffed_pkts = {}
172
+
173
+ for channel, channel_idx in CHANNELS:
174
+ # Setup
175
+ test.flush_all_mqtt_packets()
176
+ sniffed_pkts[channel] = {}
177
+
178
+ # Configuring
179
+ utPrint(f'Configuring TESTER to RX channel {channel}', "GREEN")
180
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL],
181
+ values=[channel_idx],
182
+ module=test.tester.internal_brg.datapath,
183
+ target=TESTER)[0]
184
+ time.sleep(2) # Wait for sniffer to start
185
+
186
+ # Send
187
+ send_tested_payloads(test, channel, STAGE_DURATIONS, DOWNLINK_PUBLISH_COUNT, sniffed_pkts)
188
+
189
+ # Receive packets
190
+ process_sniffed_packets(test, channel, sniffed_pkts)
191
+
192
+ # Channel switch setup
193
+ cert_mqtt.generate_log_file(test, f'{channel}', TESTER)
194
+
195
+ # Analyze and report
196
+ report_and_results(test, sniffed_pkts)
197
+ utPrint("Resetting TESTER GW to re-enable packet deduplication", "GREEN")
198
+ cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 1", target=TESTER)
199
+ test = cert_config.config_brg_defaults(test, modules=[test.tester.internal_brg.datapath], target=TESTER)[0]
200
+
201
+ return cert_common.test_epilog(test)
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "Gateway Uplink Extended Advertising Stress",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Test gateway's stress handling capabilities for different rates and durations when scanning in extended advertising",
5
+ "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network---Gateway-Extended-Advertising-Implementation",
6
+ "initialCondition": "Gateway configured to defaults, in a BLE-clean environment",
7
+ "procedure": ["Test prolog",
8
+ "For each pps value, advertise extended advertising packets at that rate, with pointers sent on each of the three BLE advertising channels, and compare the advertised vs uploaded rate",
9
+ "Test epilog"],
10
+ "expectedOutcome": "Find the maximum PPS supported by the gateway when scanning in extended advertising",
11
+ "mandatory": 0,
12
+ "multiBridgeTest": 0,
13
+ "gwOnlyTest": 1,
14
+ "dataSimOnlyTest": 1,
15
+ "SupportedFromApiVersion": 206,
16
+ "allSupportedValues": []
17
+ }
@@ -0,0 +1,104 @@
1
+
2
+ from certificate.cert_prints import *
3
+ from certificate.cert_defines import *
4
+ from certificate.wlt_types import *
5
+ from certificate.ag.wlt_types_ag import OUTPUT_POWER_2_4_MAX
6
+ import certificate.cert_common as cert_common
7
+ import certificate.cert_utils as cert_utils
8
+ import certificate.cert_mqtt as cert_mqtt
9
+ import certificate.cert_config as cert_config
10
+ import certificate.cert_gw_sim as cert_gw_sim
11
+ import math
12
+
13
+
14
+ # DEFINES
15
+ STRESS_TEST_INDICATOR = get_random_hex_str(6)
16
+
17
+ DUPLICATES = 1
18
+ ADVA_ASCII_LEN = 12
19
+
20
+ LOWEST_PPS = 20
21
+ ADV_DURATION_LOWEST_PPS = 70
22
+ ADV_DURATION_DEFAULT = 30
23
+
24
+
25
+ # HELPER FUNCTIONS
26
+
27
+ def generate_extended_adv_payloads_list(pkt, duplicates):
28
+ """
29
+ Should always stay synced to how cmd_ble_sim generate additional packets with unique_pkts_count
30
+ """
31
+ data_payload = pkt[12:]
32
+ ext_adv_payload = data_payload * 7
33
+ last_hex = pkt[-8:]
34
+ last_int = int.from_bytes(bytes.fromhex(last_hex), byteorder='little', signed=False)
35
+
36
+ pkts_list = []
37
+ for i in range(duplicates):
38
+ value = last_int + i
39
+ # Convert back to 4 bytes in little-endian and then to hex
40
+ new_hex = value.to_bytes(4, byteorder='little', signed=False).hex().upper()
41
+
42
+ pkts_list.append(pkt[:12] + ext_adv_payload[:-8] + new_hex)
43
+
44
+ return pkts_list
45
+
46
+
47
+ def run(test):
48
+ test = cert_common.test_prolog(test)
49
+ if test.rc == TEST_FAILED:
50
+ return cert_common.test_epilog(test)
51
+
52
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER)
53
+
54
+ ppses = [20, 40, 60, 80, 100, 120, 140, 160, 180, 200]
55
+ test_pkts_received = []
56
+ data_pkts_received = []
57
+ results = []
58
+ for pps in ppses:
59
+ phase_run_print(f"PPS = {pps}")
60
+ test.flush_all_mqtt_packets()
61
+ # adv_duration is increased only for lowest pps to increase packets sample for reliable results
62
+ adv_duration = ADV_DURATION_LOWEST_PPS if pps == LOWEST_PPS else ADV_DURATION_DEFAULT
63
+ delay = math.floor(1000 / pps) # This should be bigger than 2ms
64
+ upload_wait_time = test.dut.upload_wait_time + 15
65
+
66
+ # Generate pkts and get ready to advertise
67
+ payload = cert_common.generate_adv_payload(STRESS_TEST_INDICATOR)
68
+ generated_payloads = generate_extended_adv_payloads_list(payload, adv_duration * pps)
69
+
70
+ # We provide the tester with the first pkt only. It then advertises in a loop pkts identical
71
+ # to the ones we generated (by incrementing the last bytes).
72
+ gw_action_cmd = (f'{cert_gw_sim.BLE_SIM_EXT_ADV} {payload} {DUPLICATES} '
73
+ f'{OUTPUT_POWER_2_4_MAX} {delay} {adv_duration * pps}')
74
+ cert_config.gw_action(test, gw_action_cmd, TESTER)
75
+ mqtt_scan_wait(test, adv_duration + upload_wait_time)
76
+
77
+ cert_mqtt.dump_pkts(test, log=str(pps))
78
+ phase_pkts_received = cert_mqtt.get_all_aggregated_data_pkts(test.get_mqttc_by_target(DUT), indicator=STRESS_TEST_INDICATOR)
79
+ valid, reason = cert_common.validate_received_packets(phase_pkts_received)
80
+ test.add_phase(cert_utils.Phase(pps))
81
+ if valid is False:
82
+ test.set_phase_rc(str(pps), TEST_FAILED)
83
+ test.add_phase_reason(str(pps), reason)
84
+ utPrint(f"Phase {pps} failed validation: {reason}", "RED")
85
+ continue
86
+ phase_pkts_received = [p[AGGREGATED_PAYLOAD] for p in phase_pkts_received]
87
+ test, received_pps = cert_common.stress_analysis(test, pps, generated_payloads, phase_pkts_received)
88
+ results.extend([pps, received_pps])
89
+ cert_mqtt.generate_log_file(test, str(pps))
90
+
91
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
92
+ break # break the whole for loop and keep the test as failed
93
+ test.reset_result() # reset result and continue to next param
94
+ data_pkts_received.extend(cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(DUT)))
95
+ test_pkts_received.extend(test.get_mqttc_by_target(DUT)._userdata[PKTS].data)
96
+ cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
97
+
98
+ # Generate stress test graphs
99
+ if len(data_pkts_received) > 0:
100
+ cert_common.generate_graph_stress_test(test, results, data_pkts_received)
101
+ else:
102
+ utPrint("No data packets received - skipping graph generation", "RED")
103
+
104
+ return cert_common.test_epilog(test)
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "GW Reboot Action",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Verify the device reboots upon receiving reboot action",
5
+ "documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Gateway-Actions"],
6
+ "initialCondition": "Gateway online and connected to MQTT",
7
+ "procedure": ["Test prolog",
8
+ "Reboot action sent to tested GW",
9
+ "Wait for device to connect to MQTT by verifying a status message or fail when timeout occurs",
10
+ "Test epilog"],
11
+ "expectedOutcome": "Device reboot (disconnect from MQTT then reconnect and publish its configurations to the status topic) before timeout",
12
+ "mandatory": 0,
13
+ "multiBridgeTest": 0,
14
+ "gwOnlyTest": 1,
15
+ "SupportedFromApiVersion": 203,
16
+ "allSupportedValues": []
17
+
18
+ }
@@ -0,0 +1,59 @@
1
+ import datetime
2
+
3
+ from certificate.cert_prints import *
4
+ from certificate.cert_defines import *
5
+ from certificate.wlt_types import *
6
+ import certificate.cert_common as cert_common
7
+ import certificate.cert_config as cert_config
8
+ import certificate.cert_mqtt as cert_mqtt
9
+ from common.api_if.api_validation import api_validation
10
+
11
+
12
+ # DEFINES
13
+ TIMEOUT_IN_MINUTES = 3
14
+
15
+
16
+ def run(test):
17
+ test = cert_common.test_prolog(test)
18
+ if test.rc == TEST_FAILED:
19
+ return cert_common.test_epilog(test)
20
+
21
+ # Stage setup
22
+ phase_run_print("Reboot started")
23
+
24
+ # Initiate action
25
+ dut_mqttc = test.get_mqttc_by_target(DUT)
26
+ utPrint(f"Publishing reboot action to {dut_mqttc.update_topic}. Awaiting reboot.. (timeout is {TIMEOUT_IN_MINUTES} minutes)")
27
+ cert_config.gw_action(test, f"{REBOOT_GW_ACTION}", target=DUT)
28
+ dut_mqttc.flush_pkts()
29
+
30
+ # Wait for response
31
+ gw_type = None
32
+ utPrint(f'Waiting for GW to connect... (Timeout {TIMEOUT_IN_MINUTES} minutes)')
33
+ timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
34
+ while datetime.datetime.now() < timeout:
35
+ gw_type, msg = cert_common.get_gw_type(dut_mqttc)
36
+ gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
37
+ if gw_type is not None:
38
+ break
39
+ print_update_wait(5)
40
+ test.dut.gw_api_version = gw_api_version
41
+
42
+ # generate logs
43
+ cert_mqtt.generate_log_file(test, "reboot")
44
+
45
+ # Analyze results
46
+ if gw_type is None:
47
+ test.rc = TEST_FAILED
48
+ test.reason = "The gateway did not reboot properly, status message was not received"
49
+ elif gw_type == "other":
50
+ test.rc = TEST_FAILED
51
+ test.reason = f"gatewayType must be defined in the status message {msg}"
52
+ else:
53
+ utPrint("Gateway rebooted and uploaded a configuration message as expected.", "GREEN")
54
+ utPrint(f"The configuration message received:\n {msg}")
55
+
56
+ utPrint("Checking the status message matches API format...")
57
+ test = api_validation(test)
58
+
59
+ return cert_common.test_epilog(test)
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "Registration",
3
+ "module": "Cloud Connectivity",
4
+ "purpose": "Verify the device register, connect to MQTT, upload a status message & manage/refresh tokens correctly",
5
+ "documentation": "https://community.wiliot.com/customers/s/article/Registering-Third-Party-Gateways",
6
+ "initialCondition": "Gateway unregistered anywhere, attempts to connect to Wiliot's AWS MQTT broker. Testing PC has API key as environment variable",
7
+ "procedure": ["Test prolog",
8
+ "Registry - Pre-register the gw, then device-authorize & registry requests are expected",
9
+ "Online - Token acquisition and MQTT connection",
10
+ "Active - Status message upload",
11
+ "Refresh - Token refreshed by GW",
12
+ "Test epilog"],
13
+ "expectedOutcome": "Device goes through the Wiliot registration flow & token refresh",
14
+ "mandatory": 1,
15
+ "multiBridgeTest": 0,
16
+ "gwOnlyTest": 1,
17
+ "internalBridge": 0,
18
+ "SupportedFromApiVersion": 203,
19
+ "allSupportedValues": ["registry", "online", "refresh"]
20
+ }