wiliot-certificate 4.5.0__py3-none-any.whl → 4.5.0a2__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 (125) hide show
  1. certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +211 -0
  2. certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +894 -0
  3. certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +184 -0
  4. certificate/ag/wlt_types_ag_jsons/calibration.json +490 -0
  5. certificate/ag/wlt_types_ag_jsons/custom.json +614 -0
  6. certificate/ag/wlt_types_ag_jsons/datapath.json +900 -0
  7. certificate/ag/wlt_types_ag_jsons/energy2400.json +670 -0
  8. certificate/ag/wlt_types_ag_jsons/energySub1g.json +691 -0
  9. certificate/ag/wlt_types_ag_jsons/externalSensor.json +727 -0
  10. certificate/ag/wlt_types_ag_jsons/interface.json +1095 -0
  11. certificate/ag/wlt_types_ag_jsons/powerManagement.json +1439 -0
  12. certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
  13. certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
  14. certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +126 -0
  15. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
  16. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
  17. certificate/cert_common.py +35 -65
  18. certificate/cert_config.py +18 -43
  19. certificate/cert_data_sim.py +9 -12
  20. certificate/cert_defines.py +0 -8
  21. certificate/cert_gw_sim.py +7 -32
  22. certificate/cert_mqtt.py +5 -15
  23. certificate/cert_prints.py +0 -1
  24. certificate/cert_results.py +37 -48
  25. certificate/cert_utils.py +15 -24
  26. certificate/certificate.py +5 -12
  27. certificate/certificate_cli.py +13 -10
  28. certificate/certificate_eth_test_list.txt +3 -4
  29. certificate/certificate_sanity_test_list.txt +2 -3
  30. certificate/certificate_test_list.txt +4 -4
  31. certificate/tests/calibration/interval_test/interval_test.json +0 -1
  32. certificate/tests/calibration/output_power_test/output_power_test.json +0 -1
  33. certificate/tests/calibration/pattern_test/pattern_test.json +0 -1
  34. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +0 -1
  35. certificate/tests/cloud_connectivity/acl_test/acl_test.json +0 -1
  36. certificate/tests/cloud_connectivity/acl_test/acl_test.py +15 -13
  37. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +1 -2
  38. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +6 -8
  39. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +0 -1
  40. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +3 -3
  41. certificate/tests/cloud_connectivity/connection_test/connection_test.json +0 -1
  42. certificate/tests/cloud_connectivity/connection_test/connection_test.py +13 -6
  43. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +0 -1
  44. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +11 -6
  45. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +0 -1
  46. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +4 -1
  47. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +0 -1
  48. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +9 -14
  49. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +0 -1
  50. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +0 -2
  51. certificate/tests/cloud_connectivity/registration_test/registration_test.json +0 -1
  52. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +1 -1
  53. certificate/tests/cloud_connectivity/stress_test/stress_test.json +0 -1
  54. certificate/tests/cloud_connectivity/stress_test/stress_test.py +11 -15
  55. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +0 -1
  56. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +2 -1
  57. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +0 -1
  58. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +20 -27
  59. certificate/tests/datapath/aging_test/aging_test.json +0 -1
  60. certificate/tests/datapath/aging_test/aging_test.py +3 -7
  61. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +2 -3
  62. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +13 -7
  63. certificate/tests/datapath/event_test/event_test.json +2 -3
  64. certificate/tests/datapath/event_test/event_test.py +10 -5
  65. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -2
  66. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +5 -9
  67. certificate/tests/datapath/output_power_test/output_power_test.json +0 -1
  68. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +0 -1
  69. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
  70. certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +0 -1
  71. certificate/tests/datapath/pattern_test/pattern_test.json +0 -1
  72. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +0 -1
  73. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +5 -5
  74. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +0 -1
  75. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +5 -5
  76. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +0 -1
  77. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +8 -10
  78. certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +0 -1
  79. certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +0 -1
  80. certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +0 -1
  81. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +0 -1
  82. certificate/tests/datapath/rx_channel_test/rx_channel_test.json +0 -1
  83. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +0 -1
  84. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  85. certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +0 -1
  86. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +0 -1
  87. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +0 -3
  88. certificate/tests/datapath/stress_test/stress_test.json +0 -1
  89. certificate/tests/datapath/stress_test/stress_test.py +0 -3
  90. certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +0 -1
  91. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +0 -1
  92. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +0 -1
  93. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +0 -1
  94. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +0 -1
  95. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +0 -1
  96. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +0 -1
  97. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +0 -1
  98. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +0 -1
  99. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +14 -18
  100. certificate/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +0 -1
  101. certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +0 -1
  102. certificate/tests/energy2400/output_power_test/output_power_test.json +0 -1
  103. certificate/tests/energy2400/pattern_test/pattern_test.json +0 -1
  104. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -1
  105. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +3 -4
  106. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +9 -9
  107. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +271 -113
  108. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -1
  109. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +1 -1
  110. certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +0 -1
  111. certificate/tests/energy_sub1g/pattern_test/pattern_test.json +0 -1
  112. certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +0 -1
  113. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +0 -1
  114. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +9 -4
  115. common/api_if/api_validation.py +0 -6
  116. common/web/templates/generator.html +79 -141
  117. common/web/web_utils.py +56 -78
  118. gui_certificate/server.py +78 -283
  119. gui_certificate/templates/cert_run.html +113 -179
  120. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/METADATA +22 -7
  121. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/RECORD +125 -109
  122. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/WHEEL +0 -0
  123. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/entry_points.txt +0 -0
  124. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/licenses/LICENSE +0 -0
  125. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/top_level.txt +0 -0
@@ -31,7 +31,6 @@ CERT_VER = "Certificate Version"
31
31
  TESTING_DEVICE_INFO = "Testing Device Information"
32
32
  TESTED_DEVICE_INFO = "Tested Device Information"
33
33
  SIM = "Simulator"
34
- GATEWAY = "Gateway"
35
34
  BRG = "Bridge"
36
35
  BLE_MAC_ADDRESS = "BLE MAC Address"
37
36
  BOARD_TYPE = "Board Type"
@@ -114,24 +113,32 @@ def get_important_tests_info():
114
113
  patterns = ["DISCONNECTED", "WLT_ERROR", "free heap size", "python_mqtt_disconnect"]
115
114
  return "".join([l.strip(' "') for l in open(os.path.join(ARTIFACTS_DIR, CERT_MQTT_LOG_FILE)).readlines() if any([p in l for p in patterns])])
116
115
 
117
- def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), tests=[], error=None, non_cert_run=False):
116
+ def generate_results_files(dut=None, tester=None, html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), tests=[], error=None, non_cert_run=False):
118
117
  print(cert_prints.SEP)
119
118
  duration = (datetime.datetime.now()-start_time)
120
119
  print("Tests duration: {}".format(str(duration).split(".")[0]))
121
120
  pipeline = cert_prints.pipeline_running()
122
- test = tests[-1] if tests else None
123
- if test and test.dut_is_bridge():
124
- print("Bridge version: {}".format(test.dut.version))
121
+ brg = None
122
+ if dut:
123
+ brg = dut.internal_brg if isinstance(dut, cert_utils.Gateway) and dut.has_internal_brg() else dut
124
+ if isinstance(brg, cert_utils.Bridge):
125
+ print("Bridge version: {}".format(brg.version))
125
126
  if not error:
126
127
  print(generate_tests_table(tests))
127
128
  print(tabulate.tabulate([[len(tests), len(tests)-(failures+skipped), skipped, failures, len(tests)]],
128
129
  headers=["FINISHED", "PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="pretty"))
129
130
  print(cert_prints.WIL_CERT_TEXT)
130
131
  cert_prints.print_warn(get_important_tests_info())
131
- print(f"Run artifacts saved in \"{ARTIFACTS_DIR}\" directory")
132
132
  run_type = headline_get(non_cert_run, "").strip()
133
133
  cert_prints.print_pass_or_fail(not failures and not error, run_type)
134
134
 
135
+ # Get internal_brg from dut or tester
136
+ internal_brg = None
137
+ if dut and isinstance(dut, cert_utils.Gateway) and dut.has_internal_brg():
138
+ internal_brg = dut.internal_brg
139
+ elif tester:
140
+ internal_brg = tester.internal_brg
141
+
135
142
  # Generate HTML file
136
143
  if html:
137
144
  file_path = os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_HTML)
@@ -153,8 +160,8 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
153
160
  f.write(update_status + "<br><br>")
154
161
  f.write(error + "<br><br>")
155
162
  f.write(f"{RUN_DUR}: {str(duration).split('.')[0]} <br><br>")
156
- if test and test.dut_is_bridge():
157
- f.write(f"{BRG} {BLE_VER}: {test.dut.version} <br><br>")
163
+ if brg:
164
+ f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
158
165
  elif tests:
159
166
  if not failures and ("successfully!" in update_status or "skipped!" in update_status or not pipeline):
160
167
  headline = headline_get(non_cert_run, "Passed!")
@@ -169,20 +176,12 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
169
176
  f.write(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')} <br><br>")
170
177
  f.write(f"{RUN_DUR}: {str(duration).split('.')[0]} <br><br>")
171
178
  f.write(f"{CERT_VER}: {CERT_VERSION} <br><br>")
172
- if test and test.dut_is_gateway():
173
- f.write(f"{GATEWAY} ID: {test.dut.id_str} <br><br>")
174
- f.write(f"{GATEWAY} {SUP_API_VER}: {test.dut.gw_api_version} <br><br>")
175
- f.write(f"{GATEWAY} {SERIALIZATION_FORMAT}: {PROTOBUF if test.dut.protobuf else JSON} <br><br>")
176
- if test.dut_is_combo():
177
- f.write(f"{BRG} {BLE_MAC_ADDRESS}: {test.dut.internal_brg.id_str} <br><br>")
178
- f.write(f"{BRG} {BLE_VER}: {test.dut.internal_brg.version} <br><br>")
179
- if test.dut_is_bridge():
180
- f.write(f"{BRG} {BLE_MAC_ADDRESS}: {test.dut.id_str} <br><br>")
181
- f.write(f"{BRG} {BLE_VER}: {test.dut.version} <br><br>")
182
- if test.tester:
183
- f.write(f"{SIM} {BLE_MAC_ADDRESS}: {test.tester.internal_brg.id_str} <br><br>")
184
- f.write(f"{SIM} {BLE_VER}: {test.tester.internal_brg.version} <br><br>")
185
-
179
+ if internal_brg:
180
+ f.write(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str} <br><br>")
181
+ f.write(f"{SIM} {BLE_VER}: {internal_brg.version} <br><br>")
182
+ if isinstance(brg, cert_utils.Bridge):
183
+ f.write(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str} <br><br>")
184
+ f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
186
185
  f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
187
186
  f.write(generate_tests_table(tests, html=True))
188
187
  f.write("<br><br>")
@@ -238,33 +237,26 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
238
237
 
239
238
  hdr_page.append(Spacer(1, 20))
240
239
  hdr_page.append(Paragraph(f"<a name='{SUMMARY_HEADLINE}'/><b>{SUMMARY_HEADLINE}</b>", module_header))
241
- hdr_page.append(Spacer(1, 10))
240
+ hdr_page.append(Spacer(1, 20))
242
241
  hdr_page.append(Paragraph(f"<u>{RUN_INFO}:</u>", bold_text_style))
243
242
  hdr_page.append(Paragraph(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')}", bold_text_style))
244
243
  hdr_page.append(Paragraph(f"{RUN_DUR}: {str(duration).split('.')[0]}", bold_text_style))
245
244
  hdr_page.append(Paragraph(f"{CERT_VER}: {CERT_VERSION}", bold_text_style))
246
245
  hdr_page.append(Spacer(1, 10))
247
- if test:
246
+ if brg:
248
247
  hdr_page.append(Paragraph(f"<u>{TESTED_DEVICE_INFO}:</u>", bold_text_style))
249
- if test.dut_is_gateway():
250
- hdr_page.append(Paragraph(f"{GATEWAY} ID: {test.dut.id_str}", bold_text_style))
251
- hdr_page.append(Paragraph(f"{GATEWAY} {SUP_API_VER}: {test.dut.gw_api_version}", bold_text_style))
252
- hdr_page.append(Paragraph(f"{GATEWAY} {SERIALIZATION_FORMAT}: {PROTOBUF if test.dut.protobuf else JSON}", bold_text_style))
253
- if test.dut_is_combo() or test.dut_is_bridge():
254
- brg = test.dut.internal_brg if test.dut_is_combo() else test.dut
255
- hdr_page.append(Paragraph(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str}", bold_text_style))
248
+ hdr_page.append(Paragraph(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str}", bold_text_style))
249
+ if isinstance(brg, cert_utils.Bridge):
256
250
  hdr_page.append(Paragraph(f"{BRG} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[brg.board_type]}", bold_text_style))
257
251
  hdr_page.append(Paragraph(f"{BRG} {BLE_VER}: {brg.version}", bold_text_style))
258
252
  hdr_page.append(Paragraph(f"{BRG} {SUP_API_VER}: {brg.api_version}", bold_text_style))
259
- hdr_page.append(Spacer(1, 10))
260
-
261
- # In wlt-cert-reg there is no tester
262
- if test.tester:
263
- hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
264
- hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {test.tester.internal_brg.id_str}", bold_text_style))
265
- hdr_page.append(Paragraph(f"{SIM} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[test.tester.internal_brg.board_type]}", bold_text_style))
266
- hdr_page.append(Paragraph(f"{SIM} {BLE_VER}: {test.tester.internal_brg.version}", bold_text_style))
267
253
  hdr_page.append(Spacer(1, 10))
254
+ if internal_brg:
255
+ hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
256
+ hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str}", bold_text_style))
257
+ hdr_page.append(Paragraph(f"{SIM} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[internal_brg.board_type]}", bold_text_style))
258
+ hdr_page.append(Paragraph(f"{SIM} {BLE_VER}: {internal_brg.version}", bold_text_style))
259
+ hdr_page.append(Paragraph(f"{SIM} {SUP_API_VER}: {internal_brg.api_version}", bold_text_style))
268
260
  notes_file_path = os.path.join(ARTIFACTS_DIR, RESULT_NOTES_FILE)
269
261
  if os.path.exists(notes_file_path):
270
262
  hdr_page.append(Paragraph(f"<u>{ADD_INFO}:</u>", bold_text_style))
@@ -272,14 +264,14 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
272
264
  for line in f.readlines():
273
265
  hdr_page.append(Paragraph(f"{line}", bold_text_style))
274
266
 
275
- hdr_page.append(Spacer(1, 15))
267
+ hdr_page.append(Spacer(1, 20))
276
268
 
277
269
  # Analyze results per module and generate results per module for PDF
278
270
  results_per_module = generate_results_per_module_for_pdf(tests=tests)
279
271
 
280
272
  # Modules Table
281
273
  hdr_page.append(Paragraph(f"<b>Modules Overview</b>", module_header))
282
- hdr_page.append(Spacer(1, 15))
274
+ hdr_page.append(Spacer(1, 20))
283
275
  modules_overview = get_modules_overview(results_per_module)
284
276
  module_stats_table_data = []
285
277
  for module_name, status in modules_overview.items():
@@ -287,6 +279,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
287
279
  module_stats_table = Table([["Module", "Status"]] + module_stats_table_data, colWidths=[100, 100])
288
280
  module_stats_table.setStyle(inner_table_style('CENTER'))
289
281
  hdr_page.append(module_stats_table)
282
+ hdr_page.append(Spacer(1, 20))
290
283
  hdr_page.append(PageBreak())
291
284
 
292
285
  # Tests Tables
@@ -301,7 +294,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
301
294
  count_table = Table(count_data)
302
295
  count_table.setStyle(inner_table_style('CENTER'))
303
296
  hdr_page.append(count_table)
304
- hdr_page.append(Spacer(1, 10))
297
+ hdr_page.append(Spacer(1, 20))
305
298
 
306
299
  # Tests Results Table
307
300
  summary_data = []
@@ -347,12 +340,8 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
347
340
  import io
348
341
  from botocore.exceptions import ClientError
349
342
 
350
- if test:
351
- device_id = f"{test.dut.id_str}:{test.dut.internal_brg.id_str}" if test.dut_is_combo() else test.dut.id_str
352
- version = test.dut.internal_brg.version if test.dut_is_combo() else test.dut.version
353
- else:
354
- device_id = "NO_ID"
355
- version = "0.0.0"
343
+ device_id = brg.id_str if brg else internal_brg.id_str if internal_brg else "NO_ID"
344
+ version = brg.version if brg else internal_brg.version if internal_brg else "0.0.0"
356
345
  json_data = {
357
346
  "setup_name": os.environ['PIPELINE_NAME'],
358
347
  "device_id": device_id,
certificate/cert_utils.py CHANGED
@@ -26,6 +26,10 @@ ORIGINAL_AG_FILE = "wlt_types_ag.py"
26
26
  TEST_MODULES_MAP = {"calibration": ag.MODULE_CALIBRATION, "datapath": ag.MODULE_DATAPATH, "energy2400": ag.MODULE_ENERGY_2400, "energy_sub1g": ag.MODULE_ENERGY_SUB1G,
27
27
  "pwr_mgmt": ag.MODULE_PWR_MGMT, "sensors": ag.MODULE_EXT_SENSORS, "custom": ag.MODULE_CUSTOM}
28
28
 
29
+ # Used when mac is not really important for the test (e.g: gw_sim) or to randomize pkt data
30
+ def get_random_hex_str(len=12):
31
+ return ''.join([random.choice('0123456789ABCDEF') for i in range(len)])
32
+
29
33
  def module2name(module_id):
30
34
  for k, v in TEST_MODULES_MAP.items():
31
35
  if module_id == v:
@@ -159,22 +163,8 @@ class WltTest:
159
163
 
160
164
  def create_test_phases_and_params(self, line_params):
161
165
  self.params = []
162
- phases_source = []
163
- dynamic_parameters = "dynamic_parameters" in self.test_json[ALL_SUPPORTED_VALUES]
164
- if dynamic_parameters:
165
- self.test_json[ALL_SUPPORTED_VALUES].remove("dynamic_parameters")
166
166
  if len(self.test_json[ALL_SUPPORTED_VALUES]) > 0:
167
- if dynamic_parameters:
168
- if line_params:
169
- phases_source = line_params
170
- elif len(self.test_json[ALL_SUPPORTED_VALUES]) > 0:
171
- phases_source = self.test_json[ALL_SUPPORTED_VALUES]
172
- else:
173
- error = f"ERROR: No dynamic parameters provided for test {self.name}! Check test list file and update the supported values!\n{[f.__dict__ for f in self.phases]}"
174
- handle_error(error, datetime.datetime.now())
175
- else:
176
- phases_source = self.test_json[ALL_SUPPORTED_VALUES]
177
- self.phases = [Phase(PRE_CONFIG)] + [Phase(phase) for phase in phases_source] + [Phase(RESTORE_CONFIG)]
167
+ self.phases = [Phase(PRE_CONFIG)] + [Phase(param) for param in self.test_json[ALL_SUPPORTED_VALUES]] + [Phase(RESTORE_CONFIG)]
178
168
  for param_phase in self.phases:
179
169
  param = Param(param_phase.name)
180
170
  if (param.name in line_params or param.value in [eval_param(p) for p in line_params]):
@@ -318,8 +308,6 @@ class Bridge:
318
308
  self.cfg_hash = interface_pkt.cfg_hash if interface_pkt else cfg_hash
319
309
  self.api_version = interface_pkt.api_version if interface_pkt else api_version
320
310
  if import_defs:
321
- if self.board_type >= len(ag.BOARD_TYPES_LIST):
322
- handle_error(f"ERROR: Unknown board type {self.board_type} for bridge {self.id_str}!", datetime.datetime.now())
323
311
  self.defines_file_name = f'{ag.BOARD_TYPES_LIST[self.board_type]}_defines.cfg'
324
312
  overwrite_dict = {}
325
313
  # Overwrite auto-generated defines for the specific bridge
@@ -400,7 +388,7 @@ def ut_prep_brg(args, start_time, tester, brg_id, tester_flag=False, validation_
400
388
  if args.latest or args.rc:
401
389
  return handle_prep_brg_for_latest(test, interface, brg_id, start_time)
402
390
  elif test.rc == TEST_FAILED:
403
- error = f"ERROR: Didn't get ModuleIfV{test.active_brg.api_version} from BRG:{brg.id_str}!\nCheck that the brg responded with the correct module"
391
+ error = f"ERROR: Didn't get ModuleIfV{test.active_brg.api_version} from BRG:{brg.id_str}!"
404
392
  handle_error(error, start_time)
405
393
  version = f"{interface.major_ver}.{interface.minor_ver}.{interface.patch_ver}"
406
394
  board_type = interface.board_type
@@ -477,7 +465,7 @@ class Gateway:
477
465
 
478
466
  def get_tester_id(tester):
479
467
  if not tester or tester == GW_SIM_PREFIX:
480
- return f"GW_SIM_{get_random_hex_str(12)}"
468
+ return f"GW_SIM_{get_random_hex_str()}"
481
469
  else:
482
470
  # Allow tester to be specified as tester_id:ble_addr
483
471
  if ':' in tester:
@@ -527,16 +515,16 @@ def prep_dut(args, tester, validation_schema, mqttc, start_time, upload_wait_tim
527
515
  # Prepare gateway's internal BRG
528
516
  if brg_flag(validation_schema):
529
517
  dut.internal_brg = ut_prep_brg(args, start_time, tester=test.dut, brg_id=args.combo_ble_addr, validation_schema=validation_schema['modules'])
530
- if dut.internal_brg.api_version < API_OLDEST_SUPPORTED_VERSION:
531
- handle_error(f"ERROR: DUT internal brg FW api_version={dut.internal_brg.api_version} is lower then the oldest supported = {API_OLDEST_SUPPORTED_VERSION}! Please upgrade the internal brg FW!", start_time)
518
+ if dut.internal_brg.api_version != ag.API_VERSION_LATEST:
519
+ handle_error(f"ERROR: Certificate FW api_version={dut.internal_brg.api_version} instead of api_version={ag.API_VERSION_LATEST}! Please upgrade the FW!", start_time)
532
520
  # Return Gateway object
533
521
  return dut
534
522
 
535
523
  elif brg_flag(validation_schema):
536
524
  # Prepare standalone bridge using prepared tester
537
525
  brg = ut_prep_brg(args, start_time, tester=tester, brg_id=args.dut, validation_schema=validation_schema['modules'])
538
- if brg.api_version < API_OLDEST_SUPPORTED_VERSION:
539
- handle_error(f"ERROR: DUT brg FW api_version={brg.api_version} is lower then the oldest supported = {API_OLDEST_SUPPORTED_VERSION}! Please upgrade the brg FW!", start_time)
526
+ if brg.api_version != ag.API_VERSION_LATEST:
527
+ handle_error(f"ERROR: DUT FW api_version={brg.api_version} instead of api_version={ag.API_VERSION_LATEST}!", start_time)
540
528
  return brg
541
529
 
542
530
 
@@ -591,6 +579,10 @@ def prep_tester(args, mqttc, start_time, gw_sim_thread=None):
591
579
 
592
580
  # Prepare tester's internal BRG
593
581
  tester.internal_brg = ut_prep_brg(args, start_time, tester, internal_brg_mac_addr, tester_flag=True, validation_schema=None)
582
+ if gw_sim_thread and tester.internal_brg.version not in TESTER_FW_VERSIONS:
583
+ utPrint(f"ERROR: Certificate FW version={tester.internal_brg.version} instead of versions={TESTER_FW_VERSIONS}!\n"
584
+ f"Please run the command wlt-cert-tester-upgrade to upgrade the tester firmware!", "RED")
585
+ handle_error("ERROR: Tester FW version mismatch!", start_time)
594
586
  # Return Gateway object
595
587
  return tester
596
588
 
@@ -621,7 +613,6 @@ def prep_gw_info_action(test, start_time, brg_flag, target):
621
613
  gw.gw_version = {BLE_VERSION : info[BLE_VERSION], WIFI_VERSION : info[WIFI_VERSION]}
622
614
  if brg_flag and BLE_MAC_ADDR in info:
623
615
  internal_brg_mac_addr = info[BLE_MAC_ADDR]
624
- # For internal use only in versions update test
625
616
  if GW_API_VERSION in info:
626
617
  gw.gw_api_version = info[GW_API_VERSION]
627
618
 
@@ -51,11 +51,6 @@ def skip_test_check(test, validation_schema):
51
51
  skip_string = f"Skipped {test.module_name} because it can run only with Gateway or Combo devices"
52
52
  elif BRIDGE_ONLY_TEST in test.test_json and test.test_json[BRIDGE_ONLY_TEST] and not test.dut_is_bridge():
53
53
  skip_string = f"Skipped {test.module_name} because it can run only with Bridge devices without Gateway functionality"
54
- elif SUPPORTED_FROM_API_VERSION in test.test_json:
55
- if test.test_json[MODULE] == "Cloud Connectivity" and test.dut_is_gateway() and int(test.dut.gw_api_version) < test.test_json[SUPPORTED_FROM_API_VERSION]:
56
- skip_string = f"Skipped {test.module_name} because it is supported from api version {test.test_json[SUPPORTED_FROM_API_VERSION]} and dut api version is {test.dut.gw_api_version}"
57
- elif test.test_json[MODULE] != "Cloud Connectivity" and test.active_brg.api_version < test.test_json[SUPPORTED_FROM_API_VERSION]:
58
- skip_string = f"Skipped {test.module_name} because it is supported from api version {test.test_json[SUPPORTED_FROM_API_VERSION]} and dut api version is {test.active_brg.api_version}"
59
54
  if skip_string:
60
55
  utPrint(f"{SEP}{skip_string}{SEP}", "WARNING")
61
56
  test.reason = skip_string
@@ -106,12 +101,11 @@ def main(args):
106
101
 
107
102
  utPrint(f"wiliot_certificate version: {CERT_VERSION}")
108
103
  utPrint(str(args.__dict__))
104
+ os.makedirs(ARTIFACTS_DIR, exist_ok=True)
109
105
  start_time = datetime.datetime.now()
110
106
 
111
107
  # Clean
112
108
  clean(args)
113
- # Create artifacts dir
114
- os.makedirs(ARTIFACTS_DIR, exist_ok=True)
115
109
 
116
110
  # Filter tests
117
111
  test_list = TEST_LIST_FW_UPDATE_FILE if args.latest or args.rc else args.tl
@@ -136,9 +130,9 @@ def main(args):
136
130
  # Run Gateway Simulator in separate thread
137
131
  gw_sim_thread = threading.Thread(target=cert_gw_sim.gw_sim_run, daemon=True, kwargs={'port':args.port, 'gw_id': args.tester,
138
132
  'custom_broker':args.custom_broker,
139
- 'disable_interference_analyzer':args.disable_interference_analyzer})
133
+ 'analyze_interference':args.analyze_interference})
140
134
  gw_sim_thread.start()
141
- sleep_time = (len(cert_gw_sim.CHANNELS_TO_ANALYZE) * 30) + 15 if not args.disable_interference_analyzer else 10
135
+ sleep_time = (len(cert_gw_sim.CHANNELS_TO_ANALYZE) * 30) + 15 if args.analyze_interference else 10
142
136
  time.sleep(sleep_time)
143
137
  tester = cert_utils.prep_tester(args, tester_mqttc, start_time, gw_sim_thread)
144
138
 
@@ -188,13 +182,12 @@ def main(args):
188
182
  print(f"Test Duration: {test.duration}")
189
183
  print(tabulate.tabulate([[i+1, i+1-(failures+skipped), skipped, failures, len(tests)]],
190
184
  headers=["FINISHED", "PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="pretty"))
191
- if test.rc != TEST_SKIPPED:
192
- wait_time_n_print(2)
185
+ wait_time_n_print(2)
193
186
  if exit_on_test_failure and test.rc == TEST_FAILED:
194
187
  break
195
188
 
196
189
  # Print results
197
- cert_results.generate_results_files(html=True, pdf=True, failures=failures, skipped=skipped, start_time=start_time, tests=tests, non_cert_run=args.non_cert_run)
190
+ cert_results.generate_results_files(test.dut, test.tester, html=True, pdf=True, failures=failures, skipped=skipped, start_time=start_time, tests=tests, non_cert_run=args.non_cert_run)
198
191
  if not pipeline_running():
199
192
  webbrowser.open('file://' + os.path.realpath(os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_PDF)))
200
193
 
@@ -24,23 +24,25 @@ class CertificateCLI:
24
24
  description='Certificate - CLI Tool to test Wiliot Devices',
25
25
  epilog=
26
26
  "run examples:\n"
27
- " Run command example with COM PORT tester:\n"
28
- " wlt-cert-cli --tester SIM --dut <XXXXXXXXXXXX> --port <COM_PORT>\n"
29
- " Run command example with remote GW tester:\n"
30
- " wlt-cert-cli --tester <YYYYYYYYYYYY> --dut <XXXXXXXXXXXX>\n"
27
+ " Run command example with COM PORT connection:\n"
28
+ " wlt-cert-cli --gw SIM --brg <XXXXXXXXXXXX> --port <COM_PORT>\n"
29
+ " Run command example with remote GW connection:\n"
30
+ " wlt-cert-cli --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX>\n"
31
31
  " Run command example for running datapath module tests only:\n"
32
- " wlt-cert-cli --tester <YYYYYYYYYYYY> --dut <XXXXXXXXXXXX> --run datapath\n"
32
+ " wlt-cert-cli --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX> --run datapath\n"
33
33
  " Run command example with sanity test list:\n"
34
- " wlt-cert-cli --tester <YYYYYYYYYYYY> --dut <XXXXXXXXXXXX> --tl certificate_sanity_test_list.txt\n"
35
- " Run command example with COM PORT tester for combo device:\n"
36
- " wlt-cert-cli --tester SIM --dut <XXXXXXXXXXXX>:<YYYYYYYYYYYY> --port <COM_PORT>\n",
34
+ " wlt-cert-cli --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX> --tl certificate_sanity_test_list.txt\n"
35
+ " Run command example with COM PORT connection for bridge with cloud connectivity:\n"
36
+ " wlt-cert-cli --gw SIM --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt --port <COM_PORT>\n"
37
+ " Run command example with remote GW connection for bridge with cloud connectivity:\n"
38
+ " wlt-cert-cli --gw <YYYYYYYYYYYY> --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt\n",
37
39
  formatter_class=argparse.RawDescriptionHelpFormatter
38
40
  )
39
41
  self.parser.add_argument('--validation_schema', '-vs', required=True, help='Validation schema json file path to use for the run')
40
42
  self.parser.add_argument('--dut', required=True, help="Tested device ID. When DUT is a combo device, use <Gateway_ID>:<BLE_MAC>")
41
43
  self.parser.add_argument('--combo_ble_addr', default="", help="Combo device BLE MAC address" + argparse.SUPPRESS)
42
44
  self.parser.add_argument('--tester', default=GW_SIM_PREFIX, help='Tester id to run on the test, SIM prefix is default and used for COM tester')
43
- self.parser.add_argument('--port', '-p', default='', help='UART PORT connection to use for the run, if not provided tries to scan for tester port')
45
+ self.parser.add_argument('--port', '-p', default='', help='UART PORT connection to use for the run, if not provided last available port is used')
44
46
  self.parser.add_argument('--custom_broker', '-cb', required=True, help='Choose custom MQTT broker configuration json file to use for the run,' \
45
47
  ' for explanation of the format see https://community.wiliot.com/customers/s/article/Wiliot-Gateway-Certification')
46
48
  self.parser.add_argument('--clean', default=False, action='store_true', help='Clean old logs before running the tests')
@@ -50,7 +52,8 @@ class CertificateCLI:
50
52
  self.parser.add_argument('--exit_on_test_failure', default=False, action='store_true', help='Stop running the tests if a test failed ' + argparse.SUPPRESS)
51
53
  self.parser.add_argument('--exit_on_param_failure', default=False, action='store_true', help='Sets exit_on_param_failure mode to true in order to prevent \
52
54
  tests from continuing iteration over all possibilities in case of failure ' + argparse.SUPPRESS)
53
- self.parser.add_argument('--disable_interference_analyzer', '-dia', default=False, action='store_true', help='Disable interference analysis before tests')
55
+ self.parser.add_argument('--analyze_interference', '-ai', default=False, action='store_true', help='Analyze interference before tests start \
56
+ (relevant only for Gateway Simulator)')
54
57
  self.parser.add_argument('--unsterile_run', '-ur', default=False, action='store_true',
55
58
  help="Set unsterile run mode for the run if there are pixels or energizing devices nearby")
56
59
  self.parser.add_argument("--overwrite_defaults", '-od', type=parse_dict_arg, help='Manually overwrite default defines for the bridge (key1=value1,key2=value2...)')
@@ -22,7 +22,6 @@ energy2400/output_power_test OUTPUT_POWER_2_4_MAX_MINUS_26 OUTPUT_POWER_2_4_MAX_
22
22
  energy2400/duty_cycle_test 1 25 50 75
23
23
  energy2400/signal_indicator_test rssi_threshold rx tx_eu_pattern disable_rx disable_tx rx_tx
24
24
  energy2400/signal_indicator_ble5_test rssi_threshold rx tx disable_rx disable_tx rx_tx
25
- energy2400/signal_indicator_ext_adv_test ext_adv_rx37 ext_adv_rx10
26
25
 
27
26
  # ------------- energy_sub1g -------------
28
27
  energy_sub1g/pattern_test SUB1G_ENERGY_PATTERN_NO_ENERGIZING SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000 SUB1G_ENERGY_PATTERN_FCC_HOPPING SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500 SUB1G_ENERGY_PATTERN_NZ_HOPPING
@@ -49,7 +48,7 @@ datapath/rx_rate_gen2_test mid_values diff_pacer min_value max_value diff_rate
49
48
  datapath/rx_rate_gen3_test mid_values diff_pacer min_value max_value diff_rate
50
49
  datapath/stress_test rep3 rep2 rep1
51
50
  datapath/stress_gen3_test rep3 rep2 rep1
52
- datapath/num_of_tags_test 2500
51
+ datapath/num_of_tags_test 5000
53
52
 
54
53
  # ------------- pwr_mgmt -------------
55
54
  pwr_mgmt/pwr_mgmt_test
@@ -68,8 +67,8 @@ cloud_connectivity/uplink_test mgmt_pkt pixels_pkt sensor_pkt
68
67
  cloud_connectivity/downlink_test
69
68
  cloud_connectivity/uplink_ext_adv_test
70
69
  cloud_connectivity/reboot_test
71
- cloud_connectivity/stress_test
72
- cloud_connectivity/ext_adv_stress_test
70
+ cloud_connectivity/stress_test 20 40 60 80 100 120 140 160 180 200 222 250 285 333
71
+ cloud_connectivity/ext_adv_stress_test 20 40 60 80 100 120 140 160 180 200
73
72
  cloud_connectivity/channel_scan_behaviour_test
74
73
  cloud_connectivity/acl_test deny allow
75
74
  cloud_connectivity/acl_ext_adv_test deny allow
@@ -22,7 +22,6 @@ energy2400/output_power_test OUTPUT_POWER_2_4_MAX_MINUS_14 OUTPUT_POWER_2_4_MAX_
22
22
  energy2400/duty_cycle_test 1 50 75
23
23
  energy2400/signal_indicator_test rx_tx
24
24
  energy2400/signal_indicator_ble5_test rx_tx
25
- energy2400/signal_indicator_ext_adv_test ext_adv_rx37
26
25
 
27
26
  # ------------- energy_sub1g -------------
28
27
  energy_sub1g/pattern_test SUB1G_ENERGY_PATTERN_NO_ENERGIZING SUB1G_ENERGY_PATTERN_FCC_HOPPING SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500 SUB1G_ENERGY_PATTERN_NZ_HOPPING
@@ -60,7 +59,7 @@ cloud_connectivity/uplink_test mgmt_pkt pixels_pkt
60
59
  cloud_connectivity/downlink_test
61
60
  cloud_connectivity/uplink_ext_adv_test
62
61
  cloud_connectivity/reboot_test
63
- cloud_connectivity/stress_test
64
- cloud_connectivity/ext_adv_stress_test
62
+ cloud_connectivity/stress_test 100 222
63
+ cloud_connectivity/ext_adv_stress_test 20 100
65
64
  cloud_connectivity/acl_test deny
66
65
  cloud_connectivity/acl_ext_adv_test allow
@@ -22,7 +22,7 @@ energy2400/output_power_test OUTPUT_POWER_2_4_MAX_MINUS_26 OUTPUT_POWER_2_4_MAX_
22
22
  energy2400/duty_cycle_test 1 25 50 75
23
23
  energy2400/signal_indicator_test rssi_threshold rx tx_eu_pattern disable_rx disable_tx rx_tx
24
24
  energy2400/signal_indicator_ble5_test rssi_threshold rx tx disable_rx disable_tx rx_tx
25
- energy2400/signal_indicator_ext_adv_test ext_adv_rx37 ext_adv_rx10
25
+ #energy2400/signal_indicator_ext_adv_test rssi_threshold brg0_tx_brg1_rx brg0_rxtx_brg1_rxtx
26
26
 
27
27
  # ------------- energy_sub1g -------------
28
28
  energy_sub1g/pattern_test SUB1G_ENERGY_PATTERN_NO_ENERGIZING SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000 SUB1G_ENERGY_PATTERN_FCC_HOPPING SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500 SUB1G_ENERGY_PATTERN_NZ_HOPPING
@@ -49,7 +49,7 @@ datapath/rx_rate_gen2_test mid_values diff_pacer min_value max_value diff_rate
49
49
  datapath/rx_rate_gen3_test mid_values diff_pacer min_value max_value diff_rate
50
50
  datapath/stress_test rep3 rep2 rep1
51
51
  datapath/stress_gen3_test rep3 rep2 rep1
52
- datapath/num_of_tags_test 4500
52
+ datapath/num_of_tags_test 5000
53
53
 
54
54
  # ------------- pwr_mgmt -------------
55
55
  pwr_mgmt/pwr_mgmt_test
@@ -67,8 +67,8 @@ cloud_connectivity/uplink_test mgmt_pkt pixels_pkt sensor_pkt geolocation
67
67
  cloud_connectivity/downlink_test
68
68
  cloud_connectivity/uplink_ext_adv_test
69
69
  cloud_connectivity/reboot_test
70
- cloud_connectivity/stress_test
71
- cloud_connectivity/ext_adv_stress_test
70
+ cloud_connectivity/stress_test 20 40 60 80 100 120 140 160 180 200 222 250 285 333
71
+ cloud_connectivity/ext_adv_stress_test 20 40 60 80 100 120 140 160 180 200
72
72
  cloud_connectivity/channel_scan_behaviour_test
73
73
  cloud_connectivity/acl_test deny allow
74
74
  cloud_connectivity/acl_ext_adv_test deny allow
@@ -10,6 +10,5 @@
10
10
  "multiBridgeTest": 0,
11
11
  "gwOnlyTest": 0,
12
12
  "dataSimOnlyTest": 0,
13
- "SupportedFromApiVersion": 12,
14
13
  "allSupportedValues": [10, 25, 50, 100, 255]
15
14
  }
@@ -12,7 +12,6 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 0,
15
- "SupportedFromApiVersion": 13,
16
15
  "allSupportedValues": ["OUTPUT_POWER_2_4_MAX", "OUTPUT_POWER_2_4_MAX_MINUS_2", "OUTPUT_POWER_2_4_MAX_MINUS_3",
17
16
  "OUTPUT_POWER_2_4_MAX_MINUS_4", "OUTPUT_POWER_2_4_MAX_MINUS_6", "OUTPUT_POWER_2_4_MAX_MINUS_7",
18
17
  "OUTPUT_POWER_2_4_MAX_MINUS_8", "OUTPUT_POWER_2_4_MAX_MINUS_10", "OUTPUT_POWER_2_4_MAX_MINUS_11",
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 0,
15
- "SupportedFromApiVersion": 12,
16
15
  "allSupportedValues": ["CALIBRATION_PATTERN_STANDARD", "CALIBRATION_PATTERN_38_38_39", "CALIBRATION_PATTERN_EU_PATTERN", "CALIBRATION_PATTERN_DISABLE_BEACON"]
17
16
  }
@@ -10,6 +10,5 @@
10
10
  "multiBridgeTest": 0,
11
11
  "gwOnlyTest": 1,
12
12
  "dataSimOnlyTest": 1,
13
- "SupportedFromApiVersion": 206,
14
13
  "allSupportedValues": ["deny", "allow"]
15
14
  }
@@ -10,6 +10,5 @@
10
10
  "multiBridgeTest": 0,
11
11
  "gwOnlyTest": 1,
12
12
  "dataSimOnlyTest": 1,
13
- "SupportedFromApiVersion": 205,
14
13
  "allSupportedValues": ["deny", "allow"]
15
14
  }
@@ -8,7 +8,7 @@ import certificate.cert_data_sim as cert_data_sim
8
8
  from certificate.ag.wlt_types_ag import *
9
9
 
10
10
  SCAN_TIMEOUT = 30
11
- NUM_OF_BRGS = 4
11
+
12
12
  # DEFINES
13
13
  test_indicator = cert_data_sim.PIXEL_SIM_INDICATOR
14
14
 
@@ -20,11 +20,11 @@ def run(test):
20
20
  return cert_common.test_epilog(test)
21
21
 
22
22
  # Generate management and data packets
23
- bridge_ids = [cert_common.hex2alias_id_get(get_random_hex_str(12)) for _ in range(NUM_OF_BRGS)]
24
- pixels_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=20, num_of_brgs=NUM_OF_BRGS, brgs_list=bridge_ids,
25
- pkt_type=PIXELS_PKT, indicator=test_indicator)
23
+ bridge_ids = []
24
+ pixels_pkts, bridge_ids = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=20, num_of_brgs=4,
25
+ pkt_type=PIXELS_PKT, indicator=test_indicator)
26
26
 
27
- mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS, brgs_list=bridge_ids,
27
+ mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=4, brgs_list=bridge_ids,
28
28
  pkt_type=MGMT_PKT, indicator=test_indicator)
29
29
  # Use first 3 bridges for ACL, 4th bridge is not in ACL
30
30
  acl_bridge_ids = bridge_ids[:3]
@@ -41,7 +41,7 @@ def run(test):
41
41
  cfg = cert_config.get_default_gw_dict(test)
42
42
  cfg[ACL][ACL_BRIDGE_IDS] = acl_bridge_ids
43
43
  cfg[ACL][ACL_MODE] = param.value
44
- test, _ = cert_config.gw_configure(test, cfg=cfg, wait=True)
44
+ test, ret = cert_config.gw_configure(test, cfg=cfg, wait=True)
45
45
  print_update_wait(1)
46
46
 
47
47
  test.get_mqttc_by_target(DUT).flush_pkts()
@@ -51,8 +51,8 @@ def run(test):
51
51
  # Analyze pass/fail
52
52
  # Get all received packets with the test indicator and filter packets by bridge IDs in ACL list
53
53
  received_pkts = cert_mqtt.get_unified_data_pkts(test, only_active_brg=False, indicator=test_indicator)
54
- acl_bridge_pkts = [pkt for pkt in received_pkts if any([id in pkt[PAYLOAD] for id in acl_bridge_ids])]
55
- non_acl_bridge_pkts = [pkt for pkt in received_pkts if non_acl_bridge_id in pkt[PAYLOAD]]
54
+ acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in acl_bridge_ids]
55
+ non_acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in non_acl_bridge_id]
56
56
 
57
57
  # In deny mode - we want to make sure bridges in ACL list are filtered
58
58
  if param.value == ACL_DENY:
@@ -71,18 +71,20 @@ def run(test):
71
71
  test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not on the allow list "
72
72
  f"and {len(non_acl_bridge_pkts)} packets were found from it")
73
73
  # Check that we received packets from all expected bridges
74
- received_alias_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
75
- if len(received_alias_bridge_ids) != len(acl_bridge_ids):
74
+ received_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
75
+ if received_bridge_ids != set(acl_bridge_ids):
76
76
  test.rc = TEST_FAILED
77
77
  test.add_reason("Phase failed! Didn't receive packets from all bridges that were on the allow list")
78
78
 
79
79
  # Check that management packets are received from all bridges (ACL doesn't filter mgmt packets)
80
80
  all_mgmt_pkts = cert_mqtt.get_all_mgmt_pkts(test.get_mqttc_by_target(DUT), indicator=test_indicator)
81
- mgmt_alias_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
81
+ mgmt_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
82
82
 
83
- if len(mgmt_alias_bridge_ids) != NUM_OF_BRGS:
83
+ if not set(bridge_ids).issubset(mgmt_bridge_ids):
84
84
  test.rc = TEST_FAILED
85
- test.add_reason("Phase failed! Didn't receive management packets from all bridges")
85
+ missing_bridges = set(bridge_ids) - mgmt_bridge_ids
86
+ test.add_reason(f"Phase failed! Expected management packets from all bridges, "
87
+ f"whether they are on the ACL or not, but missing from BRG {missing_bridges}")
86
88
 
87
89
  field_functionality_pass_fail_print(test, "ACL", value=param.value)
88
90
  test.set_phase_rc(param.name, test.rc)
@@ -9,11 +9,10 @@
9
9
  "Analyze if bridge was upgraded and action status message was uploaded",
10
10
  "Test epilog"],
11
11
  "expectedOutcome": "Tester brg advertises ModuleIF packet with the new version and DUT Gateway publish an actionStatus message indicating success and within timeout",
12
- "mandatory": 0,
12
+ "mandatory": 1,
13
13
  "multiBridgeTest": 0,
14
14
  "gwOnlyTest": 1,
15
15
  "internalBridge": 1,
16
- "SupportedFromApiVersion": 203,
17
16
  "allSupportedValues": []
18
17
 
19
18
  }
@@ -3,13 +3,11 @@ from certificate.cert_prints import *
3
3
  from certificate.cert_defines import *
4
4
  from certificate.wlt_types import *
5
5
  from certificate.cert_utils import TESTER_FW_VERSIONS
6
- import certificate.cert_gw_sim as cert_gw_sim
6
+ from certificate.cert_gw_sim import STOP_ADVERTISING, GW_SIM_RESET_TS
7
7
  import certificate.cert_common as cert_common
8
8
  import certificate.cert_config as cert_config
9
9
  import certificate.cert_mqtt as cert_mqtt
10
10
 
11
- BRG_OTA_HIGH_TIMEOUT = (60 * 10)
12
-
13
11
 
14
12
  def run(test):
15
13
  test = cert_common.test_prolog(test)
@@ -24,18 +22,18 @@ def run(test):
24
22
  desired_ver = TESTER_FW_VERSIONS[0] if target_brg.version != TESTER_FW_VERSIONS[0] else TESTER_FW_VERSIONS[1]
25
23
 
26
24
  # Initiate action
27
- utPrint(f"Publishing OTA action to DUT: {test.dut.mqttc.update_topic}. Awaiting OTA.. (timeout is {BRG_OTA_HIGH_TIMEOUT} seconds)")
25
+ utPrint(f"Publishing OTA action to DUT: {test.dut.mqttc.update_topic}. Awaiting OTA.. (timeout is {VER_UPDATE_TIMEOUT} minutes)")
28
26
  # Set active_brg to be the tester, for reboot_config_analysis within brg_ota
29
27
  test.active_brg = target_brg
30
- test = cert_config.brg_ota(test, ble_version=desired_ver, search_ack=True, target=TESTER, upgrader=DUT, timeout=BRG_OTA_HIGH_TIMEOUT)
28
+ test = cert_config.brg_ota(test, ble_version=desired_ver, search_ack=True, target=TESTER, upgrader=DUT)
31
29
 
32
30
  # Stop advertising on tester in case it just rebooted after getting OTA. So it is ready for next tests
33
- cert_config.gw_action(test, cert_gw_sim.STOP_ADVERTISING, target=TESTER)
31
+ cert_config.gw_action(test, STOP_ADVERTISING, target=TESTER)
34
32
 
35
33
  cert_mqtt.generate_log_file(test, "brg_ota")
36
34
 
37
- if test.rc == TEST_PASSED and cert_gw_sim.GW_SIM_RESET_TS is not None:
38
- reboot_pkt_time = int((cert_gw_sim.GW_SIM_RESET_TS - test.start_time).total_seconds())
35
+ if test.rc == TEST_PASSED and GW_SIM_RESET_TS is not None:
36
+ reboot_pkt_time = int((GW_SIM_RESET_TS - test.start_time).total_seconds())
39
37
  test.reason = f"Reboot pkt received after {reboot_pkt_time} seconds"
40
38
 
41
39
  return cert_common.test_epilog(test)
@@ -14,6 +14,5 @@
14
14
  "gwOnlyTest": 1,
15
15
  "dataSimOnlyTest": 1,
16
16
  "internalBridge": 1,
17
- "SupportedFromApiVersion": 203,
18
17
  "allSupportedValues": []
19
18
  }