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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. {brg_certificate → certificate}/ag/wlt_cmd_if.html +10 -4
  2. {brg_certificate → certificate}/ag/wlt_types_ag.py +1878 -519
  3. certificate/cert_common.py +1488 -0
  4. certificate/cert_config.py +480 -0
  5. {brg_certificate → certificate}/cert_data_sim.py +134 -46
  6. {brg_certificate → certificate}/cert_defines.py +129 -128
  7. {brg_certificate → certificate}/cert_gw_sim.py +183 -53
  8. {brg_certificate → certificate}/cert_mqtt.py +179 -64
  9. {brg_certificate → certificate}/cert_prints.py +35 -33
  10. {brg_certificate → certificate}/cert_protobuf.py +15 -6
  11. {brg_certificate → certificate}/cert_results.py +240 -64
  12. certificate/cert_utils.py +634 -0
  13. certificate/certificate.py +205 -0
  14. certificate/certificate_cli.py +76 -0
  15. certificate/certificate_eth_test_list.txt +76 -0
  16. certificate/certificate_sanity_test_list.txt +66 -0
  17. certificate/certificate_test_list.txt +76 -0
  18. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.json +3 -2
  19. {brg_certificate → certificate}/tests/calibration/interval_test/interval_test.py +7 -6
  20. certificate/tests/calibration/output_power_test/output_power_test.json +23 -0
  21. certificate/tests/calibration/output_power_test/output_power_test.py +39 -0
  22. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.json +2 -1
  23. {brg_certificate → certificate}/tests/calibration/pattern_test/pattern_test.py +20 -15
  24. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +15 -0
  25. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.py +140 -0
  26. certificate/tests/cloud_connectivity/acl_test/acl_test.json +15 -0
  27. certificate/tests/cloud_connectivity/acl_test/acl_test.py +96 -0
  28. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +19 -0
  29. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +41 -0
  30. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +19 -0
  31. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +215 -0
  32. certificate/tests/cloud_connectivity/connection_test/connection_test.json +18 -0
  33. certificate/tests/cloud_connectivity/connection_test/connection_test.py +67 -0
  34. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +15 -0
  35. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +80 -0
  36. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +21 -0
  37. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +201 -0
  38. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +17 -0
  39. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +104 -0
  40. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +18 -0
  41. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +59 -0
  42. certificate/tests/cloud_connectivity/registration_test/registration_test.json +20 -0
  43. certificate/tests/cloud_connectivity/registration_test/registration_test.py +384 -0
  44. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +90 -0
  45. certificate/tests/cloud_connectivity/stress_test/stress_test.json +17 -0
  46. certificate/tests/cloud_connectivity/stress_test/stress_test.py +101 -0
  47. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +25 -0
  48. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +92 -0
  49. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +20 -0
  50. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +169 -0
  51. {brg_certificate → certificate}/tests/datapath/aging_test/aging_test.json +2 -1
  52. certificate/tests/datapath/aging_test/aging_test.py +142 -0
  53. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +17 -0
  54. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +89 -0
  55. certificate/tests/datapath/event_test/event_test.json +17 -0
  56. certificate/tests/datapath/event_test/event_test.py +80 -0
  57. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.json +4 -3
  58. {brg_certificate → certificate}/tests/datapath/num_of_tags_test/num_of_tags_test.py +19 -13
  59. certificate/tests/datapath/output_power_test/output_power_test.json +23 -0
  60. {brg_certificate → certificate}/tests/datapath/output_power_test/output_power_test.py +17 -6
  61. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +2 -1
  62. {brg_certificate → certificate}/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +13 -11
  63. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -1
  64. {brg_certificate → certificate}/tests/datapath/pacer_interval_test/pacer_interval_test.py +9 -7
  65. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.json +3 -2
  66. {brg_certificate → certificate}/tests/datapath/pattern_test/pattern_test.py +18 -6
  67. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +20 -0
  68. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +61 -0
  69. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +2 -1
  70. {brg_certificate → certificate}/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +15 -14
  71. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +19 -0
  72. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +85 -0
  73. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -1
  74. {brg_certificate → certificate}/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +10 -9
  75. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -1
  76. {brg_certificate → certificate}/tests/datapath/pkt_filter_test/pkt_filter_test.py +10 -9
  77. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -2
  78. {brg_certificate → certificate}/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +9 -8
  79. brg_certificate/tests/datapath/output_power_test/output_power_test.json → certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +6 -4
  80. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.py +77 -0
  81. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.json +3 -2
  82. {brg_certificate → certificate}/tests/datapath/rx_channel_test/rx_channel_test.py +7 -6
  83. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +8 -7
  84. {brg_certificate → certificate}/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +113 -73
  85. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +8 -7
  86. {brg_certificate → certificate}/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +112 -72
  87. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.json +4 -3
  88. {brg_certificate → certificate}/tests/datapath/stress_gen3_test/stress_gen3_test.py +15 -11
  89. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.json +4 -3
  90. {brg_certificate → certificate}/tests/datapath/stress_test/stress_test.py +15 -11
  91. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.json +3 -1
  92. {brg_certificate → certificate}/tests/datapath/tx_repetition_test/tx_repetition_test.py +14 -13
  93. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +15 -0
  94. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.py +24 -0
  95. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +15 -0
  96. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.py +43 -0
  97. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +15 -0
  98. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.py +42 -0
  99. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +15 -0
  100. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.py +44 -0
  101. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +16 -0
  102. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.py +42 -0
  103. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +15 -0
  104. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.py +49 -0
  105. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +15 -0
  106. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.py +102 -0
  107. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +15 -0
  108. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +45 -0
  109. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +3 -2
  110. {brg_certificate → certificate}/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.py +22 -11
  111. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.json +2 -1
  112. {brg_certificate → certificate}/tests/energy2400/duty_cycle_test/duty_cycle_test.py +7 -6
  113. certificate/tests/energy2400/output_power_test/output_power_test.json +23 -0
  114. {brg_certificate → certificate}/tests/energy2400/output_power_test/output_power_test.py +17 -6
  115. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.json +2 -1
  116. {brg_certificate → certificate}/tests/energy2400/pattern_test/pattern_test.py +7 -6
  117. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +26 -0
  118. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +379 -0
  119. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +20 -0
  120. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +173 -0
  121. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +24 -0
  122. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +350 -0
  123. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -1
  124. {brg_certificate → certificate}/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +7 -6
  125. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.json +2 -1
  126. {brg_certificate → certificate}/tests/energy_sub1g/pattern_test/pattern_test.py +7 -6
  127. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +2 -1
  128. {brg_certificate → certificate}/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +10 -10
  129. {brg_certificate → certificate}/tests/sensors/ext_sensor_test/ext_sensor_test.json +5 -4
  130. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +450 -0
  131. certificate/wlt_types.py +122 -0
  132. {gw_certificate → common}/api_if/202/status.json +6 -0
  133. {gw_certificate → common}/api_if/203/status.json +6 -0
  134. {gw_certificate → common}/api_if/204/status.json +6 -0
  135. common/api_if/206/data.json +85 -0
  136. common/api_if/206/status.json +69 -0
  137. common/api_if/api_validation.py +91 -0
  138. common/web/templates/generator.html +210 -0
  139. common/web/templates/index.html +20 -0
  140. common/web/templates/menu.html +54 -0
  141. common/web/templates/parser.html +53 -0
  142. {brg_certificate/ag → common/web/templates}/wlt_types.html +1216 -191
  143. common/web/web_utils.py +399 -0
  144. {brg_certificate → common}/wltPb_pb2.py +14 -12
  145. {gw_certificate/common → common}/wltPb_pb2.pyi +16 -2
  146. gui_certificate/gui_certificate_cli.py +14 -0
  147. gui_certificate/server.py +1267 -0
  148. gui_certificate/templates/cert_run.html +1273 -0
  149. wiliot_certificate-4.5.0.dist-info/METADATA +99 -0
  150. wiliot_certificate-4.5.0.dist-info/RECORD +168 -0
  151. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/WHEEL +1 -1
  152. wiliot_certificate-4.5.0.dist-info/entry_points.txt +5 -0
  153. wiliot_certificate-4.5.0.dist-info/top_level.txt +3 -0
  154. brg_certificate/ag/energous_v0_defines.py +0 -925
  155. brg_certificate/ag/energous_v1_defines.py +0 -931
  156. brg_certificate/ag/energous_v2_defines.py +0 -925
  157. brg_certificate/ag/energous_v3_defines.py +0 -925
  158. brg_certificate/ag/energous_v4_defines.py +0 -925
  159. brg_certificate/ag/fanstel_lan_v0_defines.py +0 -925
  160. brg_certificate/ag/fanstel_lte_v0_defines.py +0 -925
  161. brg_certificate/ag/fanstel_wifi_v0_defines.py +0 -925
  162. brg_certificate/ag/minew_lte_v0_defines.py +0 -925
  163. brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -142
  164. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -785
  165. brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -139
  166. brg_certificate/ag/wlt_types_ag_jsons/calibration.json +0 -394
  167. brg_certificate/ag/wlt_types_ag_jsons/custom.json +0 -515
  168. brg_certificate/ag/wlt_types_ag_jsons/datapath.json +0 -672
  169. brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -550
  170. brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -595
  171. brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -598
  172. brg_certificate/ag/wlt_types_ag_jsons/interface.json +0 -938
  173. brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1234
  174. brg_certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
  175. brg_certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
  176. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -61
  177. brg_certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -110
  178. brg_certificate/brg_certificate.py +0 -225
  179. brg_certificate/brg_certificate_cli.py +0 -63
  180. brg_certificate/cert_common.py +0 -923
  181. brg_certificate/cert_config.py +0 -402
  182. brg_certificate/cert_utils.py +0 -362
  183. brg_certificate/certificate_bcc_sanity_test_list.txt +0 -40
  184. brg_certificate/certificate_bcc_test_list.txt +0 -48
  185. brg_certificate/certificate_sanity_test_list.txt +0 -43
  186. brg_certificate/certificate_test_list.txt +0 -53
  187. brg_certificate/config/eclipse.json +0 -10
  188. brg_certificate/config/hivemq.json +0 -10
  189. brg_certificate/config/mosquitto.json +0 -10
  190. brg_certificate/config/mosquitto.md +0 -95
  191. brg_certificate/config/wiliot-dev.json +0 -10
  192. brg_certificate/restore_brg.py +0 -61
  193. brg_certificate/tests/calibration/output_power_test/output_power_test.json +0 -16
  194. brg_certificate/tests/calibration/output_power_test/output_power_test.py +0 -28
  195. brg_certificate/tests/datapath/aging_test/aging_test.py +0 -143
  196. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +0 -16
  197. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +0 -73
  198. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +0 -17
  199. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +0 -118
  200. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +0 -14
  201. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +0 -396
  202. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +0 -20
  203. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +0 -94
  204. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +0 -19
  205. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +0 -87
  206. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +0 -17
  207. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +0 -223
  208. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +0 -17
  209. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +0 -128
  210. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +0 -16
  211. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +0 -20
  212. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +0 -321
  213. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +0 -20
  214. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +0 -321
  215. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +0 -20
  216. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +0 -141
  217. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -20
  218. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +0 -276
  219. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +0 -20
  220. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +0 -390
  221. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +0 -16
  222. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +0 -28
  223. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +0 -305
  224. brg_certificate/wltPb_pb2.pyi +0 -234
  225. brg_certificate/wlt_types.py +0 -113
  226. gw_certificate/ag/ut_defines.py +0 -364
  227. gw_certificate/ag/wlt_types.py +0 -85
  228. gw_certificate/ag/wlt_types_ag.py +0 -5310
  229. gw_certificate/ag/wlt_types_data.py +0 -64
  230. gw_certificate/api/extended_api.py +0 -23
  231. gw_certificate/api_if/200/data.json +0 -106
  232. gw_certificate/api_if/200/status.json +0 -47
  233. gw_certificate/api_if/201/data.json +0 -98
  234. gw_certificate/api_if/201/status.json +0 -53
  235. gw_certificate/api_if/205/logs.json +0 -12
  236. gw_certificate/api_if/api_validation.py +0 -38
  237. gw_certificate/api_if/gw_capabilities.py +0 -54
  238. gw_certificate/cert_results.py +0 -145
  239. gw_certificate/common/analysis_data_bricks.py +0 -60
  240. gw_certificate/common/debug.py +0 -42
  241. gw_certificate/common/serialization_formatter.py +0 -93
  242. gw_certificate/common/utils.py +0 -8
  243. gw_certificate/common/utils_defines.py +0 -15
  244. gw_certificate/common/wltPb_pb2.py +0 -84
  245. gw_certificate/gw_certificate.py +0 -154
  246. gw_certificate/gw_certificate_cli.py +0 -87
  247. gw_certificate/interface/4.4.93_app.zip +0 -0
  248. gw_certificate/interface/4.4.93_sd_bl_app.zip +0 -0
  249. gw_certificate/interface/ble_simulator.py +0 -61
  250. gw_certificate/interface/ble_sniffer.py +0 -189
  251. gw_certificate/interface/flash_fw.py +0 -90
  252. gw_certificate/interface/if_defines.py +0 -36
  253. gw_certificate/interface/mqtt.py +0 -563
  254. gw_certificate/interface/nrfutil-linux +0 -0
  255. gw_certificate/interface/nrfutil-mac +0 -0
  256. gw_certificate/interface/nrfutil.exe +0 -0
  257. gw_certificate/interface/pkt_generator.py +0 -594
  258. gw_certificate/interface/uart_if.py +0 -236
  259. gw_certificate/interface/uart_ports.py +0 -20
  260. gw_certificate/templates/results.html +0 -241
  261. gw_certificate/templates/stage.html +0 -22
  262. gw_certificate/templates/table.html +0 -6
  263. gw_certificate/templates/test.html +0 -38
  264. gw_certificate/tests/__init__.py +0 -10
  265. gw_certificate/tests/actions.py +0 -289
  266. gw_certificate/tests/bad_crc_to_PER_quantization.csv +0 -51
  267. gw_certificate/tests/connection.py +0 -188
  268. gw_certificate/tests/downlink.py +0 -172
  269. gw_certificate/tests/generic.py +0 -238
  270. gw_certificate/tests/registration.py +0 -340
  271. gw_certificate/tests/static/__init__.py +0 -0
  272. gw_certificate/tests/static/connection_defines.py +0 -9
  273. gw_certificate/tests/static/downlink_defines.py +0 -9
  274. gw_certificate/tests/static/generated_packet_table.py +0 -195
  275. gw_certificate/tests/static/packet_table.csv +0 -10067
  276. gw_certificate/tests/static/references.py +0 -5
  277. gw_certificate/tests/static/uplink_defines.py +0 -14
  278. gw_certificate/tests/throughput.py +0 -240
  279. gw_certificate/tests/uplink.py +0 -853
  280. wiliot_certificate-4.4.3.dist-info/METADATA +0 -211
  281. wiliot_certificate-4.4.3.dist-info/RECORD +0 -210
  282. wiliot_certificate-4.4.3.dist-info/entry_points.txt +0 -3
  283. wiliot_certificate-4.4.3.dist-info/top_level.txt +0 -3
  284. {brg_certificate → certificate}/__init__.py +0 -0
  285. {gw_certificate → common}/api_if/202/data.json +0 -0
  286. {gw_certificate/api_if/200 → common/api_if/202}/logs.json +0 -0
  287. {gw_certificate → common}/api_if/203/data.json +0 -0
  288. {gw_certificate/api_if/201 → common/api_if/203}/logs.json +0 -0
  289. {gw_certificate → common}/api_if/204/data.json +0 -0
  290. {gw_certificate/api_if/202 → common/api_if/204}/logs.json +0 -0
  291. {gw_certificate → common}/api_if/205/data.json +0 -0
  292. {gw_certificate/api_if/203 → common/api_if/205}/logs.json +0 -0
  293. {gw_certificate → common}/api_if/205/status.json +0 -0
  294. {gw_certificate/api_if/204 → common/api_if/206}/logs.json +0 -0
  295. {gw_certificate → common/api_if}/__init__.py +0 -0
  296. {gw_certificate/api_if → gui_certificate}/__init__.py +0 -0
  297. {wiliot_certificate-4.4.3.dist-info → wiliot_certificate-4.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,340 +0,0 @@
1
- import datetime
2
- import time
3
- import os
4
- from enum import Enum
5
- from typing import Literal
6
-
7
- from wiliot_api.api_client import WiliotCloudError
8
-
9
- from gw_certificate.common.debug import debug_print
10
- from gw_certificate.tests.generic import INCONCLUSIVE_MINIMUM, PassCriteria, MINIMUM_SCORE, PERFECT_SCORE, GenericStage, GenericTest, INFORMATIVE
11
- from gw_certificate.api.extended_api import ExtendedEdgeClient
12
- from gw_certificate.tests.static.connection_defines import *
13
- from gw_certificate.tests.static.references import GW_REGISTER_DOC, GW_MQTT_DOC
14
-
15
-
16
- # HELPER DEFINES
17
- REG_CERT_OWNER_ID = 'gw-certification-account'
18
- ENV_VAR_AWS = 'WLT_REG_CERT_KEY_AWS'
19
-
20
- STAGES_TIMEOUT_MINUTES = 2
21
- TOKEN_EXPIRY_MINUTES = 3
22
- CLOUD_DELAY_SEC = 7
23
- BUSY_WAIT_DELAY_SEC = 5
24
- STAGE_START_DELAY_MS = (BUSY_WAIT_DELAY_SEC + CLOUD_DELAY_SEC + 1) * 1000
25
-
26
- ERROR_NO_REGISTER = 'Gateway did not register itself in time.'
27
- ERROR_NO_ONLINE = 'Gateway did not connect to MQTT in time.'
28
- ERROR_NO_ACTIVE = 'Gateway did not upload a status message with its configurations in time.'
29
- ERROR_NO_REFRESH = 'Gateway did not reconnect to MQTT in time.'
30
-
31
- # HELPER CLASSES
32
- class GetGwField(Enum):
33
- STATUS = 'status'
34
- ONLINE = 'online'
35
- ONLINE_UPDATED_AT = 'onlineUpdatedAt'
36
- ACTIVATED_AT = 'activatedAt'
37
-
38
- class Status(Enum):
39
- PRE_REGISTERED = 'pre-registered'
40
- REGISTERED = 'registered'
41
- APPROVED = 'approved'
42
- ACTIVE = 'active'
43
-
44
- class RegistrationData():
45
- """
46
- Hold variables which values must be shared between different stages.
47
- gw_online_ts hold the time in which the gateway status became online
48
- """
49
- def __init__(self):
50
- self.gw_online_ts = None
51
-
52
- # TEST STAGES
53
- class GenericRegistrationStage(GenericStage):
54
- def __init__(self, gw_id, edge:ExtendedEdgeClient, **kwargs):
55
- self.__dict__.update(kwargs)
56
- self.gw_id = gw_id
57
- self.edge = edge
58
- super().__init__(**self.__dict__)
59
-
60
- def get_gateway_field(self, field:GetGwField):
61
- temp = self.edge.get_gateway(self.gw_id)
62
- return temp[field.value]
63
-
64
- def kick_gw_from_mqtt(self):
65
- response = self.edge.kick_gw_from_mqtt(self.gw_id)
66
- debug_print(f"Kick response:{response}")
67
-
68
- def validate_kong_logs(self, endpoint:Literal['device-authorize', 'registry', 'token', 'refresh']):
69
- message = None
70
- try:
71
- message = self.edge.get_kong_logs(self.gw_id)
72
- except WiliotCloudError as wce:
73
- wce_dict = wce.args[0]
74
- status_code = wce_dict.get('status_code')
75
- msg = wce_dict.get('message')
76
- if status_code == 404 and 'not found' in msg:
77
- debug_print("Could not find gw when requesting for logs.")
78
- debug_print("Either it is not registered, didn't issue any requests, or is missing the X-Gateway-ID header.")
79
- return False
80
- elif status_code == None:
81
- raise wce
82
- if isinstance(message, dict) and message.get('status_code') != 200:
83
- debug_print(f"Failed fetching logs, status_code:{message.get('status_code')}")
84
- return False
85
-
86
- # Convert datetime.now() format to epoch in MS
87
- stage_start_ts = self.start_time.timestamp() * 1000 - STAGE_START_DELAY_MS
88
-
89
- for log in message['data']:
90
- if log['timestamp'] > stage_start_ts and endpoint in log['endpoint']:
91
- response_code = log['responseCode']
92
- if response_code != 200:
93
- debug_print(f"An HTTP request to /{endpoint} resulted in an invalid response code:{response_code}")
94
- else:
95
- debug_print(f"A valid HTTP request to /{endpoint} was received")
96
- return True
97
-
98
- debug_print(f"No valid HTTP request to /{endpoint} was found")
99
- return False
100
-
101
- class RegistryStage(GenericRegistrationStage):
102
- def __init__(self, **kwargs):
103
- self.__dict__.update(kwargs)
104
- self.stage_tooltip = "Validate the gateway's registry step"
105
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
106
-
107
- def prepare_stage(self):
108
- super().prepare_stage()
109
- debug_print('Pre-registering the gateway, please make sure it is not registered to any other account '
110
- 'and that your device is ready to run the registration flow')
111
-
112
- def pre_register_gw_anew(gw_id):
113
- try:
114
- pre_registered = self.edge.register_gateway([gw_id])
115
- except WiliotCloudError as wce:
116
- wce_dict = wce.args[0]
117
- status_code = wce_dict.get('status_code')
118
- msg = wce_dict.get('message')
119
- if status_code == 400 and 'already exists' in msg:
120
- debug_print(f'{gw_id} already exists in Wiliot platform! Deleting and pre-registering from scratch')
121
- self.kick_gw_from_mqtt()
122
- self.edge.delete_gateway(gw_id)
123
- time.sleep(CLOUD_DELAY_SEC)
124
- pre_registered = self.edge.register_gateway([gw_id])
125
- else:
126
- if status_code == 403:
127
- debug_print(f"The API key within {self.env_variable} seems invalid. It is not authorized to pre-register the gateway")
128
- raise wce
129
- return pre_registered
130
-
131
- pre_registered = pre_register_gw_anew(self.gw_id)
132
- if not pre_registered:
133
- debug_print('Failed pre-registering the gateway')
134
- raise Exception(f"Failed pre-registering the gateway. Make sure:\n-Your API key ({ENV_VAR_AWS}) is valid.\n"
135
- "-You have a stable internet connection.\nOtherwise, try again later.")
136
- debug_print(f"{self.gw_id} was pre-registered successfully")
137
-
138
- def run(self):
139
- super().run()
140
- debug_print(f"Waiting for the gateway to finish the Registry step..")
141
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=STAGES_TIMEOUT_MINUTES)
142
- self.status = self.get_gateway_field(GetGwField.STATUS)
143
- while datetime.datetime.now() < timeout and not any(self.status == s.value for s in {Status.APPROVED, Status.ACTIVE}):
144
- time.sleep(BUSY_WAIT_DELAY_SEC)
145
- self.status = self.get_gateway_field(GetGwField.STATUS)
146
-
147
- time.sleep(CLOUD_DELAY_SEC)
148
- self.validate_kong_logs('device-authorize')
149
- self.validate_kong_logs('registry')
150
-
151
- def generate_stage_report(self):
152
- self.add_report_header()
153
- if not any(self.status == s.value for s in {Status.APPROVED, Status.ACTIVE}):
154
- self.stage_pass = MINIMUM_SCORE
155
- self.error_summary = ERROR_NO_REGISTER
156
- self.add_to_stage_report(ERROR_NO_REGISTER)
157
- debug_print(f"The gateway failed to register. Its status is '{self.status}' while it is expected to be '{Status.APPROVED.value}'.")
158
- self.add_to_stage_report(f"There was an error in the Device-authorize or Registry steps.")
159
- self.add_to_stage_report(f"Please go over the Device-authorize and Registry sections in this document:\n{GW_REGISTER_DOC}")
160
- if self.status == Status.REGISTERED:
161
- self.add_to_stage_report(f"Highly likely that the gateway is missing the 'X-Gateway-ID' header in it's HTTP requests.")
162
- else:
163
- self.stage_pass = PERFECT_SCORE
164
- self.add_to_stage_report("Device-authorize and Registry requests were issued well.")
165
- self.add_to_stage_report("Gateway registered successfully.")
166
- debug_print("Gateway registered successfully")
167
-
168
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
169
- stage_report=self.report.split('\n'))
170
- return super().generate_stage_report()
171
-
172
- class OnlineStage(GenericRegistrationStage):
173
- def __init__(self, **kwargs):
174
- self.__dict__.update(kwargs)
175
- self.stage_tooltip = "Validate the gateway become online on the platform"
176
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
177
-
178
- def prepare_stage(self):
179
- super().prepare_stage()
180
-
181
- def run(self):
182
- super().run()
183
- debug_print(f"Waiting for the gateway to connect to MQTT..")
184
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=STAGES_TIMEOUT_MINUTES)
185
- self.online = self.get_gateway_field(GetGwField.ONLINE)
186
- while datetime.datetime.now() < timeout and self.online != True:
187
- time.sleep(BUSY_WAIT_DELAY_SEC)
188
- self.online = self.get_gateway_field(GetGwField.ONLINE)
189
-
190
- time.sleep(CLOUD_DELAY_SEC)
191
- self.validate_kong_logs('token')
192
-
193
- def generate_stage_report(self):
194
- self.add_report_header()
195
- if self.online != True:
196
- self.stage_pass = MINIMUM_SCORE
197
- self.error_summary = ERROR_NO_ONLINE
198
- self.add_to_stage_report(ERROR_NO_ONLINE)
199
- self.add_to_stage_report(f"Either it didn't acquire a token or it didn't connect to MQTT in time.")
200
- self.add_to_stage_report(f"Please go over the Poll For Token section in:\n{GW_REGISTER_DOC}")
201
- self.add_to_stage_report(f"and the MQTT details in:\n{GW_MQTT_DOC}")
202
- debug_print("Gateway did not connect to MQTT within time limit")
203
- else:
204
- self.stage_pass = PERFECT_SCORE
205
- self.add_to_stage_report("Token acquisition and MQTT connection were done succesfully.")
206
- self.add_to_stage_report("Gateway is online.")
207
- debug_print("Gateway connected to MQTT successfully, it is online")
208
- self.reg_data.gw_online_ts = datetime.datetime.now()
209
-
210
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
211
- stage_report=self.report.split('\n'))
212
- return super().generate_stage_report()
213
-
214
- class ActiveStage(GenericRegistrationStage):
215
- def __init__(self, **kwargs):
216
- self.__dict__.update(kwargs)
217
- self.stage_tooltip = "Validate the gateway upload a status message upon MQTT connection"
218
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
219
-
220
- def prepare_stage(self):
221
- super().prepare_stage()
222
-
223
- def run(self):
224
- super().run()
225
- debug_print(f"Waiting for the gateway to upload a status message..")
226
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=STAGES_TIMEOUT_MINUTES)
227
- self.status = self.get_gateway_field(GetGwField.STATUS)
228
- while datetime.datetime.now() < timeout and self.status != Status.ACTIVE.value:
229
- time.sleep(BUSY_WAIT_DELAY_SEC)
230
- self.status = self.get_gateway_field(GetGwField.STATUS)
231
-
232
- def generate_stage_report(self):
233
- self.add_report_header()
234
- if self.status != Status.ACTIVE.value:
235
- self.stage_pass = MINIMUM_SCORE
236
- self.error_summary = ERROR_NO_ACTIVE
237
- self.add_to_stage_report(ERROR_NO_ACTIVE)
238
- self.add_to_stage_report(f"Please go over the Status section in:\n{GW_MQTT_DOC}")
239
- debug_print("Gateway did not upload a status message upon connecting to MQTT")
240
- else:
241
- self.stage_pass = PERFECT_SCORE
242
- self.add_to_stage_report("The gateway uploaded a status message in time.")
243
- self.add_to_stage_report("Gateway is active.")
244
- debug_print("Gateway uploaded a status message, it is active")
245
-
246
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
247
- stage_report=self.report.split('\n'))
248
- return super().generate_stage_report()
249
-
250
- class RefreshStage(GenericRegistrationStage):
251
- def __init__(self, **kwargs):
252
- self.__dict__.update(kwargs)
253
- self.stage_tooltip = "Validate the gateway refresh-token step"
254
- super().__init__(stage_name=type(self).__name__, **self.__dict__)
255
-
256
- def prepare_stage(self):
257
- super().prepare_stage()
258
-
259
- def run(self):
260
- super().run()
261
- debug_print(f"Waiting for the token to expire..")
262
- timeout = self.reg_data.gw_online_ts + datetime.timedelta(minutes=TOKEN_EXPIRY_MINUTES)
263
- while datetime.datetime.now() < timeout:
264
- time.sleep(BUSY_WAIT_DELAY_SEC)
265
-
266
- debug_print(f"Token expired, kicking gateway")
267
- self.kick_gw_from_mqtt()
268
-
269
- # Sleep here since it sometimes take time for the cloud to kick and change the gateway's online status
270
- time.sleep(CLOUD_DELAY_SEC)
271
- debug_print(f"Waiting for the gateway to refresh its token and connect to MQTT..")
272
- timeout = datetime.datetime.now() + datetime.timedelta(minutes=STAGES_TIMEOUT_MINUTES)
273
- self.online = self.get_gateway_field(GetGwField.ONLINE)
274
- while datetime.datetime.now() < timeout and self.online != True:
275
- time.sleep(BUSY_WAIT_DELAY_SEC)
276
- self.online = self.get_gateway_field(GetGwField.ONLINE)
277
-
278
- time.sleep(CLOUD_DELAY_SEC)
279
- self.validate_kong_logs('refresh')
280
-
281
- def generate_stage_report(self):
282
- self.add_report_header()
283
- if self.online != True:
284
- self.stage_pass = MINIMUM_SCORE
285
- self.error_summary = ERROR_NO_REFRESH
286
- self.add_to_stage_report(ERROR_NO_REFRESH)
287
- self.add_to_stage_report(f"Either it didn't refresh its token or it didn't connect to MQTT in time.")
288
- self.add_to_stage_report(f"Please go over the Refresh Token section in:\n{GW_REGISTER_DOC}")
289
- self.add_to_stage_report(f"and the MQTT details in:\n{GW_MQTT_DOC}")
290
- debug_print("Gateway did not reconnect MQTT (was the token refreshed?)")
291
- else:
292
- self.stage_pass = PERFECT_SCORE
293
- self.add_to_stage_report("Token refresh and MQTT reconnection were done succesfully.")
294
- self.add_to_stage_report("Gateway is online.")
295
-
296
- self.report_html = self.template_engine.render_template('stage.html', stage=self,
297
- stage_report=self.report.split('\n'))
298
- return super().generate_stage_report()
299
-
300
-
301
- STAGES = [RegistryStage, OnlineStage, ActiveStage, RefreshStage]
302
-
303
- class RegistrationTest(GenericTest):
304
- def __init__(self, **kwargs):
305
- self.__dict__.update(kwargs)
306
- self.test_tooltip = "Stages related to the process of registering a gateway with the Wiliot cloud"
307
-
308
- # Set up the edge client for all stages
309
- env = '' if self.env == 'prod' else '_' + str(self.env).upper()
310
- self.env_variable = ENV_VAR_AWS + env
311
- api_sec_key = os.environ.get(self.env_variable)
312
- if not api_sec_key:
313
- raise Exception(f"An API security key must be set to the envrionment variable {self.env_variable} in order to run the RegistrationTest")
314
- self.edge = ExtendedEdgeClient(api_sec_key, REG_CERT_OWNER_ID, env=self.env)
315
-
316
- self.reg_data = RegistrationData()
317
-
318
- super().__init__(**self.__dict__, test_name=type(self).__name__)
319
- stages = STAGES
320
- self.stages = [stage(**self.__dict__) for stage in stages]
321
-
322
- def run(self):
323
- super().run()
324
- self.test_pass = PERFECT_SCORE
325
- for idx, stage in enumerate(self.stages):
326
- stage.prepare_stage()
327
- stage.run()
328
- self.add_to_test_report(stage.generate_stage_report())
329
- self.test_pass = PassCriteria.calc_for_test(self, stage)
330
- if self.test_pass != PERFECT_SCORE and stage != self.stages[-1]:
331
- debug_print(f"{type(self).__name__} stopped without running all of its stages since {type(stage).__name__} failed")
332
- self.add_to_test_report(f"{type(self).__name__} stopped without running all of its stages since {type(stage).__name__} failed")
333
- self.stages = self.stages[0:idx + 1]
334
- break
335
-
336
- def end_test(self):
337
- debug_print(f'Deleting {self.gw_id} from {REG_CERT_OWNER_ID} before exiting')
338
- time.sleep(CLOUD_DELAY_SEC)
339
- self.edge.delete_gateway(self.gw_id)
340
- super().end_test()
File without changes
@@ -1,9 +0,0 @@
1
- CSV_NAME = 'bad_crc_to_PER_quantization.csv'
2
- INTERFERENCE_ANALYSIS_FW_VER = "4.2.0"
3
- CHANNELS_TO_ANALYZE = [(37, 2402), (38, 2426), (39, 2480)]
4
- CNTRS_LISTEN_TIME_SEC = 30
5
- MAX_UNSIGNED_32_BIT = 4294967295
6
- NON_WLT_RX = 'non_wlt_rx'
7
- WLT_RX = 'wlt_rx'
8
- BAD_CRC = 'bad_crc'
9
- CNTRS_KEYS = [NON_WLT_RX, WLT_RX, BAD_CRC]
@@ -1,9 +0,0 @@
1
- SANITY_STAGE = "SanityStage"
2
- CORRELATION_STAGE = "CorrelationStage"
3
- STAGE_CONFIGS = {
4
- SANITY_STAGE:([i for i in range(700, 901, 100)], range(3)),
5
- CORRELATION_STAGE:([i for i in range(100, 2001, 400)], range(3))}
6
- TX_MAX_DURATIONS = range(100, 501, 100)
7
- RETRIES = range(5)
8
- MAX_RX_TX_PERIOD_SECS = 0.255
9
- DEFAULT_BRG_ID = "FFFFFFFFFFFF"
@@ -1,195 +0,0 @@
1
-
2
- import pkg_resources
3
- import pandas as pd
4
-
5
- from gw_certificate.common.debug import debug_print
6
- from gw_certificate.interface.pkt_generator import BrgPktGeneratorNetwork
7
- from gw_certificate.interface.if_defines import *
8
-
9
- CSV_NAME = 'packet_table.csv'
10
- PACKET_TABLE_CSV_PATH = pkg_resources.resource_filename(__name__, CSV_NAME)
11
-
12
- TEST_STRESS = 'stress'
13
- TEST_COUPLING = 'coupling'
14
- TEST_DOWNLINK = 'downlink'
15
- TEST_UPLINK = 'uplink'
16
- TEST_UNIFIED = 'unified'
17
- TEST_SENSOR = 'sensor'
18
-
19
- TESTS = [TEST_COUPLING, TEST_UPLINK, TEST_UNIFIED]
20
- class GeneratedPacketTable:
21
-
22
- def __init__(self) -> None:
23
- self.brg_network = BrgPktGeneratorNetwork()
24
- self.table = pd.read_csv(PACKET_TABLE_CSV_PATH)
25
-
26
- def get_data(self, test, duplication, time_delay, bridge_idx) -> list:
27
- assert test in TESTS, 'Invalid Test'
28
- assert (duplication in UPLINK_DUPLICATIONS) or (duplication in UNIFIED_DUPLICATIONS), 'Invalid Duplication'
29
- assert (time_delay in UPLINK_TIME_DELAYS) or (time_delay in UNIFIED_TIME_DELAYS), 'Invalid Time Delay'
30
- assert bridge_idx in BRIDGES, 'Invalid Bridge'
31
-
32
- t = self.table
33
- return t.loc[((t['test'] == test) &
34
- (t['duplication'] == duplication) &
35
- (t['time_delay'] == time_delay) &
36
- (t['bridge_idx'] == bridge_idx))].to_dict('records')[0]
37
-
38
- def get_df(self, columns=None):
39
- if columns is not None:
40
- return self.table[columns]
41
- return self.table
42
-
43
- def get_stress_data(self) -> pd.DataFrame:
44
- t = self.table
45
- return t.loc[((t['test'] == 'stress'))]
46
-
47
- def get_sensor_data(self) -> pd.DataFrame:
48
- t = self.table
49
- return t.loc[((t['test'] == 'sensor'))]
50
-
51
- def get_mgmt_data(self) -> pd.DataFrame:
52
- t = self.table
53
- return t.loc[((t['test'] == 'mgmt'))]
54
-
55
- def get_acl_data(self) -> pd.DataFrame:
56
- t = self.table
57
- return t.loc[((t['test'] == 'acl'))]
58
-
59
- def get_unified_data(self) -> pd.DataFrame:
60
- t = self.table
61
- return t.loc[((t['test'] == 'unified'))]
62
-
63
- def _generate_packet_table(self):
64
- packet_list = []
65
-
66
- # UNIFIED TEST
67
- for duplication in UNIFIED_DUPLICATIONS:
68
- debug_print(f'Duplication {duplication}')
69
- for time_delay in UNIFIED_TIME_DELAYS:
70
- debug_print(f'Time Delay {time_delay}')
71
- pkts = self.brg_network.get_new_pkt_unified()
72
- for idx, brg in enumerate(self.brg_network.brg_list):
73
- debug_print(f'Bridge {idx}')
74
- data = pkts[idx]['data_packet']
75
- brg_id = self.brg_network.brg_list[idx].bridge_id
76
- # log the sent packet with relevant info from run
77
- packet_list.append({'test': TEST_UNIFIED,
78
- 'duplication': duplication,
79
- 'time_delay': time_delay,
80
- 'bridge_idx': idx,
81
- ADVA_PAYLOAD: data, 'bridge_id': brg_id,
82
- 'adva': data[:12], 'payload': data[16:], 'pkt_id': data[-8:]
83
- })
84
-
85
- #STRESS TEST
86
- i = 0
87
- while i < 10000:
88
- i += 1
89
- pkts = self.brg_network.get_new_pkt_unified()
90
- target_idx = 0
91
- brg = self.brg_network.brg_list[target_idx]
92
- debug_print(f'Bridge {target_idx}')
93
- data = pkts[target_idx]['data_packet']
94
- brg_id = brg.bridge_id
95
- packet_list.append({
96
- 'test': TEST_STRESS,
97
- 'duplication': 1,
98
- 'bridge_idx': target_idx,
99
- ADVA_PAYLOAD: data,
100
- 'bridge_id': brg_id,
101
- 'adva': data[:12],
102
- 'payload': data[16:],
103
- 'pkt_id': data[-8:]
104
- })
105
-
106
- def _sensor_data(df):
107
- hardcoded_data = [
108
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB101690FCA1016417913C42FD38AF3F23AC0201060303E1FF060000FA0EAB04", "payload":"90FCA1016417913C42FD38AF3F23AC0201060303E1FF060000FA0EAB04" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B00003600AC233FAF38FD16E1FF05FA0EAB04", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "FA0EAB04"},
109
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB101690FCA10164157D358A0E39AF3F23AC0201060303E1FF0600007EE3A33F", "payload":"90FCA10164157D358A0E39AF3F23AC0201060303E1FF0600007EE3A33F" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B00004300AC233FAF390E16E1FF057EE3A33F", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "7EE3A33F"},
110
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB111690FCA1085CCA5BF13F23AC4D425330310201060303E1FF0500E16ED8EA", "payload":"90FCA1085CCA5BF13F23AC4D425330310201060303E1FF0500E16ED8EA" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B00004700AC233FF15BCA16E1FF05E16ED8EA", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "E16ED8EA"},
111
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB101690FCA10164157D358A0E39AF3F23AC0201060303E1FF06000003E3A33F", "payload":"90FCA10164157D358A0E39AF3F23AC0201060303E1FF06000003E3A33F" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B00073E00AC233FAF390E16E1FF0503E3A33F", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "03E3A33F"},
112
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB111690FCA10858CA5BF13F23AC4D425330310201060303E1FF0500996ED8EE", "payload":"90FCA10858CA5BF13F23AC4D425330310201060303E1FF0500996ED8EE" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B00043F00AC233FF15BCA16E1FF05996ED8EE", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "996ED8EE"},
113
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB0E1690FCA10864FD38AF3F23AC53310201060303E1FF0800000000157A359C", "payload":"90FCA10864FD38AF3F23AC53310201060303E1FF0800000000157A359C" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B000E3600AC233FAF38FD16E1FF05157A359C", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "157A359C"},
114
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC0200002CC60917A02CB02367771BE9EA20F9666ED8A06F6612745B", "payload":"90FC0200002CC60917A02CB02367771BE9EA20F9666ED8A06F6612745B" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177BF1EBC500000000000000000000006612745B", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "6612745B"},
115
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC02000007EFE229109B044DB995A506179C99094720AE8BF9F78C1A", "payload":"90FC02000007EFE229109B044DB995A506179C99094720AE8BF9F78C1A" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B6CEC9A0000000000000000000000F9F78C1A", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "F9F78C1A"},
116
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC0200002CA1E008E364D0DCF65631718BCD659DE3323A69A674F7B9", "payload":"90FC0200002CA1E008E364D0DCF65631718BCD659DE3323A69A674F7B9" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B1051900000000000000000000000A674F7B9", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "A674F7B9"},
117
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC02000049ADD722F535679C37983927655C974A4980B080045DA6C2", "payload":"90FC02000049ADD722F535679C37983927655C974A4980B080045DA6C2" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B5280B20000000000000000000000045DA6C2", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "045DA6C2"},
118
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC0200004C8AD49C6D96923BFB70DF06554F5E8F438F1DF57E063773", "payload":"90FC0200004C8AD49C6D96923BFB70DF06554F5E8F438F1DF57E063773" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177BB4085900000000000000000000007E063773", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "7E063773"},
119
- {"test": "sensor", "duplication": "5", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "3B613D0817FB1E1690FC02000064A5B54285BB6BCDB457ABBED8EE26B4EB43B27A8C26781C", "payload":"90FC02000064A5B54285BB6BCDB457ABBED8EE26B4EB43B27A8C26781C" ,"si": "3B613D0817FB1E16C6FC0000EB3B613D08177B27363800000000000000000000008C26781C", "bridge_id": "3B613D08177B", "adva": "3B613D0817FB", "pkt_id": "8C26781C"},
120
- ]
121
-
122
- hardcoded_df = pd.DataFrame(hardcoded_data)
123
- return pd.concat([df, hardcoded_df], ignore_index=True)
124
-
125
- def _mgmt_data(df):
126
- hardcoded_data = [
127
- # First pkt is HB, second is CFG_INFO of MODULE_IF
128
- {"test": "mgmt", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "A365FEC659D21E16C6FC0000EE020AD2A365FEC65912095E9101FF1104EB0958D400110100", "payload": "C6FC0000EE020AD2A365FEC65912095E9101FF1104EB0958D400110100", "si": "", "bridge_id": "A365FEC65912", "adva": "A365FEC659D2", "pkt_id": "00110100"},
129
- {"test": "mgmt", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "A365FEC659D21E16C6FC0000EE110BD3A365FEC6591203040121E8F2FDB000000000000000", "payload": "C6FC0000EE110BD3A365FEC6591203040121E8F2FDB000000000000000", "si": "", "bridge_id": "A365FEC65912", "adva": "A365FEC659D2", "pkt_id": "00000000"},
130
- ]
131
-
132
- hardcoded_df = pd.DataFrame(hardcoded_data)
133
- return pd.concat([df, hardcoded_df], ignore_index=True)
134
-
135
- def _acl_data(df):
136
- hardcoded_data = [
137
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD2A365FECA5916095E9101FF1104EB0958D400110100", "payload": "C6FC00003F020AD2A365FECA5916095E9101FF1104EB0958D400110100", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110100"},
138
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD2A365FEC6591A095E9101FF1104EB0958D400110100", "payload": "C6FC00003F020AD2A365FEC6591A095E9101FF1104EB0958D400110100", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110100"},
139
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD3A365FECA5916095E9101FF1104EB0958D400110101", "payload": "C6FC00003F020AD3A365FECA5916095E9101FF1104EB0958D400110101", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110101"},
140
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD3A365FEC6591A095E9101FF1104EB0958D400110101", "payload": "C6FC00003F020AD3A365FEC6591A095E9101FF1104EB0958D400110101", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110101"},
141
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD4A365FECA5916095E9101FF1104EB0958D400110102", "payload": "C6FC00003F020AD4A365FECA5916095E9101FF1104EB0958D400110102", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110102"},
142
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD4A365FEC6591A095E9101FF1104EB0958D400110102", "payload": "C6FC00003F020AD4A365FEC6591A095E9101FF1104EB0958D400110102", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110102"},
143
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD5A365FECA5916095E9101FF1104EB0958D400110103", "payload": "C6FC00003F020AD5A365FECA5916095E9101FF1104EB0958D400110103", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110103"},
144
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD5A365FEC6591A095E9101FF1104EB0958D400110103", "payload": "C6FC00003F020AD5A365FEC6591A095E9101FF1104EB0958D400110103", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110103"},
145
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD6A365FECA5916095E9101FF1104EB0958D400110104", "payload": "C6FC00003F020AD6A365FECA5916095E9101FF1104EB0958D400110104", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110104"},
146
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD6A365FEC6591A095E9101FF1104EB0958D400110104", "payload": "C6FC00003F020AD6A365FEC6591A095E9101FF1104EB0958D400110104", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110104"},
147
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD7A365FECA5916095E9101FF1104EB0958D400110105", "payload": "C6FC00003F020AD7A365FECA5916095E9101FF1104EB0958D400110105", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110105"},
148
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD7A365FEC6591A095E9101FF1104EB0958D400110105", "payload": "C6FC00003F020AD7A365FEC6591A095E9101FF1104EB0958D400110105", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110105"},
149
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD8A365FECA5916095E9101FF1104EB0958D400110106", "payload": "C6FC00003F020AD8A365FECA5916095E9101FF1104EB0958D400110106", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110106"},
150
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD8A365FEC6591A095E9101FF1104EB0958D400110106", "payload": "C6FC00003F020AD8A365FEC6591A095E9101FF1104EB0958D400110106", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110106"},
151
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 1, ADVA_PAYLOAD: "1659CAFE65E31E16C6FC00003F020AD9A365FECA5916095E9101FF1104EB0958D400110107", "payload": "C6FC00003F020AD9A365FECA5916095E9101FF1104EB0958D400110107", "si": "", "bridge_id": "A365FECA5916", "adva": "1659CAFE65E3", "pkt_id": "00110107"},
152
- {"test": "acl", "duplication": "10", "time_delay": "20", "bridge_idx": 2, ADVA_PAYLOAD: "1A59C6FE65E31E16C6FC00003F020AD9A365FEC6591A095E9101FF1104EB0958D400110107", "payload": "C6FC00003F020AD9A365FEC6591A095E9101FF1104EB0958D400110107", "si": "", "bridge_id": "A365FEC6591A", "adva": "1A59C6FE65E3", "pkt_id": "00110107"},
153
- ]
154
-
155
- hardcoded_df = pd.DataFrame(hardcoded_data)
156
- return pd.concat([df, hardcoded_df], ignore_index=True)
157
-
158
- df = pd.DataFrame(packet_list)
159
- df = _sensor_data(df)
160
- df = _mgmt_data(df)
161
- df = _acl_data(df)
162
- df.to_csv(PACKET_TABLE_CSV_PATH)
163
-
164
- class UnifiedRunData:
165
- def __init__(self) -> None:
166
- self.data = GeneratedPacketTable().get_unified_data()
167
-
168
- class StressRunData:
169
- def __init__(self) -> None:
170
- self.data = GeneratedPacketTable().get_stress_data()
171
-
172
- class SensorRunData:
173
- def __init__(self) -> None:
174
- self.data = GeneratedPacketTable().get_sensor_data()
175
-
176
- class MgmtRunData:
177
- def __init__(self) -> None:
178
- self.data = GeneratedPacketTable().get_mgmt_data()
179
-
180
- class ACLRunData:
181
- def __init__(self) -> None:
182
- self.data = GeneratedPacketTable().get_acl_data()
183
-
184
- class PacketTableHelper():
185
- def __init__(self):
186
- self.table = GeneratedPacketTable().get_df()
187
-
188
- def set_field(self, data_payload, field, value):
189
- self.table.loc[self.table[ADVA_PAYLOAD].str.contains(data_payload) == True, field] = value
190
-
191
- def get_field(self, data_payload, field):
192
- return self.table[self.table[ADVA_PAYLOAD].str.contains(data_payload) == True][field]
193
-
194
- if __name__ == "__main__":
195
- GeneratedPacketTable()._generate_packet_table()