wiliot-certificate 1.4.0a2__py3-none-any.whl → 1.5.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. brg_certificate/ag/energous_v0_defines.py +12 -12
  2. brg_certificate/ag/energous_v1_defines.py +12 -12
  3. brg_certificate/ag/energous_v2_defines.py +12 -12
  4. brg_certificate/ag/energous_v3_defines.py +12 -12
  5. brg_certificate/ag/energous_v4_defines.py +12 -12
  6. brg_certificate/ag/fanstel_lan_v0_defines.py +12 -12
  7. brg_certificate/ag/fanstel_lte_v0_defines.py +12 -12
  8. brg_certificate/ag/fanstel_wifi_v0_defines.py +12 -12
  9. brg_certificate/ag/minew_lte_v0_defines.py +12 -12
  10. brg_certificate/ag/wlt_cmd_if.html +1 -1
  11. brg_certificate/ag/wlt_types.html +3 -3
  12. brg_certificate/ag/wlt_types_ag.py +12 -12
  13. brg_certificate/brg_certificate.py +9 -6
  14. brg_certificate/cert_common.py +21 -13
  15. brg_certificate/cert_config.py +1 -1
  16. brg_certificate/cert_defines.py +21 -3
  17. brg_certificate/cert_gw_sim.py +6 -4
  18. brg_certificate/cert_mqtt.py +8 -2
  19. brg_certificate/cert_prints.py +7 -5
  20. brg_certificate/cert_protobuf.py +5 -1
  21. brg_certificate/cert_results.py +99 -69
  22. brg_certificate/cert_utils.py +10 -14
  23. brg_certificate/restore_brg.py +2 -0
  24. brg_certificate/tests/calibration/interval_test/interval_test.py +1 -1
  25. brg_certificate/tests/calibration/output_power_test/output_power_test.py +1 -1
  26. brg_certificate/tests/calibration/pattern_test/pattern_test.py +1 -1
  27. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +4 -4
  28. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +2 -2
  29. brg_certificate/tests/datapath/output_power_test/output_power_test.py +1 -1
  30. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +1 -1
  31. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +2 -2
  32. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +1 -1
  33. brg_certificate/tests/datapath/pattern_test/pattern_test.py +1 -1
  34. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +1 -1
  35. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +1 -1
  36. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +1 -1
  37. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +1 -1
  38. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +1 -1
  39. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  40. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +1 -1
  41. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +2 -2
  42. brg_certificate/tests/datapath/stress_test/stress_test.py +2 -2
  43. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +1 -1
  44. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +1 -1
  45. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +4 -4
  46. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +1 -1
  47. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.py +1 -1
  48. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +1 -1
  49. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +1 -1
  50. brg_certificate/tests/edge_mgmt/stat_test/stat_test.py +1 -1
  51. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +1 -1
  52. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +1 -1
  53. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +1 -1
  54. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +1 -1
  55. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +1 -1
  56. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +1 -1
  57. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +1 -1
  58. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +1 -1
  59. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +1 -1
  60. brg_certificate/wltPb_pb2.py +50 -38
  61. brg_certificate/wltPb_pb2.pyi +32 -32
  62. brg_certificate/wlt_types.py +4 -6
  63. common/wlt_logo.png +0 -0
  64. gw_certificate/ag/ut_defines.py +4 -1
  65. gw_certificate/cert_results.py +138 -0
  66. gw_certificate/gw_certificate.py +20 -6
  67. gw_certificate/interface/mqtt.py +1 -0
  68. gw_certificate/tests/actions.py +0 -1
  69. gw_certificate/tests/connection.py +1 -1
  70. gw_certificate/tests/generic.py +43 -17
  71. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/METADATA +6 -4
  72. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/RECORD +76 -74
  73. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/top_level.txt +1 -0
  74. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/LICENSE +0 -0
  75. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/WHEEL +0 -0
  76. {wiliot_certificate-1.4.0a2.dist-info → wiliot_certificate-1.5.0a1.dist-info}/entry_points.txt +0 -0
@@ -3,15 +3,15 @@ import tabulate
3
3
  import subprocess
4
4
  from reportlab.lib import colors
5
5
  from reportlab.lib.pagesizes import letter
6
- from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer
7
- from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
6
+ from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, PageBreak, KeepTogether, Image
7
+ from reportlab.lib.styles import ParagraphStyle
8
8
  from reportlab.lib.enums import TA_CENTER, TA_LEFT
9
9
 
10
10
  # Local imports
11
11
  import brg_certificate.cert_utils as cert_utils
12
12
  import brg_certificate.cert_prints as cert_prints
13
13
  from brg_certificate.cert_defines import BASE_DIR
14
- from brg_certificate.cert_defines import TEST_FAILED, TEST_SKIPPED, TEST_PASSED, TEST_INIT, UT_RESULT_FILE_HTML, UT_RESULT_FILE_PDF
14
+ from brg_certificate.cert_defines import CERT_VERSION, TEST_FAILED, TEST_SKIPPED, TEST_PASSED, TEST_INIT, UT_RESULT_FILE_HTML, UT_RESULT_FILE_PDF
15
15
 
16
16
 
17
17
  ##################################
@@ -32,7 +32,7 @@ class TestResult:
32
32
  return self.name
33
33
 
34
34
  def generate_tests_table(tests=[], html=False):
35
- headers = ["Module", "Test Name", "Device", "Result & Reason Breakdown", "Result", "Run Time"]
35
+ headers = ["Module", "Test Name", "Device", "Result Breakdown", "Result", "Run Time"]
36
36
  inner_format = "unsafehtml" if html else "simple"
37
37
  _pass_or_fail = pass_or_fail_html if html else pass_or_fail
38
38
  tests_results = []
@@ -40,7 +40,7 @@ def generate_tests_table(tests=[], html=False):
40
40
  brgs_to_print = (test.gw if not test.brg0 or test.gw_only else
41
41
  (f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
42
42
  inner_table = [[phase.name, _pass_or_fail(phase), phase.reason] for phase in test.phases]
43
- result_breakdown_table = tabulate.tabulate(inner_table, headers=["Phase", "Result", "Reason"], tablefmt=inner_format)
43
+ result_breakdown_table = tabulate.tabulate(inner_table, headers=["Phase", "Result", "Notes"], tablefmt=inner_format)
44
44
  tests_results.append([cert_utils.module2name(test.test_module),
45
45
  test.module_name if (not test.internal_brg or "gw" in test.module_name) else f"{test.module_name} (internal brg)",
46
46
  brgs_to_print,
@@ -66,15 +66,15 @@ def get_update_status_from_log_file(log_file="update_log.txt"):
66
66
  elif "ota_test failed!" in l:
67
67
  update_status = "BRG OTA failed!"
68
68
  break
69
- elif "Wiliot UT PASSED!" in l:
69
+ elif "PASSED!" in l:
70
70
  update_status = "GW and BRG versions were updated to latest successfully!"
71
71
  break
72
- elif "Update skipped!" in l:
72
+ elif "SKIPPED!" in l:
73
73
  update_status = "GW and BRG versions update skipped!"
74
74
  break
75
75
  return update_status
76
76
 
77
- def generate_results_files(html=True, pdf=True, failures=0, skipped=0, duration=0, brg_version='', tests=[], error=None, pipeline=False):
77
+ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=0, duration=0, brg='', brg_version='', gw_ble_version = '', gw_ble_mac='', tests=[], error=None, pipeline=False):
78
78
  # Generate HTML file
79
79
  if html:
80
80
  f = open(os.path.join(BASE_DIR, UT_RESULT_FILE_HTML), "w", encoding="utf-8")
@@ -85,7 +85,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, duration=
85
85
  stdout=subprocess.PIPE, shell=True, cwd=os.environ['BITBUCKET_CLONE_DIR'])
86
86
  output, err = p.communicate()
87
87
  if error:
88
- f.write("<br><h1 style='color:#ab0000'>Wiliot UT Failed!</h1><br>")
88
+ f.write("<br><h1 style='color:#ab0000'>Wiliot Certificate Error!</h1><br>")
89
89
  if pipeline:
90
90
  f.write("<hr>" + output.decode("utf-8") + "<br>")
91
91
  f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
@@ -96,19 +96,26 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, duration=
96
96
  f.write("Bridge version: {} <br><br>".format(brg_version))
97
97
  elif tests:
98
98
  if not failures and ("successfully!" in update_status or "skipped!" in update_status or not pipeline):
99
- f.write("<br><h1 style='color:#00AB83'>Wiliot UT Passed!</h1>")
99
+ f.write("<br><h1 style='color:#00AB83'>Wiliot Certificate Passed!</h1>")
100
100
  else:
101
- f.write("<br><h1 style='color:#ab0000'>Wiliot UT Failed!</h1>")
101
+ f.write("<br><h1 style='color:#ab0000'>Wiliot Certificate Failed!</h1>")
102
102
  if pipeline:
103
103
  f.write("<hr>" + output.decode("utf-8") + "<br>")
104
104
  f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
105
105
  f.write(update_status + "<br><br>")
106
+ f.write("Run date: {} <br><br>".format(start_time.strftime('%d/%m/%Y, %H:%M:%S')))
106
107
  f.write("Tests duration: {} <br><br>".format(str(duration).split(".")[0]))
108
+ f.write("Certificate version: {} <br><br>".format(CERT_VERSION))
109
+ if gw_ble_mac:
110
+ f.write("BLE simulator mac: {} <br><br>".format(gw_ble_mac))
111
+ if gw_ble_version:
112
+ f.write("BLE simulator version: {} <br><br>".format(gw_ble_version))
113
+ f.write("Tested bridge ID: {} <br><br>".format(brg))
107
114
  if brg_version:
108
115
  f.write("Bridge version: {} <br><br>".format(brg_version))
109
- f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
110
- f.write(generate_tests_table(tests, html=True))
111
- f.write("<br><br>")
116
+ f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
117
+ f.write(generate_tests_table(tests, html=True))
118
+ f.write("<br><br>")
112
119
  if pipeline:
113
120
  f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/pipelines/results/{}'>Build's page and artifacts on bitbucket</a></p><br><br>".format(os.environ['BITBUCKET_BUILD_NUMBER']))
114
121
  f.write("<img src='https://www.wiliot.com/src/img/svg/logo.svg' width='100' height='40' alt='Wiliot logo'>")
@@ -118,59 +125,79 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, duration=
118
125
  # Generate PDF file
119
126
  if pdf:
120
127
  doc = SimpleDocTemplate(os.path.join(BASE_DIR, UT_RESULT_FILE_PDF), pagesize=letter)
121
- styles = getSampleStyleSheet()
122
- elements = []
123
- update_status = get_update_status_from_log_file()
128
+ doc.title = "Wiliot Certificate Results"
129
+ elements, hdr_page = [], []
130
+
131
+ # Add Wiliot Logo
132
+ img = Image(os.path.join(BASE_DIR, "../common", "wlt_logo.png"), width=100, height=40) # Adjust size as needed
133
+ hdr_page.append(img)
134
+ hdr_page.append(Spacer(1, 20))
124
135
 
125
136
  # Title and Summary
126
137
  red_header = STYLES_PDF.get("RED_HEADER", ParagraphStyle("Default"))
127
138
  green_header = STYLES_PDF.get("GREEN_HEADER", ParagraphStyle("Default"))
128
139
  module_header = STYLES_PDF.get("MODULE_HEADER", ParagraphStyle("Default"))
129
140
  test_header = STYLES_PDF.get("TEST_HEADER", ParagraphStyle("Default"))
141
+ text_style = STYLES_PDF.get("BLACK_BOLD", ParagraphStyle("Default"))
130
142
  if error:
131
- title = Paragraph("<b>Wiliot UT Failed!</b>", red_header)
132
- elements.append(title)
133
- elements.append(Paragraph(f"Error: {error}", styles['BodyText']))
143
+ title = Paragraph("<b>Wiliot Certificate Error!</b>", red_header)
144
+ hdr_page.append(title)
145
+ hdr_page.append(Spacer(1, 20))
146
+ hdr_page.append(Paragraph(f"{error}", text_style))
134
147
  else:
135
- title = Paragraph("<b>Wiliot UT Passed!</b>", green_header) if not failures else Paragraph("<b>Wiliot UT Failed!</b>", red_header)
136
- elements.append(title)
137
- elements.append(Spacer(1, 50))
138
-
139
- elements.append(Paragraph(f"Tests duration: {str(duration).split('.')[0]}", styles['BodyText']))
148
+ title = Paragraph("<b>Wiliot Certificate Passed!</b>", green_header) if not failures else Paragraph("<b>Wiliot Certificate Failed!</b>", red_header)
149
+ hdr_page.append(title)
150
+ hdr_page.append(Spacer(1, 20))
151
+ hdr_page.append(Paragraph(f"<b>Summary</b>", module_header))
152
+ hdr_page.append(Spacer(1, 20))
153
+ hdr_page.append(Paragraph(f"Run date: {start_time.strftime('%d/%m/%Y, %H:%M:%S')}", text_style))
154
+ hdr_page.append(Paragraph(f"Tests duration: {str(duration).split('.')[0]}", text_style))
155
+ hdr_page.append(Paragraph(f"Certificate version: {CERT_VERSION}", text_style))
156
+ if gw_ble_mac:
157
+ hdr_page.append(Paragraph(f"BLE simulator mac: {gw_ble_mac}", text_style))
158
+ if gw_ble_version:
159
+ hdr_page.append(Paragraph(f"BLE simulator version: {gw_ble_version}", text_style))
160
+ hdr_page.append(Paragraph(f"Tested bridge ID: {brg}", text_style))
140
161
  if brg_version:
141
- elements.append(Paragraph(f"Bridge version: {brg_version}", styles['BodyText']))
142
- elements.append(Paragraph(f"Update status: {update_status}", styles['BodyText']))
143
- elements.append(Spacer(1, 20))
162
+ hdr_page.append(Paragraph(f"Tested bridge version: {brg_version}", text_style))
163
+ hdr_page.append(Spacer(1, 20))
144
164
 
145
- # Summary Table
146
- summary_data = [
165
+ # Count Table
166
+ count_data = [
147
167
  ["PASSED", "SKIPPED", "FAILED", "TOTAL"],
148
168
  [len(tests)-(failures+skipped), skipped, failures, len(tests)]
149
169
  ]
150
- summary_table = Table(summary_data)
151
- summary_table.setStyle(INNER_TABLE_STYLE)
152
- elements.append(summary_table)
153
- elements.append(Spacer(1, 20))
170
+ count_table = Table(count_data)
171
+ count_table.setStyle(INNER_TABLE_STYLE)
172
+ hdr_page.append(count_table)
173
+ hdr_page.append(Spacer(1, 20))
154
174
 
155
175
  # Test Results
156
176
  results_per_module = generate_results_per_module_for_pdf(tests=tests)
177
+ summary_data = []
157
178
  for module, test_results in results_per_module.items():
158
- elements.append(Paragraph(f"<b>{module} Module</b>", module_header))
179
+ elements.append(Paragraph(f"<b>{module + ' Module' if module else 'Edge Management'}</b>", module_header))
159
180
  elements.append(Spacer(1, 20))
160
181
  for test_result in test_results:
161
- elements.append(Paragraph(f"<b>{test_result.name}</b>", test_header))
162
- elements.append(Spacer(1, 10))
182
+ group = []
183
+ summary_data += [[module, test_result.name, test_result.result, test_result.duration]]
184
+ group.append(Paragraph(f"<b>{test_result.name}</b>", test_header))
185
+ group.append(Spacer(1, 10))
163
186
 
164
- elements.append(test_result.result)
165
- elements.append(Spacer(1, 10))
187
+ group.append(test_result.result)
188
+ group.append(Spacer(1, 10))
166
189
 
167
- elements.append(Paragraph(f"Tested Devices: {test_result.devices}", styles['BodyText']))
168
- elements.append(Paragraph(f"Duration: {test_result.duration}", styles['BodyText']))
169
- elements.append(Spacer(1, 10))
190
+ group.append(Paragraph(f"Tested Devices: {test_result.devices}", text_style))
191
+ group.append(Paragraph(f"Test duration: {test_result.duration}", text_style))
192
+ group.append(Spacer(1, 10))
170
193
 
171
- elements.append(test_result.test_table)
172
- elements.append(Spacer(1, 20))
173
- elements.append(Spacer(1, 50))
194
+ group.append(test_result.test_table)
195
+ group.append(Spacer(1, 20))
196
+ elements.append(KeepTogether(group))
197
+ elements.append(PageBreak())
198
+ summary_table = Table([["Module", "Name", "Result", "Duration"]] + summary_data)
199
+ summary_table.setStyle(INNER_TABLE_STYLE)
200
+ elements = hdr_page + [summary_table, PageBreak()] + elements
174
201
 
175
202
  doc.build(elements)
176
203
 
@@ -199,46 +226,46 @@ HTML_START = """
199
226
  <head>
200
227
  <meta charset='utf-8'>
201
228
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
202
- <title>UT RESULTS</title>
229
+ <title>Wiliot Certificate Results</title>
203
230
  <meta name='viewport' content='width=device-width, initial-scale=1'>
204
231
  <style>
205
- html, body {
232
+ html, body {{
206
233
  height: 100%;
207
- }
234
+ }}
208
235
 
209
- html {
236
+ html {{
210
237
  display: table;
211
238
  margin: auto;
212
- }
239
+ }}
213
240
 
214
- body {
241
+ body {{
215
242
  display: table-cell;
216
243
  vertical-align: middle;
217
- }
218
- table {
244
+ }}
245
+ table {{
219
246
  border-collapse: collapse;
220
247
  font-family: Tahoma, Geneva, sans-serif;
221
- }
222
- table td {
248
+ }}
249
+ table td {{
223
250
  padding: 15px;
224
- }
225
- table thead td {
251
+ }}
252
+ table thead td {{
226
253
  background-color: #54585d;
227
254
  color: #ffffff;
228
255
  font-weight: bold;
229
256
  font-size: 13px;
230
257
  border: 1px solid #54585d;
231
- }
232
- table tbody td {
258
+ }}
259
+ table tbody td {{
233
260
  color: #636363;
234
261
  border: 1px solid #dddfe1;
235
- }
236
- table tbody tr {
262
+ }}
263
+ table tbody tr {{
237
264
  background-color: #f9fafb;
238
- }
239
- table tbody tr:nth-child(odd) {
265
+ }}
266
+ table tbody tr:nth-child(odd) {{
240
267
  background-color: #ffffff;
241
- }
268
+ }}
242
269
  </style>
243
270
  </head>
244
271
  <body>
@@ -254,9 +281,11 @@ HTML_END = """
254
281
  STYLES_PDF = {
255
282
  "GREEN_HEADER": ParagraphStyle("Green Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.green, alignment=TA_CENTER),
256
283
  "RED_HEADER": ParagraphStyle("Red Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.red, alignment=TA_CENTER),
257
- "MODULE_HEADER": ParagraphStyle("Module Header", fontName="Helvetica-Bold", fontSize=16, textColor=colors.blue, alignment=TA_CENTER),
284
+ "MODULE_HEADER": ParagraphStyle("Module Header", fontName="Helvetica-Bold", fontSize=16, textColor=colors.navy, alignment=TA_CENTER),
258
285
  "TEST_HEADER": ParagraphStyle("Test Header", fontName="Helvetica-Bold", fontSize=12, textColor=colors.black, alignment=TA_CENTER),
259
- "BLUE": ParagraphStyle("Blue", fontName="Helvetica-Bold", fontSize=9, textColor=colors.blue, splitLongWords=False, alignment=TA_CENTER),
286
+ "BLACK": ParagraphStyle("Black", fontName="Helvetica", fontSize=9, textColor=colors.black, splitLongWords=False, alignment=TA_CENTER, wordWrap = 'CJK'),
287
+ "BLACK_BOLD": ParagraphStyle("Black Bold", fontName="Helvetica-Bold", fontSize=9, textColor=colors.black, splitLongWords=False, alignment=TA_LEFT, wordWrap = 'CJK'),
288
+ "BLUE": ParagraphStyle("Blue", fontName="Helvetica-Bold", fontSize=9, textColor=colors.navy, splitLongWords=False, alignment=TA_CENTER),
260
289
  "CYAN": ParagraphStyle("Cyan", fontName="Helvetica-Bold", fontSize=9, textColor=colors.cyan, splitLongWords=False, alignment=TA_CENTER),
261
290
  "GREEN": ParagraphStyle("Green", fontName="Helvetica-Bold", fontSize=9, textColor=colors.green, splitLongWords=False, alignment=TA_CENTER),
262
291
  "WARNING": ParagraphStyle("Warning", fontName="Helvetica-Bold", fontSize=9, textColor=colors.gold, splitLongWords=False, alignment=TA_CENTER),
@@ -277,18 +306,19 @@ INNER_TABLE_STYLE = TableStyle([
277
306
  ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
278
307
  ('FONTSIZE', (0, 0), (-1, 0), 9),
279
308
  ('BOTTOMPADDING', (0, 0), (-1, 0), 12),
280
- ('BACKGROUND', (0, 1), (-1, -1), colors.beige),
309
+ ('BACKGROUND', (0, 1), (-1, -1), colors.whitesmoke),
281
310
  ('WORDWRAP', (0, 0), (-1, -1), False),
282
311
  ])
283
312
 
284
313
  def generate_results_per_module_for_pdf(tests=[]):
314
+ text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
285
315
  results_per_module = {}
286
316
  for test in tests:
287
317
  name=test.module_name if (not test.internal_brg or "gw" in test.module_name) else f"{test.module_name} (internal brg)"
288
318
  devices_to_print = (test.gw if not test.brg0 or test.gw_only else
289
319
  (f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
290
- inner_table = [[phase.name, pass_or_fail_pdf(phase), phase.reason] for phase in test.phases]
291
- test_table = Table([["Phase", "Result", "Reason"]] + inner_table)
320
+ inner_table = [[Paragraph(phase.name, text_style), pass_or_fail_pdf(phase), Paragraph(phase.reason, text_style)] for phase in test.phases]
321
+ test_table = Table([["Phase", "Result", "Notes"]] + inner_table)
292
322
  test_table.setStyle(INNER_TABLE_STYLE)
293
323
  test_result = TestResult(name=name, devices_to_print=devices_to_print,
294
324
  test_table=test_table, result=pass_or_fail_pdf(test), duration=test.duration)
@@ -43,7 +43,7 @@ def load_module(module_name, module_path, rel_path="."):
43
43
  def handle_error(error, start_time):
44
44
  utPrint(error, "red")
45
45
  duration = (datetime.datetime.now()-start_time)
46
- cert_results.generate_results_files(html=True, pdf=True, duration=duration, error=error, pipeline=cert_common.pipeline_running())
46
+ cert_results.generate_results_files(html=True, pdf=True, start_time=start_time, duration=duration, error=error, pipeline=cert_common.pipeline_running())
47
47
  sys.exit(-1)
48
48
 
49
49
  ##################################
@@ -73,7 +73,7 @@ class WltTest:
73
73
  self.test_json = {}
74
74
  self.internal_brg = False
75
75
  self.multi_brg = False
76
- self.phases = [Phase(PROLOG), Phase(TEST_BODY), Phase(EPILOG)]
76
+ self.phases = [Phase(PRE_CONFIG), Phase(TEST_BODY), Phase(RESTORE_CONFIG)]
77
77
  self.params = []
78
78
 
79
79
  self.gw = gw
@@ -83,7 +83,7 @@ class WltTest:
83
83
  self.brg0 = brg0
84
84
  self.brg1 = brg1
85
85
  self.rc = TEST_PASSED
86
- self.reason = TEST_SUCCESS
86
+ self.reason = ""
87
87
  self.start_time = None
88
88
  self.end_time = None
89
89
  self.duration = None
@@ -105,7 +105,7 @@ class WltTest:
105
105
  def create_test_phases_and_params(self, line_params):
106
106
  self.params = []
107
107
  if len(self.test_json[ALL_SUPPORTED_VALUES]) > 0:
108
- self.phases = [Phase(PROLOG)] + [Phase(param) for param in self.test_json[ALL_SUPPORTED_VALUES]] + [Phase(EPILOG)]
108
+ self.phases = [Phase(PRE_CONFIG)] + [Phase(param) for param in self.test_json[ALL_SUPPORTED_VALUES]] + [Phase(RESTORE_CONFIG)]
109
109
  for param_phase in self.phases:
110
110
  param = Param(param_phase.name)
111
111
  if (param.name in line_params or param.value in [eval_param(p) for p in line_params]):
@@ -120,7 +120,7 @@ class WltTest:
120
120
  if line_params:
121
121
  error = f"ERROR: For {self.name} params exist in test_list but not in test_json!\nline_params:{line_params}"
122
122
  handle_error(error, datetime.datetime.now())
123
- self.phases = [Phase(PROLOG), Phase(TEST_BODY), Phase(EPILOG)]
123
+ self.phases = [Phase(PRE_CONFIG), Phase(TEST_BODY), Phase(RESTORE_CONFIG)]
124
124
 
125
125
  # Phase rc
126
126
  def set_phase_rc(self, phase_name, rc):
@@ -134,9 +134,7 @@ class WltTest:
134
134
  # Phase reason
135
135
  def add_phase_reason(self, phase_name, reason):
136
136
  phase = self.get_phase_by_name(phase_name)
137
- if TEST_SUCCESS in phase.reason:
138
- phase.reason = phase.reason.replace(TEST_SUCCESS, "")
139
- else:
137
+ if phase.reason:
140
138
  phase.reason += "\n"
141
139
  if reason not in phase.reason:
142
140
  phase.reason += reason
@@ -158,7 +156,7 @@ class WltTest:
158
156
 
159
157
  def reset_result(self):
160
158
  self.rc = TEST_PASSED
161
- self.reason = TEST_SUCCESS
159
+ self.reason = ""
162
160
 
163
161
  def get_seq_id(self):
164
162
  self.rand = (self.rand + 1) % 256
@@ -166,9 +164,7 @@ class WltTest:
166
164
 
167
165
  # TODO - remove when test reason is re-designed
168
166
  def add_reason(self, reason):
169
- if TEST_SUCCESS in self.reason:
170
- self.reason = self.reason.replace(TEST_SUCCESS, "")
171
- else:
167
+ if self.reason:
172
168
  self.reason += "\n"
173
169
  if reason not in self.reason:
174
170
  self.reason += reason
@@ -180,7 +176,7 @@ class WltTest:
180
176
  # Phases
181
177
  ##################################
182
178
  class Phase:
183
- def __init__(self, input=None, tested=True, rc=TEST_INIT, reason=TEST_SUCCESS):
179
+ def __init__(self, input=None, tested=True, rc=TEST_INIT, reason=""):
184
180
  self.name = str(input)
185
181
  self.tested = tested
186
182
  self.rc = rc
@@ -257,7 +253,7 @@ def cfg_brg_defaults_ret_after_fail(test):
257
253
  def handle_prep_brg_for_latest(test, interface, start_time):
258
254
  if test.rc == TEST_FAILED:
259
255
  utPrint(f"No ModuleIf pkts found, try again", "BLUE")
260
- test.rc = TEST_SUCCESS
256
+ test.rc = ""
261
257
  test, interface = cert_common.get_module_if_pkt(test)
262
258
  if test.rc == TEST_FAILED:
263
259
  error = f"ERROR: No ModuleIf pkts found for 2 tries, couldn't perform OTA for bridge"
@@ -1,4 +1,6 @@
1
+ import sys
1
2
  import os
3
+ sys.path.insert(0, os.path.abspath(".."))
2
4
  import argparse
3
5
  import brg_certificate.cert_common as cert_common
4
6
  from brg_certificate.cert_utils import *
@@ -11,7 +11,7 @@ def run(test):
11
11
  calib_module = eval_pkt(f'ModuleCalibrationV{test.active_brg.api_version}')
12
12
 
13
13
  test = cert_common.test_prolog(test)
14
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
14
+ if test.rc == TEST_FAILED:
15
15
  return cert_common.test_epilog(test)
16
16
  for param in test.params:
17
17
  test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=calib_module)[0]
@@ -11,7 +11,7 @@ def run(test):
11
11
  calib_module = eval_pkt(f'ModuleCalibrationV{test.active_brg.api_version}')
12
12
 
13
13
  test = cert_common.test_prolog(test)
14
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
14
+ if test.rc == TEST_FAILED:
15
15
  return cert_common.test_epilog(test)
16
16
 
17
17
  for param in test.params:
@@ -12,7 +12,7 @@ def run(test):
12
12
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
13
13
 
14
14
  test = cert_common.test_prolog(test)
15
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
15
+ if test.rc == TEST_FAILED:
16
16
  return cert_common.test_epilog(test)
17
17
 
18
18
  for param in test.params:
@@ -24,15 +24,15 @@ def run(test):
24
24
  calib_module = eval_pkt(f'ModuleCalibrationV{test.active_brg.api_version}')
25
25
 
26
26
  test = cert_common.test_prolog(test)
27
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
27
+ if test.rc == TEST_FAILED:
28
28
  return cert_common.test_epilog(test)
29
29
 
30
30
  # Turn on adaptive pacer and set cfgs to help activating adaptive pacer algo
31
31
  test = cert_config.brg_configure(test, fields=fields, values=values, module=datapath_module)[0]
32
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
32
+ if test.rc == TEST_FAILED:
33
33
  return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
34
34
  test = cert_config.brg_configure(test, fields=[BRG_CALIB_INTERVAL], values=[30], module=calib_module)[0]
35
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
35
+ if test.rc == TEST_FAILED:
36
36
  return cert_common.test_epilog(test, revert_brgs=True, modules=[calib_module])
37
37
 
38
38
  # Wait for tx rep algo to work & then activate pacing algo
@@ -70,7 +70,7 @@ def run(test):
70
70
  cert_common.display_data(df, nfpkt=True, pkt_cntr_diff=True, cer_per_tag=True, name_prefix=test.module_name, dir=test.dir)
71
71
 
72
72
  test = cert_common.pacing_analysis(test, df=df, pacer_interval=1+effective_pacer_increment)
73
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
73
+ if test.rc == TEST_FAILED:
74
74
  return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module, calib_module])
75
75
 
76
76
  return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module, calib_module])
@@ -13,7 +13,7 @@ def run(test):
13
13
  print(f"values: {[param.value for param in test.params]}")
14
14
 
15
15
  test = cert_common.test_prolog(test)
16
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
16
+ if test.rc == TEST_FAILED:
17
17
  return cert_common.test_epilog(test)
18
18
 
19
19
  duplicates = 3
@@ -24,7 +24,7 @@ def run(test):
24
24
  time_of_sending_pkts = duplicates * param.value * GW_CYCLE_TIME * 2
25
25
 
26
26
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[time_of_sending_pkts], module=datapath_module)[0]
27
- if test.rc == TEST_FAILED and test.reason != TEST_SUCCESS:
27
+ if test.rc == TEST_FAILED:
28
28
  return cert_common.test_epilog(test)
29
29
 
30
30
 
@@ -10,7 +10,7 @@ def run(test):
10
10
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
11
11
 
12
12
  test = cert_common.test_prolog(test)
13
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
13
+ if test.rc == TEST_FAILED:
14
14
  return cert_common.test_epilog(test)
15
15
 
16
16
  for param in test.params:
@@ -10,7 +10,7 @@ def run(test):
10
10
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
11
11
 
12
12
  test = cert_common.test_prolog(test)
13
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
13
+ if test.rc == TEST_FAILED:
14
14
  return cert_common.test_epilog(test)
15
15
 
16
16
  for param in test.params:
@@ -11,13 +11,13 @@ def run(test):
11
11
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
12
12
 
13
13
  test = cert_common.test_prolog(test)
14
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
14
+ if test.rc == TEST_FAILED:
15
15
  return cert_common.test_epilog(test)
16
16
 
17
17
  # Configure the GW to receive tags pkt
18
18
  if test.internal_brg:
19
19
  test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_37], module=datapath_module, wait=True)[0]
20
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
20
+ if test.rc == TEST_FAILED:
21
21
  return cert_common.test_epilog(test, revert_gws=True)
22
22
 
23
23
  num_of_pixels = 200
@@ -10,7 +10,7 @@ def run(test):
10
10
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
11
11
 
12
12
  test = cert_common.test_prolog(test)
13
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
13
+ if test.rc == TEST_FAILED:
14
14
  return cert_common.test_epilog(test)
15
15
 
16
16
  for param in test.params:
@@ -10,7 +10,7 @@ def run(test):
10
10
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
11
11
 
12
12
  test = cert_common.test_prolog(test)
13
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
13
+ if test.rc == TEST_FAILED:
14
14
  return cert_common.test_epilog(test)
15
15
 
16
16
  for param in test.params:
@@ -12,7 +12,7 @@ def run(test):
12
12
  datapath_module = eval(f'ModuleDatapathV{test.active_brg.api_version}')
13
13
 
14
14
  test = cert_common.test_prolog(test)
15
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
15
+ if test.rc == TEST_FAILED:
16
16
  return cert_common.test_epilog(test)
17
17
 
18
18
 
@@ -13,7 +13,7 @@ def run(test):
13
13
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
14
14
 
15
15
  test = cert_common.test_prolog(test)
16
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
16
+ if test.rc == TEST_FAILED:
17
17
  return cert_common.test_epilog(test)
18
18
 
19
19
 
@@ -13,7 +13,7 @@ def run(test):
13
13
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
14
14
 
15
15
  test = cert_common.test_prolog(test)
16
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
16
+ if test.rc == TEST_FAILED:
17
17
  return cert_common.test_epilog(test)
18
18
 
19
19
 
@@ -31,7 +31,7 @@ def run(test):
31
31
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
32
32
 
33
33
  test = cert_common.test_prolog(test)
34
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
34
+ if test.rc == TEST_FAILED:
35
35
  return cert_common.test_epilog(test)
36
36
 
37
37
  # Configure the BRG with RSSI threshold and check for packets violating the threshold
@@ -18,7 +18,7 @@ def run(test):
18
18
  ble5_state = False # We use this flag to know whether the BRG is currently in BLE5 mode and needs special configuration next time it is configured
19
19
 
20
20
  test = cert_common.test_prolog(test)
21
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
21
+ if test.rc == TEST_FAILED:
22
22
  return cert_common.test_epilog(test)
23
23
 
24
24
  for param in test.params:
@@ -159,7 +159,7 @@ def run(test):
159
159
  # "Test prolog"
160
160
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
161
161
  test = cert_common.test_prolog(test)
162
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
162
+ if test.rc == TEST_FAILED:
163
163
  return cert_common.test_epilog(test)
164
164
 
165
165
  pacer_interval =1
@@ -184,7 +184,7 @@ def run(test):
184
184
  # "Test prolog"
185
185
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
186
186
  test = cert_common.test_prolog(test)
187
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
187
+ if test.rc == TEST_FAILED:
188
188
  return cert_common.test_epilog(test)
189
189
 
190
190
  fields = [BRG_PACER_INTERVAL]
@@ -12,7 +12,7 @@ import time
12
12
 
13
13
  def configure_pacer_n_times(test, num_of_times, pacer_interval, datapath_module):
14
14
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
15
- if test.rc == TEST_FAILED and test.reason != TEST_SUCCESS:
15
+ if test.rc == TEST_FAILED:
16
16
  for i in range(num_of_times):
17
17
  if test.rc == TEST_PASSED:
18
18
  return test
@@ -171,7 +171,7 @@ def run(test):
171
171
  # Test prolog
172
172
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
173
173
  test = cert_common.test_prolog(test)
174
- if test.rc == TEST_FAILED or test.reason != TEST_SUCCESS:
174
+ if test.rc == TEST_FAILED:
175
175
  return cert_common.test_epilog(test)
176
176
  #config GW deduplication pkts = 0 "
177
177
  print("Configuring GW with !deduplication_pkts 0")