wiliot-certificate 1.5.0a1__py3-none-any.whl → 1.5.2a1__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.
- brg_certificate/ag/energous_v0_defines.py +17 -17
- brg_certificate/ag/energous_v1_defines.py +17 -17
- brg_certificate/ag/energous_v2_defines.py +17 -17
- brg_certificate/ag/energous_v3_defines.py +17 -17
- brg_certificate/ag/energous_v4_defines.py +17 -17
- brg_certificate/ag/fanstel_lan_v0_defines.py +17 -17
- brg_certificate/ag/fanstel_lte_v0_defines.py +17 -17
- brg_certificate/ag/fanstel_wifi_v0_defines.py +17 -17
- brg_certificate/ag/minew_lte_v0_defines.py +17 -17
- brg_certificate/ag/wlt_cmd_if.html +3 -2
- brg_certificate/ag/wlt_types.html +0 -1
- brg_certificate/ag/wlt_types_ag.py +151 -152
- brg_certificate/brg_certificate.py +38 -7
- brg_certificate/brg_certificate_cli.py +19 -3
- brg_certificate/cert_common.py +92 -55
- brg_certificate/cert_config.py +6 -4
- brg_certificate/cert_data_sim.py +47 -7
- brg_certificate/cert_defines.py +20 -6
- brg_certificate/cert_gw_sim.py +10 -6
- brg_certificate/cert_mqtt.py +9 -6
- brg_certificate/cert_prints.py +14 -1
- brg_certificate/cert_protobuf.py +7 -7
- brg_certificate/cert_results.py +131 -84
- brg_certificate/cert_utils.py +13 -7
- brg_certificate/certificate_bcc_sanity_test_list.txt +40 -0
- brg_certificate/certificate_bcc_test_list.txt +50 -0
- brg_certificate/certificate_sanity_test_list.txt +12 -5
- brg_certificate/certificate_test_list.txt +16 -6
- brg_certificate/tests/calibration/interval_test/interval_test.json +4 -3
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +8 -5
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +7 -4
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
- brg_certificate/tests/datapath/aging_test/aging_test.json +19 -0
- brg_certificate/tests/datapath/aging_test/aging_test.py +142 -0
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +10 -5
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
- brg_certificate/tests/datapath/output_power_test/output_power_test.json +7 -4
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +8 -5
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +7 -4
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +7 -4
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +8 -5
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +11 -5
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +10 -4
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +10 -4
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +8 -4
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +7 -4
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +4 -5
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +4 -5
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +15 -23
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +104 -103
- brg_certificate/tests/datapath/stress_test/stress_test.json +15 -23
- brg_certificate/tests/datapath/stress_test/stress_test.py +104 -110
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +8 -4
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +8 -4
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +4 -3
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -38
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +15 -8
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +14 -8
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +11 -7
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +25 -12
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +11 -7
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +48 -3
- brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +5 -4
- brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +8 -5
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +9 -6
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +8 -5
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +20 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +343 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +20 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +343 -0
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +14 -7
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +14 -7
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +198 -125
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +7 -4
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -6
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +14 -7
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +7 -4
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
- brg_certificate/wltPb_pb2.py +15 -15
- brg_certificate/wltPb_pb2.pyi +8 -2
- brg_certificate/wlt_types.py +2 -1
- gw_certificate/cert_results.py +11 -4
- gw_certificate/gw_certificate.py +0 -2
- gw_certificate/gw_certificate_cli.py +3 -3
- gw_certificate/interface/uart_if.py +1 -1
- gw_certificate/tests/actions.py +7 -1
- gw_certificate/tests/registration.py +2 -1
- gw_certificate/tests/uplink.py +26 -35
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +46 -42
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +120 -112
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +0 -13
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +0 -76
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -13
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +0 -398
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info/licenses}/LICENSE +0 -0
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
brg_certificate/cert_mqtt.py
CHANGED
|
@@ -171,6 +171,8 @@ def on_message_protobuf(mqttc, userdata, message):
|
|
|
171
171
|
pb_msg_dict = MessageToDict(pb_msg)
|
|
172
172
|
# Align formats with JSON (bytes to hex strings)
|
|
173
173
|
if 'status' in message.topic:
|
|
174
|
+
if ACTION_STATUS in pb_msg_dict:
|
|
175
|
+
pb_msg_dict[ACTION_STATUS][BRIDGE_ID] = base64.b64decode(pb_msg_dict[ACTION_STATUS][BRIDGE_ID]).hex().upper()
|
|
174
176
|
if GW_STATUS in pb_msg_dict and ACL_IDS in pb_msg_dict[GW_STATUS][CONFIG][ACL][ACL_VALUE]:
|
|
175
177
|
ids_list = pb_msg_dict[GW_STATUS][CONFIG][ACL][ACL_VALUE][ACL_IDS]
|
|
176
178
|
for idx, id in enumerate(ids_list):
|
|
@@ -285,7 +287,7 @@ def get_undecrypted_data_pkts_count(mqttc):
|
|
|
285
287
|
undecrypted += p.body_ex['undecrypted']
|
|
286
288
|
return undecrypted
|
|
287
289
|
|
|
288
|
-
def get_all_sensor_pkts(
|
|
290
|
+
def get_all_sensor_pkts(test, is_embedded=False):
|
|
289
291
|
all_sensor_pkts = couple_sensor_data_si_coupling(test)
|
|
290
292
|
all_sensor_pkts = [p for p in all_sensor_pkts if test.active_brg.id_str == p[BRIDGE_ID] and (p[IS_EMBEDDED] == is_embedded)]
|
|
291
293
|
return all_sensor_pkts
|
|
@@ -337,16 +339,17 @@ def count_pkt_id_duplications(test, all_sensor_data_pkts, all_sensor_side_info_p
|
|
|
337
339
|
coupled_pkt[PKT_ID_CTR] = pkt_ids.count(_pkt_id)
|
|
338
340
|
if coupled_pkt[PKT_ID_CTR] > SENSORS_DATA_SI_DUP:
|
|
339
341
|
print(f"pkt_id {_pkt_id:08X}: {coupled_pkt[PKT_ID_CTR]} occurrences")
|
|
340
|
-
|
|
342
|
+
#TODO: logging print(debug)
|
|
343
|
+
# test.reason = f'Warning: {coupled_pkt[PKT_ID_CTR]} sensor data and si with pkt id 0x{_pkt_id:08X}'
|
|
341
344
|
|
|
342
|
-
def get_all_brg1_ext_sensor_pkts(
|
|
345
|
+
def get_all_brg1_ext_sensor_pkts(test=None):
|
|
343
346
|
test.active_brg = test.brg1
|
|
344
|
-
pkts = get_all_sensor_pkts(
|
|
347
|
+
pkts = get_all_sensor_pkts(test)
|
|
345
348
|
test.active_brg = test.brg0
|
|
346
349
|
return pkts
|
|
347
350
|
|
|
348
|
-
def get_all_custom_pkts(
|
|
349
|
-
return get_all_sensor_pkts(
|
|
351
|
+
def get_all_custom_pkts(test=None):
|
|
352
|
+
return get_all_sensor_pkts(test, is_embedded=True)
|
|
350
353
|
|
|
351
354
|
def get_all_mgmt_pkts(mqttc):
|
|
352
355
|
all_data_pkts = get_all_data_pkts(mqttc)
|
brg_certificate/cert_prints.py
CHANGED
|
@@ -22,6 +22,7 @@ color = lambda c, t : COLORS["BOLD"]+COLORS[c]+t+COLORS["ENDC"]
|
|
|
22
22
|
pipeline_running = lambda : True if 'BITBUCKET_BUILD_NUMBER' in os.environ else False
|
|
23
23
|
camelcase_to_title = lambda s: ' '.join(word.capitalize() for word in re.split('(?=[A-Z])', s))
|
|
24
24
|
SEP = '\n' + '#'*100 + '\n'
|
|
25
|
+
SEP2 = '\n' + '#'*100 + '\n' + '#'*100 + '\n'
|
|
25
26
|
WIL_CERT_TEXT = r'''
|
|
26
27
|
__ _____ _ ___ ___ _____ ____ _____ ____ _____ ___ _____ ___ ____ _ _____ _____
|
|
27
28
|
\ \ / /_ _| | |_ _/ _ \_ _| / ___| ____| _ \_ _|_ _| ___|_ _/ ___| / \|_ _| ____|
|
|
@@ -65,17 +66,23 @@ def mqtt_scan_wait(test, duration):
|
|
|
65
66
|
i += 1
|
|
66
67
|
print("\n")
|
|
67
68
|
|
|
69
|
+
def mqtt_scan_n_create_log_file(test, duration, phase):
|
|
70
|
+
test.mqttc.flush_pkts()
|
|
71
|
+
mqtt_scan_wait(test, duration=duration)
|
|
72
|
+
generate_log_file(test, phase)
|
|
73
|
+
|
|
68
74
|
def print_update_wait(secs=1):
|
|
69
75
|
sys.stdout.write(".")
|
|
70
76
|
sys.stdout.flush()
|
|
71
77
|
time.sleep(secs)
|
|
72
78
|
|
|
73
79
|
def field_functionality_pass_fail_print(test, field, value=""):
|
|
74
|
-
print_string = "{}={}"
|
|
80
|
+
print_string = f"{field}={value}"
|
|
75
81
|
if value == "":
|
|
76
82
|
print_string = str(field)
|
|
77
83
|
if test.rc == TEST_FAILED:
|
|
78
84
|
utPrint(print_string + " functionality failed!", "RED")
|
|
85
|
+
utPrint(test.reason, "RED")
|
|
79
86
|
elif test.rc == TEST_SKIPPED:
|
|
80
87
|
utPrint(print_string + " functionality skipped!", "WARNING")
|
|
81
88
|
else:
|
|
@@ -127,6 +134,12 @@ def functionality_run_print(func):
|
|
|
127
134
|
cert_mqtt.write_to_mqtt_log_file(txt)
|
|
128
135
|
cert_data_sim.write_to_data_sim_log_file(txt)
|
|
129
136
|
|
|
137
|
+
def phase_run_print(func):
|
|
138
|
+
txt = f"{SEP2}==>> Phase {func}{SEP2}\n"
|
|
139
|
+
utPrint(txt, "CYAN")
|
|
140
|
+
cert_mqtt.write_to_mqtt_log_file(txt)
|
|
141
|
+
cert_data_sim.write_to_data_sim_log_file(txt)
|
|
142
|
+
|
|
130
143
|
|
|
131
144
|
def generate_print_string(fields_and_values):
|
|
132
145
|
list_to_print = []
|
brg_certificate/cert_protobuf.py
CHANGED
|
@@ -36,19 +36,19 @@ def gw_cfg_pb(msg: dict):
|
|
|
36
36
|
pb_msg.gatewayConfig.bleSwVersion = msg[BLE_VERSION]
|
|
37
37
|
|
|
38
38
|
for key, val in msg[ADDITIONAL].items():
|
|
39
|
-
# Skip GW_MODE since it doesn't exist today and harm the parsing in PB
|
|
40
|
-
if GW_MODE == key:
|
|
39
|
+
# Skip GW_MODE since it doesn't exist today and harm the parsing in PB, and skip lat & lng to create duplicate values
|
|
40
|
+
if key == GW_MODE or key == LAT or key == LNG:
|
|
41
41
|
continue
|
|
42
42
|
pb_value = wpb.GatewayConfigValue()
|
|
43
|
-
if
|
|
43
|
+
if type(val) is int:
|
|
44
44
|
pb_value.integerValue = val
|
|
45
|
-
elif
|
|
45
|
+
elif type(val) is float:
|
|
46
46
|
pb_value.numberValue = val
|
|
47
|
-
elif
|
|
47
|
+
elif type(val) is str:
|
|
48
48
|
pb_value.stringValue = val
|
|
49
|
-
elif
|
|
49
|
+
elif type(val) is bool:
|
|
50
50
|
pb_value.boolValue = val
|
|
51
|
-
elif
|
|
51
|
+
elif type(val) is dict and key == ACL:
|
|
52
52
|
pb_value.aclValue.mode_allow = ACL_DENY_VALUE if msg[ADDITIONAL][ACL][ACL_MODE] == ACL_DENY else ACL_ALLOW_VALUE
|
|
53
53
|
ids_bytes = [bytes.fromhex(id) for id in msg[ADDITIONAL][ACL][ACL_BRIDGE_IDS]]
|
|
54
54
|
pb_value.aclValue.ids.extend(ids_bytes)
|
brg_certificate/cert_results.py
CHANGED
|
@@ -1,32 +1,58 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import tabulate
|
|
3
3
|
import subprocess
|
|
4
|
+
import datetime
|
|
4
5
|
from reportlab.lib import colors
|
|
5
6
|
from reportlab.lib.pagesizes import letter
|
|
6
7
|
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer, PageBreak, KeepTogether, Image
|
|
7
8
|
from reportlab.lib.styles import ParagraphStyle
|
|
8
|
-
from reportlab.lib.enums import TA_CENTER, TA_LEFT
|
|
9
|
+
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
|
|
9
10
|
|
|
10
11
|
# Local imports
|
|
11
12
|
import brg_certificate.cert_utils as cert_utils
|
|
12
13
|
import brg_certificate.cert_prints as cert_prints
|
|
13
|
-
from brg_certificate.
|
|
14
|
-
from brg_certificate.cert_defines import
|
|
14
|
+
from brg_certificate.wlt_types import *
|
|
15
|
+
from brg_certificate.cert_defines import *
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
##################################
|
|
18
19
|
# GENERIC
|
|
19
20
|
##################################
|
|
21
|
+
# Defines
|
|
22
|
+
WLT_CERT_HEADLINE = "Wiliot Certificate Results"
|
|
23
|
+
WLT_CERT_PASS_HEADLINE = "Wiliot Certificate Passed!"
|
|
24
|
+
WLT_CERT_FAIL_HEADLINE = "Wiliot Certificate Failed!"
|
|
25
|
+
WLT_CERT_ERROR_HEADLINE = "Wiliot Certificate Error!"
|
|
26
|
+
SUMMARY_HEADLINE = "Summary"
|
|
27
|
+
RUN_INFO = "Run Information"
|
|
28
|
+
RUN_DATETIME = "Run Time & Date"
|
|
29
|
+
RUN_DUR = "Run Duration"
|
|
30
|
+
CERT_VER = "Certificate Version"
|
|
31
|
+
TESTING_DEVICE_INFO = "Testing Device Information"
|
|
32
|
+
TESTED_DEVICE_INFO = "Tested Device Information"
|
|
33
|
+
SIM = "Simulator"
|
|
34
|
+
BRG = "Bridge"
|
|
35
|
+
BLE_MAC_ADDRESS = "BLE MAC Address"
|
|
36
|
+
BOARD_TYPE = "Board Type"
|
|
37
|
+
BLE_VER = "BLE Version"
|
|
38
|
+
SUP_API_VER = "Supported API Version"
|
|
39
|
+
|
|
20
40
|
result_map = {TEST_FAILED: cert_prints.color("RED", "FAIL"), TEST_SKIPPED: cert_prints.color("WARNING", "SKIPPED"),
|
|
21
41
|
TEST_PASSED: cert_prints.color("GREEN", "PASS"), TEST_INIT: cert_prints.color("CYAN", "INIT")}
|
|
22
42
|
pass_or_fail = lambda obj : result_map[obj.rc]
|
|
43
|
+
param_name_to_title = lambda s : ' '.join(word.lower().capitalize() for word in s.split('_')).replace('2 4', '2.4') if '_' in s else s
|
|
44
|
+
|
|
23
45
|
class TestResult:
|
|
24
|
-
def __init__(self, name="", devices_to_print="", test_table=None, result=None, duration=0):
|
|
46
|
+
def __init__(self, name="", devices_to_print="", test_table=None, result=None, duration=0, purpose="", kb_link="", compliance="", test_skipped=False):
|
|
25
47
|
self.name = name
|
|
26
48
|
self.devices = devices_to_print
|
|
27
49
|
self.result = result
|
|
28
50
|
self.test_table = test_table
|
|
29
51
|
self.duration = duration
|
|
52
|
+
self.purpose = purpose
|
|
53
|
+
self.kb_link = kb_link
|
|
54
|
+
self.compliance = compliance
|
|
55
|
+
self.test_skipped = test_skipped
|
|
30
56
|
|
|
31
57
|
def __repr__(self):
|
|
32
58
|
return self.name
|
|
@@ -74,7 +100,7 @@ def get_update_status_from_log_file(log_file="update_log.txt"):
|
|
|
74
100
|
break
|
|
75
101
|
return update_status
|
|
76
102
|
|
|
77
|
-
def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=
|
|
103
|
+
def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_time=datetime.datetime.now(), duration=0, brg=None, internal_brg=None, tests=[], error=None, pipeline=False):
|
|
78
104
|
# Generate HTML file
|
|
79
105
|
if html:
|
|
80
106
|
f = open(os.path.join(BASE_DIR, UT_RESULT_FILE_HTML), "w", encoding="utf-8")
|
|
@@ -85,39 +111,38 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
85
111
|
stdout=subprocess.PIPE, shell=True, cwd=os.environ['BITBUCKET_CLONE_DIR'])
|
|
86
112
|
output, err = p.communicate()
|
|
87
113
|
if error:
|
|
88
|
-
f.write("<br><h1 style='color:#ab0000'>
|
|
114
|
+
f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_ERROR_HEADLINE}</h1><br>")
|
|
89
115
|
if pipeline:
|
|
90
116
|
f.write("<hr>" + output.decode("utf-8") + "<br>")
|
|
91
117
|
f.write("<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/commits/{}'>Commit page on bitbucket</a><hr>".format(os.environ['BITBUCKET_COMMIT']))
|
|
92
118
|
f.write(update_status + "<br><br>")
|
|
93
119
|
f.write(error + "<br><br>")
|
|
94
|
-
f.write("
|
|
95
|
-
if
|
|
96
|
-
f.write("
|
|
120
|
+
f.write(f"{RUN_DUR}: {str(duration).split(".")[0]} <br><br>")
|
|
121
|
+
if brg:
|
|
122
|
+
f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
|
|
97
123
|
elif tests:
|
|
98
124
|
if not failures and ("successfully!" in update_status or "skipped!" in update_status or not pipeline):
|
|
99
|
-
f.write("<br><h1 style='color:#00AB83'>
|
|
125
|
+
f.write(f"<br><h1 style='color:#00AB83'>{WLT_CERT_PASS_HEADLINE}</h1>")
|
|
100
126
|
else:
|
|
101
|
-
f.write("<br><h1 style='color:#ab0000'>
|
|
127
|
+
f.write(f"<br><h1 style='color:#ab0000'>{WLT_CERT_FAIL_HEADLINE}</h1>")
|
|
102
128
|
if pipeline:
|
|
103
129
|
f.write("<hr>" + output.decode("utf-8") + "<br>")
|
|
104
130
|
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
131
|
f.write(update_status + "<br><br>")
|
|
106
|
-
f.write("
|
|
107
|
-
f.write("
|
|
108
|
-
f.write("
|
|
109
|
-
if
|
|
110
|
-
f.write("
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
f.write("Bridge version: {} <br><br>".format(brg_version))
|
|
132
|
+
f.write(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')} <br><br>")
|
|
133
|
+
f.write(f"{RUN_DUR}: {str(duration).split(".")[0]} <br><br>")
|
|
134
|
+
f.write(f"{CERT_VER}: {CERT_VERSION} <br><br>")
|
|
135
|
+
if internal_brg:
|
|
136
|
+
f.write(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str} <br><br>")
|
|
137
|
+
f.write(f"{SIM} {BLE_VER}: {internal_brg.version} <br><br>")
|
|
138
|
+
if brg:
|
|
139
|
+
f.write(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str} <br><br>")
|
|
140
|
+
f.write(f"{BRG} {BLE_VER}: {brg.version} <br><br>")
|
|
116
141
|
f.write(tabulate.tabulate([[len(tests)-(failures+skipped), skipped, failures, len(tests)]], headers=["PASSED", "SKIPPED", "FAILED", "TOTAL"], tablefmt="html"))
|
|
117
142
|
f.write(generate_tests_table(tests, html=True))
|
|
118
143
|
f.write("<br><br>")
|
|
119
144
|
if pipeline:
|
|
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>"
|
|
145
|
+
f.write(f"<p><a href='https://bitbucket.org/wiliot/wiliot-nordic-firmware/pipelines/results/{os.environ['BITBUCKET_BUILD_NUMBER']}'>Build's page and artifacts on bitbucket</a></p><br><br>")
|
|
121
146
|
f.write("<img src='https://www.wiliot.com/src/img/svg/logo.svg' width='100' height='40' alt='Wiliot logo'>")
|
|
122
147
|
f.write(HTML_END)
|
|
123
148
|
f.close()
|
|
@@ -135,31 +160,42 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
135
160
|
|
|
136
161
|
# Title and Summary
|
|
137
162
|
red_header = STYLES_PDF.get("RED_HEADER", ParagraphStyle("Default"))
|
|
138
|
-
|
|
163
|
+
black_header = STYLES_PDF.get("BLACK_HEADER", ParagraphStyle("Default"))
|
|
139
164
|
module_header = STYLES_PDF.get("MODULE_HEADER", ParagraphStyle("Default"))
|
|
140
|
-
test_header = STYLES_PDF.get("
|
|
141
|
-
|
|
165
|
+
test_header = STYLES_PDF.get("TEST_LINK_HEADER", ParagraphStyle("Default"))
|
|
166
|
+
test_purpose = STYLES_PDF.get("TEST_HEADER", ParagraphStyle("Default"))
|
|
167
|
+
bold_text_style = STYLES_PDF.get("BLACK_BOLD", ParagraphStyle("Default"))
|
|
168
|
+
bold_right_text_style = STYLES_PDF.get("BLUE_BOLD_RIGHT", ParagraphStyle("Default"))
|
|
169
|
+
centered_text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
142
170
|
if error:
|
|
143
|
-
title = Paragraph("<b>
|
|
171
|
+
title = Paragraph(f"<b>{WLT_CERT_ERROR_HEADLINE}</b>", red_header)
|
|
144
172
|
hdr_page.append(title)
|
|
145
173
|
hdr_page.append(Spacer(1, 20))
|
|
146
|
-
hdr_page.append(Paragraph(f"{error}",
|
|
174
|
+
hdr_page.append(Paragraph(f"{error}", bold_text_style))
|
|
147
175
|
else:
|
|
148
|
-
title = Paragraph("<b>
|
|
176
|
+
title = Paragraph(f"<b>{WLT_CERT_HEADLINE}</b>", black_header)
|
|
149
177
|
hdr_page.append(title)
|
|
150
178
|
hdr_page.append(Spacer(1, 20))
|
|
151
|
-
hdr_page.append(Paragraph(f"<b>
|
|
179
|
+
hdr_page.append(Paragraph(f"<a name='{SUMMARY_HEADLINE}'/><b>{SUMMARY_HEADLINE}</b>", module_header))
|
|
152
180
|
hdr_page.append(Spacer(1, 20))
|
|
153
|
-
hdr_page.append(Paragraph(f"
|
|
154
|
-
hdr_page.append(Paragraph(f"
|
|
155
|
-
hdr_page.append(Paragraph(f"
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if
|
|
159
|
-
hdr_page.append(Paragraph(f"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
hdr_page.append(Paragraph(f"
|
|
181
|
+
hdr_page.append(Paragraph(f"<u>{RUN_INFO}:</u>", bold_text_style))
|
|
182
|
+
hdr_page.append(Paragraph(f"{RUN_DATETIME}: {start_time.strftime('%d/%m/%Y, %H:%M:%S')}", bold_text_style))
|
|
183
|
+
hdr_page.append(Paragraph(f"{RUN_DUR}: {str(duration).split('.')[0]}", bold_text_style))
|
|
184
|
+
hdr_page.append(Paragraph(f"{CERT_VER}: {CERT_VERSION}", bold_text_style))
|
|
185
|
+
hdr_page.append(Spacer(1, 10))
|
|
186
|
+
if brg:
|
|
187
|
+
hdr_page.append(Paragraph(f"<u>{TESTED_DEVICE_INFO}:</u>", bold_text_style))
|
|
188
|
+
hdr_page.append(Paragraph(f"{BRG} {BLE_MAC_ADDRESS}: {brg.id_str}", bold_text_style))
|
|
189
|
+
hdr_page.append(Paragraph(f"{BRG} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[brg.board_type]}", bold_text_style))
|
|
190
|
+
hdr_page.append(Paragraph(f"{BRG} {BLE_VER}: {brg.version}", bold_text_style))
|
|
191
|
+
hdr_page.append(Paragraph(f"{BRG} {SUP_API_VER}: {brg.api_version}", bold_text_style))
|
|
192
|
+
hdr_page.append(Spacer(1, 10))
|
|
193
|
+
if internal_brg:
|
|
194
|
+
hdr_page.append(Paragraph(f"<u>{TESTING_DEVICE_INFO}:</u>", bold_text_style))
|
|
195
|
+
hdr_page.append(Paragraph(f"{SIM} {BLE_MAC_ADDRESS}: {internal_brg.id_str}", bold_text_style))
|
|
196
|
+
hdr_page.append(Paragraph(f"{SIM} {BOARD_TYPE}: {ag.BOARD_TYPES_LIST[internal_brg.board_type]}", bold_text_style))
|
|
197
|
+
hdr_page.append(Paragraph(f"{SIM} {BLE_VER}: {internal_brg.version}", bold_text_style))
|
|
198
|
+
hdr_page.append(Paragraph(f"{SIM} {SUP_API_VER}: {internal_brg.api_version}", bold_text_style))
|
|
163
199
|
hdr_page.append(Spacer(1, 20))
|
|
164
200
|
|
|
165
201
|
# Count Table
|
|
@@ -168,7 +204,7 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
168
204
|
[len(tests)-(failures+skipped), skipped, failures, len(tests)]
|
|
169
205
|
]
|
|
170
206
|
count_table = Table(count_data)
|
|
171
|
-
count_table.setStyle(
|
|
207
|
+
count_table.setStyle(inner_table_style('CENTER'))
|
|
172
208
|
hdr_page.append(count_table)
|
|
173
209
|
hdr_page.append(Spacer(1, 20))
|
|
174
210
|
|
|
@@ -176,27 +212,35 @@ def generate_results_files(html=True, pdf=True, failures=0, skipped=0, start_tim
|
|
|
176
212
|
results_per_module = generate_results_per_module_for_pdf(tests=tests)
|
|
177
213
|
summary_data = []
|
|
178
214
|
for module, test_results in results_per_module.items():
|
|
179
|
-
|
|
180
|
-
|
|
215
|
+
module_objects = []
|
|
216
|
+
module_skipped = True # Remains True if all tests are skipped
|
|
217
|
+
module_objects.append(Paragraph(f"<b>{module + ' Module' if not 'Edge' in module else module}</b>", module_header))
|
|
218
|
+
module_objects.append(Spacer(1, 20))
|
|
181
219
|
for test_result in test_results:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
220
|
+
test_objects = []
|
|
221
|
+
name = Paragraph(f'<a href="#{module}_{test_result.name}">{test_result.name}</a>', centered_text_style) if not test_result.test_skipped else test_result.name
|
|
222
|
+
summary_data += [[module, name, test_result.result, test_result.compliance]]
|
|
223
|
+
test_objects.append(Paragraph(f'<a name="{module}_{test_result.name}"/><a href="{test_result.kb_link}">{test_result.name}</a>', test_header))
|
|
224
|
+
test_objects.append(Spacer(1, 10))
|
|
225
|
+
test_objects.append(test_result.result)
|
|
226
|
+
test_objects.append(Spacer(1, 10))
|
|
227
|
+
test_objects.append(Paragraph(test_result.purpose, test_purpose))
|
|
228
|
+
test_objects.append(Spacer(1, 10))
|
|
229
|
+
if not test_result.test_skipped:
|
|
230
|
+
module_skipped = False # Set to False if at least one test isn't skipped
|
|
231
|
+
test_objects.append(Paragraph(f"Tested devices: {test_result.devices}", bold_text_style))
|
|
232
|
+
test_objects.append(Paragraph(f"Test duration: {test_result.duration}", bold_text_style))
|
|
233
|
+
test_objects.append(Spacer(1, 10))
|
|
234
|
+
test_objects.append(test_result.test_table)
|
|
235
|
+
test_objects.append(Spacer(1, 10))
|
|
236
|
+
test_objects.append(Paragraph(f"<a href='#{SUMMARY_HEADLINE}'>Back to {SUMMARY_HEADLINE}</a>", bold_right_text_style))
|
|
237
|
+
test_objects.append(Spacer(1, 20))
|
|
238
|
+
module_objects.append(KeepTogether(test_objects))
|
|
239
|
+
if not module_skipped:
|
|
240
|
+
elements += module_objects
|
|
241
|
+
elements.append(PageBreak())
|
|
242
|
+
summary_table = Table([["Module", "Name", "Result", "Compliance"]] + summary_data)
|
|
243
|
+
summary_table.setStyle(inner_table_style('LEFT'))
|
|
200
244
|
elements = hdr_page + [summary_table, PageBreak()] + elements
|
|
201
245
|
|
|
202
246
|
doc.build(elements)
|
|
@@ -279,17 +323,19 @@ HTML_END = """
|
|
|
279
323
|
# PDF
|
|
280
324
|
##################################
|
|
281
325
|
STYLES_PDF = {
|
|
282
|
-
"
|
|
326
|
+
"BLACK_HEADER": ParagraphStyle("Black Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.black, alignment=TA_CENTER),
|
|
283
327
|
"RED_HEADER": ParagraphStyle("Red Header", fontName="Helvetica-Bold", fontSize=20, textColor=colors.red, alignment=TA_CENTER),
|
|
284
328
|
"MODULE_HEADER": ParagraphStyle("Module Header", fontName="Helvetica-Bold", fontSize=16, textColor=colors.navy, alignment=TA_CENTER),
|
|
285
|
-
"TEST_HEADER": ParagraphStyle("Test Header", fontName="Helvetica-Bold", fontSize=12, textColor=colors.black, alignment=
|
|
286
|
-
"
|
|
329
|
+
"TEST_HEADER": ParagraphStyle("Test Header", fontName="Helvetica-Bold", fontSize=12, textColor=colors.black, alignment=TA_LEFT),
|
|
330
|
+
"TEST_LINK_HEADER": ParagraphStyle('Test Link Header', fontName="Helvetica-Bold", fontSize=14, textColor=colors.blue, alignment=TA_LEFT),
|
|
331
|
+
"BLACK": ParagraphStyle("Black", fontName="Helvetica", fontSize=9, textColor=colors.black, splitLongWords=False, alignment=TA_LEFT, wordWrap = 'CJK'),
|
|
287
332
|
"BLACK_BOLD": ParagraphStyle("Black Bold", fontName="Helvetica-Bold", fontSize=9, textColor=colors.black, splitLongWords=False, alignment=TA_LEFT, wordWrap = 'CJK'),
|
|
333
|
+
"BLUE_BOLD_RIGHT": ParagraphStyle("Black Bold", fontName="Helvetica-Bold", fontSize=9, textColor=colors.blue, splitLongWords=False, alignment=TA_RIGHT, wordWrap = 'CJK'),
|
|
288
334
|
"BLUE": ParagraphStyle("Blue", fontName="Helvetica-Bold", fontSize=9, textColor=colors.navy, splitLongWords=False, alignment=TA_CENTER),
|
|
289
|
-
"CYAN": ParagraphStyle("Cyan", fontName="Helvetica-Bold", fontSize=9, textColor=colors.cyan, splitLongWords=False, alignment=
|
|
290
|
-
"GREEN": ParagraphStyle("Green", fontName="Helvetica-Bold", fontSize=9, textColor=colors.green, splitLongWords=False, alignment=
|
|
291
|
-
"WARNING": ParagraphStyle("Warning", fontName="Helvetica-Bold", fontSize=9, textColor=colors.gold, splitLongWords=False, alignment=
|
|
292
|
-
"RED": ParagraphStyle("Red", fontName="Helvetica-Bold", fontSize=9, textColor=colors.red, splitLongWords=False, alignment=
|
|
335
|
+
"CYAN": ParagraphStyle("Cyan", fontName="Helvetica-Bold", fontSize=9, textColor=colors.cyan, splitLongWords=False, alignment=TA_LEFT),
|
|
336
|
+
"GREEN": ParagraphStyle("Green", fontName="Helvetica-Bold", fontSize=9, textColor=colors.green, splitLongWords=False, alignment=TA_LEFT),
|
|
337
|
+
"WARNING": ParagraphStyle("Warning", fontName="Helvetica-Bold", fontSize=9, textColor=colors.gold, splitLongWords=False, alignment=TA_LEFT),
|
|
338
|
+
"RED": ParagraphStyle("Red", fontName="Helvetica-Bold", fontSize=9, textColor=colors.red, splitLongWords=False, alignment=TA_LEFT),
|
|
293
339
|
}
|
|
294
340
|
def color_pdf(c, t):
|
|
295
341
|
style = STYLES_PDF.get(c, ParagraphStyle("Default"))
|
|
@@ -298,31 +344,32 @@ pdf_result_map = {TEST_FAILED: color_pdf("RED", "FAILED"), TEST_SKIPPED: color_p
|
|
|
298
344
|
TEST_PASSED: color_pdf("GREEN", "PASSED"), TEST_INIT: color_pdf("CYAN", "INIT")}
|
|
299
345
|
pass_or_fail_pdf = lambda obj : pdf_result_map[obj.rc]
|
|
300
346
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
347
|
+
inner_table_style = lambda align : TableStyle([
|
|
348
|
+
('BACKGROUND', (0, 0), (-1, 0), colors.grey),
|
|
349
|
+
('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
|
|
350
|
+
('ALIGN', (0, 0), (-1, -1), f'{align}'),
|
|
351
|
+
('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
|
|
352
|
+
('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
|
|
353
|
+
('FONTSIZE', (0, 0), (-1, 0), 9),
|
|
354
|
+
('BOTTOMPADDING', (0, 0), (-1, 0), 12),
|
|
355
|
+
('BACKGROUND', (0, 1), (-1, -1), colors.whitesmoke),
|
|
356
|
+
('WORDWRAP', (0, 0), (-1, -1), False),
|
|
357
|
+
])
|
|
312
358
|
|
|
313
359
|
def generate_results_per_module_for_pdf(tests=[]):
|
|
314
360
|
text_style = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
315
361
|
results_per_module = {}
|
|
316
362
|
for test in tests:
|
|
317
|
-
name=test.module_name if (not test.internal_brg or "gw" in test.module_name) else f"{test.module_name} (internal brg)"
|
|
318
363
|
devices_to_print = (test.gw if not test.brg0 or test.gw_only else
|
|
319
364
|
(f"{test.brg0.id_str}\n{test.brg1.id_str}" if test.brg1 and test.multi_brg else test.brg0.id_str))
|
|
320
|
-
inner_table = [[Paragraph(phase.name, text_style), pass_or_fail_pdf(phase), Paragraph(phase.reason, text_style)] for phase in test.phases]
|
|
365
|
+
inner_table = [[Paragraph(param_name_to_title(phase.name), text_style), pass_or_fail_pdf(phase), Paragraph(phase.reason, text_style)] for phase in test.phases]
|
|
321
366
|
test_table = Table([["Phase", "Result", "Notes"]] + inner_table)
|
|
322
|
-
test_table.setStyle(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
367
|
+
test_table.setStyle(inner_table_style('LEFT'))
|
|
368
|
+
compliance = "Mandatory" if test.test_json[MANDATORY] else "Optional"
|
|
369
|
+
test_result = TestResult(name=test.test_json[NAME], devices_to_print=devices_to_print, test_table=test_table, result=pass_or_fail_pdf(test),
|
|
370
|
+
duration=test.duration, purpose=str(test.test_json[PURPOSE]), compliance=compliance,
|
|
371
|
+
kb_link=test.test_json[DOCUMENTATION], test_skipped=(test.rc == TEST_SKIPPED))
|
|
372
|
+
module_name = test.test_json[MODULE]
|
|
326
373
|
if module_name not in results_per_module:
|
|
327
374
|
results_per_module[module_name] = [test_result]
|
|
328
375
|
else:
|
brg_certificate/cert_utils.py
CHANGED
|
@@ -43,20 +43,25 @@ 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=
|
|
46
|
+
cert_results.generate_results_files(html=True, pdf=False, start_time=start_time, duration=duration, error=error, pipeline=cert_common.pipeline_running())
|
|
47
47
|
sys.exit(-1)
|
|
48
48
|
|
|
49
49
|
##################################
|
|
50
50
|
# Test
|
|
51
51
|
##################################
|
|
52
52
|
class WltTest:
|
|
53
|
-
def __init__(self, line, gw, mqttc, brg0=None, brg1=None, exit_on_param_failure=False, gw_lan=False,
|
|
53
|
+
def __init__(self, line, gw, mqttc, sim_mqttc=None, brg0=None, brg1=None, exit_on_param_failure=False, gw_lan=False,
|
|
54
54
|
gw_orig_versions={}, server=PROD, latest=False, release_candidate=False, private_setup=False,
|
|
55
55
|
internal_brg_obj=None, gw_sim='', data='', port='', protobuf=False):
|
|
56
56
|
if line:
|
|
57
57
|
test_list_line = line.strip().split()
|
|
58
58
|
self.name = test_list_line[0]
|
|
59
|
-
self.test_module =
|
|
59
|
+
self.test_module = ag.MODULE_EMPTY # Default test module
|
|
60
|
+
# Determine test's module
|
|
61
|
+
for s in self.name.split('/'):
|
|
62
|
+
if s in TEST_MODULES_MAP:
|
|
63
|
+
self.test_module = TEST_MODULES_MAP[s]
|
|
64
|
+
break
|
|
60
65
|
line_params = test_list_line[1:]
|
|
61
66
|
self.dir = os.path.join("tests", self.name)
|
|
62
67
|
self.module_name = os.path.join(os.path.basename(self.name))
|
|
@@ -88,6 +93,7 @@ class WltTest:
|
|
|
88
93
|
self.end_time = None
|
|
89
94
|
self.duration = None
|
|
90
95
|
self.mqttc = mqttc
|
|
96
|
+
self.sim_mqttc = sim_mqttc
|
|
91
97
|
self.rtsa = ""
|
|
92
98
|
self.exit_on_param_failure = exit_on_param_failure
|
|
93
99
|
self.rand = random.randrange(255)
|
|
@@ -268,9 +274,9 @@ def handle_prep_brg_for_latest(test, interface, start_time):
|
|
|
268
274
|
def ut_prep_brg(args, mqttc, start_time, gw, brg, gw_server, protobuf):
|
|
269
275
|
brg = Bridge(brg)
|
|
270
276
|
utPrint(SEP)
|
|
271
|
-
if not
|
|
277
|
+
if not cert_common.is_cert_running:
|
|
272
278
|
versions_mgmt = load_module('versions_mgmt.py', f'{UTILS_BASE_REL_PATH}/versions_mgmt.py')
|
|
273
|
-
brg_owner = versions_mgmt.gw_brg_owner(env=
|
|
279
|
+
brg_owner = versions_mgmt.gw_brg_owner(env=AWS, server=PROD, brg=brg.id_str)
|
|
274
280
|
if brg_owner and not brg_owner in r_codes:
|
|
275
281
|
print_warn(f"BRG {brg.id_str} owned by account {brg_owner}")
|
|
276
282
|
test = WltTest("", gw, mqttc, brg0=brg, gw_lan=args.lan, server=gw_server, exit_on_param_failure=args.exit_on_param_failure,
|
|
@@ -320,10 +326,10 @@ def get_gw_id(gw):
|
|
|
320
326
|
else:
|
|
321
327
|
return gw
|
|
322
328
|
|
|
323
|
-
def ut_prep_gw(args, mqttc, start_time):
|
|
329
|
+
def ut_prep_gw(args, mqttc, start_time, tester_gw=False):
|
|
324
330
|
# Check GW is online and configure to defaults
|
|
325
331
|
utPrint(SEP)
|
|
326
|
-
gw = args.gw
|
|
332
|
+
gw = args.brg_cloud_connectivity if args.brg_cloud_connectivity and not tester_gw else args.gw
|
|
327
333
|
test = WltTest("", gw, mqttc, gw_lan=args.lan)
|
|
328
334
|
utPrint(f"Getting GW {gw} Information", "BLUE")
|
|
329
335
|
response = cert_common.get_gw_info(test)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# The certificate should run for every bridge change
|
|
2
|
+
# The setup will include 1 tested BRG with cloud connectivity + 1 GW connected with UART or remotely
|
|
3
|
+
# Run command example with COM PORT connection:
|
|
4
|
+
# python brg_certificate_cli.py --gw SIM --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_sanity_test_list.txt --data sim --port <COM_PORT>
|
|
5
|
+
# Run command example with remote GW connection:
|
|
6
|
+
# python brg_certificate_cli.py --gw <GWYYYYYYYYYYYY> --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_sanity_test_list.txt --data sim
|
|
7
|
+
|
|
8
|
+
# ------------- edge_mgmt -------------
|
|
9
|
+
edge_mgmt/periodic_msgs_test
|
|
10
|
+
edge_mgmt/actions_test ACTION_GW_HB ACTION_BLINK ACTION_SEND_HB ACTION_GET_BATTERY_SENSOR ACTION_GET_POF_DATA ACTION_PL_STATUS ACTION_GET_MODULE ACTION_REBOOT ACTION_RESTORE_DEFAULTS
|
|
11
|
+
|
|
12
|
+
# ------------- energy2400 -------------
|
|
13
|
+
energy2400/pattern_test ENERGY_PATTERN_2_4_CHANNEL_37 ENERGY_PATTERN_2_4_CHANNEL_39 ENERGY_PATTERN_2_4_FREQ_2454
|
|
14
|
+
energy2400/output_power_test -12 0 3
|
|
15
|
+
energy2400/duty_cycle_test 1 50 75
|
|
16
|
+
energy2400/signal_indicator_test internal_brg brg0_rxtx_brg1_rxtx
|
|
17
|
+
|
|
18
|
+
# ------------- energy_sub1g -------------
|
|
19
|
+
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
|
|
20
|
+
energy_sub1g/duty_cycle_test 15 20 40 0
|
|
21
|
+
energy_sub1g/signal_indicator_test 60,4
|
|
22
|
+
|
|
23
|
+
# ------------- datapath -------------
|
|
24
|
+
datapath/rssi_threshold_test -80
|
|
25
|
+
datapath/pattern_test DATAPATH_PATTERN_38_38_39 DATAPATH_PATTERN_EU_PATTERN
|
|
26
|
+
datapath/output_power_test -12 0 3
|
|
27
|
+
datapath/pkt_filter_test PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT
|
|
28
|
+
datapath/pkt_filter_gen3_test PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT
|
|
29
|
+
datapath/pkt_filter_ble5_test PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT
|
|
30
|
+
datapath/rx_channel_test RX_CHANNEL_37 RX_CHANNEL_38 RX_CHANNEL_10_250K RX_CHANNEL_10_500K
|
|
31
|
+
datapath/aging_test low_pacer
|
|
32
|
+
datapath/num_of_tags_test 500
|
|
33
|
+
|
|
34
|
+
# ------------- calibration -------------
|
|
35
|
+
calibration/output_power_test -12 0 3
|
|
36
|
+
calibration/interval_test 1 25 50
|
|
37
|
+
calibration/pattern_test CALIBRATION_PATTERN_38_38_39 CALIBRATION_PATTERN_DISABLE_BEACON
|
|
38
|
+
|
|
39
|
+
# ------------- sensors -------------
|
|
40
|
+
sensors/ext_sensor_test tag_data_only rssi_threshold snsr0_scrmbl_snsr1_no_scrmbl
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# The certificate should run for every bridge change
|
|
2
|
+
# The setup will include 1 tested BRG with cloud connectivity + 1 GW connected with UART or remotely
|
|
3
|
+
# Run command example with COM PORT connection:
|
|
4
|
+
# python brg_certificate_cli.py --gw SIM --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt --data sim --port <COM_PORT>
|
|
5
|
+
# Run command example with remote GW connection:
|
|
6
|
+
# python brg_certificate_cli.py --gw <GWYYYYYYYYYYYY> --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt --data sim
|
|
7
|
+
|
|
8
|
+
# ------------- edge_mgmt -------------
|
|
9
|
+
edge_mgmt/periodic_msgs_test
|
|
10
|
+
edge_mgmt/actions_test ACTION_GW_HB ACTION_BLINK ACTION_SEND_HB ACTION_GET_BATTERY_SENSOR ACTION_GET_POF_DATA ACTION_PL_STATUS ACTION_GET_MODULE ACTION_REBOOT ACTION_RESTORE_DEFAULTS
|
|
11
|
+
|
|
12
|
+
# ------------- energy2400 -------------
|
|
13
|
+
energy2400/pattern_test ENERGY_PATTERN_2_4_NO_ENERGIZING ENERGY_PATTERN_2_4_CHANNEL_37 ENERGY_PATTERN_2_4_CHANNEL_38 ENERGY_PATTERN_2_4_CHANNEL_39 ENERGY_PATTERN_2_4_FREQ_2450 ENERGY_PATTERN_2_4_FREQ_2454
|
|
14
|
+
energy2400/output_power_test -12 -8 -4 0 2 3
|
|
15
|
+
energy2400/duty_cycle_test 1 25 50 75
|
|
16
|
+
energy2400/signal_indicator_test internal_brg rssi_threshold brg0_rx_brg1_tx brg0_none_brg1_rx brg0_rxtx_brg1_rxtx brg0_tx_brg1_none
|
|
17
|
+
energy2400/signal_indicator_ble5_10_500k_test internal_brg rssi_threshold brg0_rx_brg1_tx brg0_none_brg1_rx brg0_rxtx_brg1_rxtx brg0_tx_brg1_none
|
|
18
|
+
energy2400/signal_indicator_ble5_10_250k_test internal_brg rssi_threshold brg0_rx_brg1_tx brg0_none_brg1_rx brg0_rxtx_brg1_rxtx brg0_tx_brg1_none
|
|
19
|
+
|
|
20
|
+
# ------------- energy_sub1g -------------
|
|
21
|
+
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
|
|
22
|
+
energy_sub1g/duty_cycle_test 15 20 40 0
|
|
23
|
+
energy_sub1g/signal_indicator_test 60,4 100,3
|
|
24
|
+
|
|
25
|
+
# ------------- datapath -------------
|
|
26
|
+
datapath/rssi_threshold_test -80 -65 -10
|
|
27
|
+
datapath/pattern_test DATAPATH_PATTERN_38_38_39 DATAPATH_PATTERN_EU_PATTERN
|
|
28
|
+
datapath/output_power_test -12 -8 -4 0 2 3
|
|
29
|
+
datapath/pacer_interval_test 5 15 30 60
|
|
30
|
+
datapath/pacer_interval_ble5_test 5 15 30 60
|
|
31
|
+
datapath/pkt_filter_test PKT_FILTER_RANDOM_FIRST_ARRIVING_PKT PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT PKT_FILTER_ADVANCED_PKT PKT_FILTER_TEMP_AND_ADVANCED_PKTS PKT_FILTER_TEMP_ADVANCED_AND_DEBUG_PKTS
|
|
32
|
+
datapath/pkt_filter_gen3_test PKT_FILTER_RANDOM_FIRST_ARRIVING_PKT PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT PKT_FILTER_ADVANCED_PKT PKT_FILTER_TEMP_AND_ADVANCED_PKTS
|
|
33
|
+
datapath/pkt_filter_ble5_test PKT_FILTER_RANDOM_FIRST_ARRIVING_PKT PKT_FILTER_DISABLE_FORWARDING PKT_FILTER_TEMP_PKT PKT_FILTER_ADVANCED_PKT PKT_FILTER_TEMP_AND_ADVANCED_PKTS
|
|
34
|
+
datapath/rx_channel_test RX_CHANNEL_37 RX_CHANNEL_38 RX_CHANNEL_39 RX_CHANNEL_10_250K RX_CHANNEL_10_500K
|
|
35
|
+
datapath/rx_rate_gen2_test mid_values diff_pacer min_value max_value diff_rate
|
|
36
|
+
datapath/rx_rate_gen3_test mid_values diff_pacer min_value max_value diff_rate
|
|
37
|
+
datapath/pacer_interval_tags_count_test 1 10 15 30
|
|
38
|
+
datapath/aging_test low_pacer high_pacer
|
|
39
|
+
datapath/num_of_tags_test 5000
|
|
40
|
+
|
|
41
|
+
# ------------- pwr_mgmt -------------
|
|
42
|
+
pwr_mgmt/pwr_mgmt_test
|
|
43
|
+
|
|
44
|
+
# ------------- calibration -------------
|
|
45
|
+
calibration/output_power_test -12 -8 -4 0 2 3
|
|
46
|
+
calibration/interval_test 1 25 50
|
|
47
|
+
calibration/pattern_test CALIBRATION_PATTERN_38_38_39 CALIBRATION_PATTERN_STANDARD CALIBRATION_PATTERN_EU_PATTERN CALIBRATION_PATTERN_DISABLE_BEACON
|
|
48
|
+
|
|
49
|
+
# ------------- sensors -------------
|
|
50
|
+
sensors/ext_sensor_test tag_data_only rssi_threshold snsr0_no_scrmbl snsr1_scrmbl snsr0_scrmbl_snsr1_no_scrmbl snsr0_scrmbl_snsr1_scrmbl
|