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
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
from brg_certificate.cert_prints import *
|
|
2
|
+
from brg_certificate.cert_defines import *
|
|
3
|
+
from brg_certificate.wlt_types import *
|
|
4
|
+
import brg_certificate.cert_common as cert_common
|
|
5
|
+
import brg_certificate.cert_config as cert_config
|
|
6
|
+
import brg_certificate.cert_mqtt as cert_mqtt
|
|
7
|
+
import csv
|
|
8
|
+
# test MACROS definitions #
|
|
9
|
+
DEFAULT_SENSOR_PAYLOAD_DATA = "0200002929B0FFF98DB104FA68BD5491456B55CC18AADB"
|
|
10
|
+
DEFAULT_ADVA0 = "112233445566"
|
|
11
|
+
DEFAULT_ADVA1 = "778899AABBCC"
|
|
12
|
+
ERM_SMART_MS_PAYLOAD = "0201060303374C17FFAE0421EF9DE99CE7AE7C5EB13B744D401CC6CFCF0107"
|
|
13
|
+
ZEBRA_PRINTER_PAYLOAD = "0201020F0958585A564A323331363038333435030279FEA5A5A5A5A5A5A5A5"
|
|
14
|
+
DEFAULT_SPECIAL_PAYLOAD = ZEBRA_PRINTER_PAYLOAD
|
|
15
|
+
DEFAULT_PACKET_LENGTH = "1E"
|
|
16
|
+
|
|
17
|
+
SCAN_TIMEOUT = 60
|
|
18
|
+
|
|
19
|
+
# UUID defines for logs review #
|
|
20
|
+
ERM_SMART_MS_UUID = 0xFFAE04
|
|
21
|
+
ZEBRA_PRINTER_UUID = 0x0279FE
|
|
22
|
+
UUID_0 = ZEBRA_PRINTER_UUID
|
|
23
|
+
UUID_1 = 0x987654
|
|
24
|
+
SCRAMBLE_ON = 0x01
|
|
25
|
+
SCRAMBLE_OFF = 0x00
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def uuid_scramble_cfg_add(uuid, scramble):
|
|
29
|
+
return uuid << 8 | scramble
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def unscramble(packet):
|
|
33
|
+
unscrambled_packet_id = int(hex(packet[RSSI])[2:] + packet[SENSOR_ID][-6:], 16) # transforming parameters string to hex format
|
|
34
|
+
for idx in range(6, 60, 8):
|
|
35
|
+
current_word = int(packet[PAYLOAD][idx: idx + 8], 16)
|
|
36
|
+
unscrambled_packet_id ^= current_word
|
|
37
|
+
return packet[PAYLOAD][8:-8] + hex(unscrambled_packet_id)[2:]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def find_packet_in_csv(unscrambled_payload):
|
|
41
|
+
base_path = os.path.dirname(os.path.abspath(__file__))
|
|
42
|
+
with open(f'{base_path}/out_sensor_data.csv', 'r') as csv_file:
|
|
43
|
+
csv_reader = csv.DictReader(csv_file)
|
|
44
|
+
next(csv_reader) # stepping over the header line
|
|
45
|
+
for line in csv_reader:
|
|
46
|
+
raw_data_payload = line['raw packet'][20:]
|
|
47
|
+
if raw_data_payload[:8] == unscrambled_payload[:8]:
|
|
48
|
+
return True
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# Test functions description #
|
|
53
|
+
def create_csv_file_in(test, length=500):
|
|
54
|
+
if test.data != DATA_SIMULATION:
|
|
55
|
+
return []
|
|
56
|
+
else:
|
|
57
|
+
base_path = os.path.dirname(os.path.abspath(__file__))
|
|
58
|
+
pkts = []
|
|
59
|
+
payload_0 = DEFAULT_ADVA0 + DEFAULT_SPECIAL_PAYLOAD
|
|
60
|
+
payload_1 = DEFAULT_ADVA1 + DEFAULT_PACKET_LENGTH + cert_common.int2mac_get(UUID_1)[6:] + DEFAULT_SENSOR_PAYLOAD_DATA
|
|
61
|
+
with open(f"{base_path}/in_sensor_data.csv", "w+") as f:
|
|
62
|
+
f.write("raw packet,output power,delay,duplicates,channel,COM\n")
|
|
63
|
+
for i in range(length):
|
|
64
|
+
f.write(payload_0 + ",8,200,6,37,COM3\n")
|
|
65
|
+
f.write(payload_1 + "{:08X}".format(i) + ",8,200,6,37,COM3\n")
|
|
66
|
+
pkts.append(payload_0)
|
|
67
|
+
pkts.append(payload_1 + "{:08X}".format(i))
|
|
68
|
+
return pkts
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def create_csv_file_out(test):
|
|
72
|
+
if test.data != DATA_SIMULATION:
|
|
73
|
+
return
|
|
74
|
+
else:
|
|
75
|
+
base_path = os.path.dirname(os.path.abspath(__file__))
|
|
76
|
+
uuid_0 = cert_common.int2mac_get(UUID_0)[6:]
|
|
77
|
+
with (open(f"{base_path}/in_sensor_data.csv", "r") as csv_in,
|
|
78
|
+
open(f"{base_path}/out_sensor_data.csv", "w") as csv_out):
|
|
79
|
+
csv_out.write("raw packet,output power,delay,duplicates,channel,COM\n")
|
|
80
|
+
csv_in = csv.DictReader(csv_in)
|
|
81
|
+
next(csv_in) # stepping over the header line
|
|
82
|
+
for line in csv_in:
|
|
83
|
+
input_payload = line['raw packet'][12:]
|
|
84
|
+
if uuid_0 in input_payload:
|
|
85
|
+
csv_out.write(DEFAULT_ADVA0 + process_sensor_payload(input_payload, uuid_0) + ",8,200,6,37,COM3\n")
|
|
86
|
+
else:
|
|
87
|
+
csv_out.write(line['raw packet'] + ",8,200,6,37,COM3\n")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def process_sensor_payload(payload, uuid):
|
|
91
|
+
uuid_idx = payload.find(uuid)
|
|
92
|
+
if uuid_idx == -1:
|
|
93
|
+
raise ValueError(f"Pattern {uuid_idx} not found in the packet")
|
|
94
|
+
|
|
95
|
+
len = int(payload[uuid_idx - 2:uuid_idx], 16)
|
|
96
|
+
segment_start_idx = uuid_idx - 2
|
|
97
|
+
segment_end_idx = uuid_idx + len * 2
|
|
98
|
+
segment = payload[segment_start_idx:segment_end_idx]
|
|
99
|
+
output = segment + payload[:segment_start_idx] + payload[segment_end_idx:]
|
|
100
|
+
return output
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def pkts_get(test, phase):
|
|
104
|
+
test.mqttc.flush_pkts()
|
|
105
|
+
mqtt_scan_wait(test, duration=SCAN_TIMEOUT)
|
|
106
|
+
sensor_pkts = cert_mqtt.get_all_sensor_pkts(test)
|
|
107
|
+
generate_log_file(test, phase)
|
|
108
|
+
|
|
109
|
+
if len(sensor_pkts) == 0:
|
|
110
|
+
if phase != "tag_data_only" and phase != "rssi_threshold":
|
|
111
|
+
test.rc = TEST_FAILED
|
|
112
|
+
test.add_reason(f"Phase {phase} failed - didn't find any sensor packets")
|
|
113
|
+
else:
|
|
114
|
+
if phase == "tag_data_only":
|
|
115
|
+
test.rc = TEST_FAILED
|
|
116
|
+
test.add_reason(f"Phase {phase} failed - found sensor packets")
|
|
117
|
+
sensor0_pkts = [p[SENSOR_UUID] == f"{UUID_0:06X}" for p in sensor_pkts]
|
|
118
|
+
if phase == "snsr0_scrmbl_snsr1_no_scrmbl" or phase == "snsr0_scrmbl_snsr1_scrmbl" or phase == "snsr0_no_scrmbl":
|
|
119
|
+
if not any(sensor0_pkts):
|
|
120
|
+
test.rc = TEST_FAILED
|
|
121
|
+
test.add_reason(f"Phase {phase} failed - didn't find any sensor0 packets")
|
|
122
|
+
sensor1_pkts = [p[SENSOR_UUID] == f"{UUID_1:06X}" for p in sensor_pkts]
|
|
123
|
+
if phase == "snsr0_scrmbl_snsr1_no_scrmbl" or phase == "snsr0_scrmbl_snsr1_scrmbl" or phase == "snsr1_scrmbl":
|
|
124
|
+
if not any(sensor1_pkts):
|
|
125
|
+
test.rc = TEST_FAILED
|
|
126
|
+
test.add_reason(f"Phase {phase} failed - didn't find any sensor1 packets")
|
|
127
|
+
|
|
128
|
+
return sensor_pkts
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def test_tag_data_only(test, phase, _):
|
|
132
|
+
pkts_get(test, phase)
|
|
133
|
+
return test
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def test_rssi_threshold(test, phase, ext_sensors_module):
|
|
137
|
+
rssi_threshold = -25
|
|
138
|
+
# Config
|
|
139
|
+
utPrint(f"UUID_0 only without scrambling, RSSI Threshold = {rssi_threshold}\n", "BLUE")
|
|
140
|
+
sensor0 = uuid_scramble_cfg_add(UUID_0, SCRAMBLE_OFF)
|
|
141
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module,
|
|
142
|
+
fields=[BRG_SENSOR0, BRG_RSSI_THRESHOLD], values=[sensor0, rssi_threshold])[0]
|
|
143
|
+
# Analyze
|
|
144
|
+
sensor_pkts = pkts_get(test, phase)
|
|
145
|
+
if test.rc == TEST_FAILED:
|
|
146
|
+
return test
|
|
147
|
+
rssi_threshold_viloation_pkts = [p for p in sensor_pkts if p[RSSI] >= -1 * rssi_threshold]
|
|
148
|
+
if rssi_threshold_viloation_pkts:
|
|
149
|
+
test.rc = TEST_FAILED
|
|
150
|
+
test.add_reason("rssi_threshold phase failed - received"
|
|
151
|
+
f" {len(rssi_threshold_viloation_pkts)} sensor packets\n with RSSI weaker than {rssi_threshold}")
|
|
152
|
+
return test
|
|
153
|
+
return test
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_snsr0_no_scrmbl(test, phase, ext_sensors_module):
|
|
157
|
+
# Config
|
|
158
|
+
utPrint("UUID_0 only without scrambling - UUID is 0x{:06X}".format(UUID_0), "BLUE")
|
|
159
|
+
sensor0 = uuid_scramble_cfg_add(UUID_0, SCRAMBLE_OFF)
|
|
160
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0], values=[sensor0])[0]
|
|
161
|
+
if test.rc == TEST_FAILED:
|
|
162
|
+
test.add_reason(f"Configuration for phase {phase} failed")
|
|
163
|
+
return test
|
|
164
|
+
# Analyze
|
|
165
|
+
sensor_pkts = pkts_get(test, phase)
|
|
166
|
+
if test.rc == TEST_FAILED:
|
|
167
|
+
return test
|
|
168
|
+
for p in sensor_pkts:
|
|
169
|
+
if p[SENSOR_UUID] != "{:06X}".format(UUID_0):
|
|
170
|
+
test.rc = TEST_FAILED
|
|
171
|
+
test.add_reason(f"Phase {phase} failed - received packets from an un-registered sensor")
|
|
172
|
+
return test
|
|
173
|
+
unscrambled_payload = p[PAYLOAD][8:]
|
|
174
|
+
if find_packet_in_csv(unscrambled_payload) is False:
|
|
175
|
+
test.rc = TEST_FAILED
|
|
176
|
+
test.add_reason(f"Phase {phase} failed - couldn't find unscrambled payload")
|
|
177
|
+
return test
|
|
178
|
+
return test
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def test_snsr1_scrmbl(test, phase, ext_sensors_module):
|
|
182
|
+
# Config
|
|
183
|
+
utPrint("UUID_1 only with scrambling - UUID is 0x{:06X}".format(UUID_1), "BLUE")
|
|
184
|
+
sensor1 = uuid_scramble_cfg_add(UUID_1, SCRAMBLE_ON)
|
|
185
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR1], values=[sensor1])[0]
|
|
186
|
+
if test.rc == TEST_FAILED:
|
|
187
|
+
test.add_reason(f"Configuration for phase {phase} failed")
|
|
188
|
+
return test
|
|
189
|
+
# Analyze
|
|
190
|
+
sensor_pkts = pkts_get(test, phase)
|
|
191
|
+
if test.rc == TEST_FAILED:
|
|
192
|
+
return test
|
|
193
|
+
for p in sensor_pkts:
|
|
194
|
+
if p[SENSOR_UUID] != "{:06X}".format(UUID_1):
|
|
195
|
+
test.rc = TEST_FAILED
|
|
196
|
+
test.add_reason(f"Phase {phase} failed - received packets from an un-registered sensor")
|
|
197
|
+
return test
|
|
198
|
+
unscrambled_payload = unscramble(p)
|
|
199
|
+
if find_packet_in_csv(unscrambled_payload) is False:
|
|
200
|
+
test.rc = TEST_FAILED
|
|
201
|
+
test.add_reason(f"Phase {phase} failed - scrambling algorithm error")
|
|
202
|
+
return test
|
|
203
|
+
return test
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def test_snsr0_scrmbl_snsr1_no_scrmbl(test, phase, ext_sensors_module):
|
|
207
|
+
# Config
|
|
208
|
+
print(f"UUID_0 with scrambling, UUID_1 without scrambling, {SCAN_TIMEOUT} sec\n")
|
|
209
|
+
sensor0 = uuid_scramble_cfg_add(UUID_0, SCRAMBLE_ON)
|
|
210
|
+
sensor1 = uuid_scramble_cfg_add(UUID_1, SCRAMBLE_OFF)
|
|
211
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_SENSOR1], values=[sensor0, sensor1])[0]
|
|
212
|
+
if test.rc == TEST_FAILED:
|
|
213
|
+
test.add_reason(f"Configuration for phase {phase} failed")
|
|
214
|
+
return test
|
|
215
|
+
# Analyze
|
|
216
|
+
sensor_pkts = pkts_get(test, phase)
|
|
217
|
+
if test.rc == TEST_FAILED:
|
|
218
|
+
return test
|
|
219
|
+
for p in sensor_pkts:
|
|
220
|
+
if p[SENSOR_UUID] == "{:06X}".format(UUID_0):
|
|
221
|
+
unscrambled_payload = unscramble(p)
|
|
222
|
+
if find_packet_in_csv(unscrambled_payload) is False:
|
|
223
|
+
test.rc = TEST_FAILED
|
|
224
|
+
test.add_reason(f"Phase {phase} failed - scrambling algorithm error")
|
|
225
|
+
return test
|
|
226
|
+
if p[SENSOR_UUID] == "{:06X}".format(UUID_1):
|
|
227
|
+
unscrambled_payload = p[PAYLOAD][8:]
|
|
228
|
+
if find_packet_in_csv(unscrambled_payload) is False:
|
|
229
|
+
test.rc = TEST_FAILED
|
|
230
|
+
test.add_reason(f"Phase {phase} failed - couldn't find unscrambled payload")
|
|
231
|
+
return test
|
|
232
|
+
return test
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def test_snsr0_scrmbl_snsr1_scrmbl(test, phase, ext_sensors_module):
|
|
236
|
+
# Config
|
|
237
|
+
utPrint(f"UUID_0 with scrambling, UUID_1 with scrambling, {SCAN_TIMEOUT} sec\n", "BLUE")
|
|
238
|
+
sensor0 = uuid_scramble_cfg_add(UUID_0, SCRAMBLE_ON)
|
|
239
|
+
sensor1 = uuid_scramble_cfg_add(UUID_1, SCRAMBLE_ON)
|
|
240
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_SENSOR1], values=[sensor0, sensor1])[0]
|
|
241
|
+
if test.rc == TEST_FAILED:
|
|
242
|
+
return test
|
|
243
|
+
# Analyze
|
|
244
|
+
sensor_pkts = pkts_get(test, phase)
|
|
245
|
+
if test.rc == TEST_FAILED:
|
|
246
|
+
return test
|
|
247
|
+
for p in sensor_pkts:
|
|
248
|
+
unscrambled_payload = unscramble(p)
|
|
249
|
+
if find_packet_in_csv(unscrambled_payload) is False:
|
|
250
|
+
test.rc = TEST_FAILED
|
|
251
|
+
test.add_reason(f"Phase {phase} failed - scrambling algorithm error")
|
|
252
|
+
return test
|
|
253
|
+
return test
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
EXT_SENSOR_TEST_MAP = {"tag_data_only": test_tag_data_only,
|
|
257
|
+
"rssi_threshold": test_rssi_threshold,
|
|
258
|
+
"snsr0_no_scrmbl": test_snsr0_no_scrmbl,
|
|
259
|
+
"snsr1_scrmbl": test_snsr1_scrmbl,
|
|
260
|
+
"snsr0_scrmbl_snsr1_no_scrmbl": test_snsr0_scrmbl_snsr1_no_scrmbl,
|
|
261
|
+
"snsr0_scrmbl_snsr1_scrmbl": test_snsr0_scrmbl_snsr1_scrmbl}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def run(test):
|
|
265
|
+
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
266
|
+
ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
|
|
267
|
+
test = cert_common.test_prolog(test)
|
|
268
|
+
# check for problems in prolog
|
|
269
|
+
if test.rc == TEST_FAILED:
|
|
270
|
+
test = cert_common.test_epilog(test)
|
|
271
|
+
return test
|
|
272
|
+
|
|
273
|
+
# Adaptation of GW configuration for internal BRG test
|
|
274
|
+
if test.internal_brg:
|
|
275
|
+
test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_37], module=datapath_module, wait=True)[0]
|
|
276
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
277
|
+
return cert_common.test_epilog(test, revert_gws=True)
|
|
278
|
+
|
|
279
|
+
# create csv file for the test
|
|
280
|
+
in_pkts = create_csv_file_in(test)
|
|
281
|
+
create_csv_file_out(test)
|
|
282
|
+
|
|
283
|
+
if test.data == DATA_SIMULATION:
|
|
284
|
+
# start generating sensor pkts and send them using data simulator
|
|
285
|
+
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=len(in_pkts), duplicates=6, delay=200,
|
|
286
|
+
pkt_types=[0], pixels_type=RAW_DATA, pkts=in_pkts)
|
|
287
|
+
pixel_sim_thread.start()
|
|
288
|
+
ble_sim_thread = pixel_sim_thread
|
|
289
|
+
|
|
290
|
+
for param in test.params:
|
|
291
|
+
functionality_run_print(param.name)
|
|
292
|
+
test = EXT_SENSOR_TEST_MAP[param.value](test, param.name, ext_sensors_module)
|
|
293
|
+
field_functionality_pass_fail_print(test, param.name)
|
|
294
|
+
test.set_phase_rc(param.name, test.rc)
|
|
295
|
+
test.add_phase_reason(param.name, test.reason)
|
|
296
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
297
|
+
field_functionality_pass_fail_print(test, 'phase', param.name)
|
|
298
|
+
break
|
|
299
|
+
else:
|
|
300
|
+
test.reset_result()
|
|
301
|
+
|
|
302
|
+
# Kill the ble simulator
|
|
303
|
+
if test.data == DATA_SIMULATION:
|
|
304
|
+
ble_sim_thread.stop()
|
|
305
|
+
|
|
306
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[ext_sensors_module, datapath_module])
|
brg_certificate/wltPb_pb2.py
CHANGED
|
@@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bwltPb.proto\x12\x05wltPb\"$\n\x08Location\x12\x0b\n\x03lat\x18\x01 \x01(\x01\x12\x0b\n\x03lng\x18\x02 \x01(\x01\"j\n\x05Value\x12\x16\n\x0cintegerValue\x18\x01 \x01(\x03H\x00\x12\x15\n\x0bnumberValue\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bstringValue\x18\x03 \x01(\tH\x00\x12\x13\n\tboolValue\x18\x04 \x01(\x08H\x00\x42\x06\n\x04type\"\x89\x02\n\x0bGatewayData\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12*\n\x07packets\x18\x03 \x03(\x0b\x32\x19.wltPb.GatewayData.Packet\x12&\n\x08location\x18\x04 \x01(\x0b\x32\x0f.wltPb.LocationH\x00\x88\x01\x01\x1as\n\x06Packet\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12\x12\n\nsequenceId\x18\x03 \x01(\r\x12\x11\n\x04rssi\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x15\n\raliasBridgeId\x18\x05 \x01(\tB\x07\n\x05_rssiB\x0b\n\t_location\"\xc9\x01\n\rUplinkMessage\x12-\n\rgatewayStatus\x18\x01 \x01(\x0b\x32\x14.wltPb.GatewayStatusH\x00\x12)\n\x0bgatewayInfo\x18\x02 \x01(\x0b\x32\x12.wltPb.GatewayInfoH\x00\x12)\n\x0bgatewayLogs\x18\x03 \x01(\x0b\x32\x12.wltPb.GatewayLogsH\x00\x12+\n\x0c\x61\x63tionStatus\x18\x04 \x01(\x0b\x32\x13.wltPb.ActionStatusH\x00\x42\x06\n\x04type\"&\n\x03\x41\x43L\x12\x12\n\nmode_allow\x18\x01 \x01(\x08\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\"\x97\x01\n\x12GatewayConfigValue\x12\x16\n\x0cintegerValue\x18\x01 \x01(\x03H\x00\x12\x15\n\x0bnumberValue\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bstringValue\x18\x03 \x01(\tH\x00\x12\x13\n\tboolValue\x18\x04 \x01(\x08H\x00\x12\x1e\n\x08\x61\x63lValue\x18\x05 \x01(\x0b\x32\n.wltPb.ACLH\x00\x42\x06\n\x04type\"\xe8\x03\n\rGatewayStatus\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x13\n\x0bgatewayType\x18\x02 \x01(\t\x12\x19\n\x11\x64ownlinkSupported\x18\x03 \x01(\x08\x12!\n\x19\x62ridgeOtaUpgradeSupported\x18\x04 \x01(\x08\x12\x12\n\napiVersion\x18\x05 \x01(\r\x12\x14\n\x07version\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62leSwVersion\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12interfaceSwVersion\x18\x08 \x01(\tH\x02\x88\x01\x01\x12&\n\x08location\x18\t \x01(\x0b\x32\x0f.wltPb.LocationH\x03\x88\x01\x01\x12\x30\n\x06\x63onfig\x18\n \x03(\x0b\x32 .wltPb.GatewayStatus.ConfigEntry\x12\x17\n\nbleAddress\x18\x0b \x01(\tH\x04\x88\x01\x01\x1aH\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.wltPb.GatewayConfigValue:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_locationB\r\n\x0b_bleAddress\"}\n\x0bGatewayInfo\x12\x30\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1f.wltPb.GatewayInfo.EntriesEntry\x1a<\n\x0c\x45ntriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\"\x1b\n\x0bGatewayLogs\x12\x0c\n\x04logs\x18\x01 \x03(\t\"
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0bwltPb.proto\x12\x05wltPb\"$\n\x08Location\x12\x0b\n\x03lat\x18\x01 \x01(\x01\x12\x0b\n\x03lng\x18\x02 \x01(\x01\"j\n\x05Value\x12\x16\n\x0cintegerValue\x18\x01 \x01(\x03H\x00\x12\x15\n\x0bnumberValue\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bstringValue\x18\x03 \x01(\tH\x00\x12\x13\n\tboolValue\x18\x04 \x01(\x08H\x00\x42\x06\n\x04type\"\x89\x02\n\x0bGatewayData\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12*\n\x07packets\x18\x03 \x03(\x0b\x32\x19.wltPb.GatewayData.Packet\x12&\n\x08location\x18\x04 \x01(\x0b\x32\x0f.wltPb.LocationH\x00\x88\x01\x01\x1as\n\x06Packet\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12\x12\n\nsequenceId\x18\x03 \x01(\r\x12\x11\n\x04rssi\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x15\n\raliasBridgeId\x18\x05 \x01(\tB\x07\n\x05_rssiB\x0b\n\t_location\"\xc9\x01\n\rUplinkMessage\x12-\n\rgatewayStatus\x18\x01 \x01(\x0b\x32\x14.wltPb.GatewayStatusH\x00\x12)\n\x0bgatewayInfo\x18\x02 \x01(\x0b\x32\x12.wltPb.GatewayInfoH\x00\x12)\n\x0bgatewayLogs\x18\x03 \x01(\x0b\x32\x12.wltPb.GatewayLogsH\x00\x12+\n\x0c\x61\x63tionStatus\x18\x04 \x01(\x0b\x32\x13.wltPb.ActionStatusH\x00\x42\x06\n\x04type\"&\n\x03\x41\x43L\x12\x12\n\nmode_allow\x18\x01 \x01(\x08\x12\x0b\n\x03ids\x18\x02 \x03(\x0c\"\x97\x01\n\x12GatewayConfigValue\x12\x16\n\x0cintegerValue\x18\x01 \x01(\x03H\x00\x12\x15\n\x0bnumberValue\x18\x02 \x01(\x01H\x00\x12\x15\n\x0bstringValue\x18\x03 \x01(\tH\x00\x12\x13\n\tboolValue\x18\x04 \x01(\x08H\x00\x12\x1e\n\x08\x61\x63lValue\x18\x05 \x01(\x0b\x32\n.wltPb.ACLH\x00\x42\x06\n\x04type\"\xe8\x03\n\rGatewayStatus\x12\x11\n\tgatewayId\x18\x01 \x01(\t\x12\x13\n\x0bgatewayType\x18\x02 \x01(\t\x12\x19\n\x11\x64ownlinkSupported\x18\x03 \x01(\x08\x12!\n\x19\x62ridgeOtaUpgradeSupported\x18\x04 \x01(\x08\x12\x12\n\napiVersion\x18\x05 \x01(\r\x12\x14\n\x07version\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62leSwVersion\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12interfaceSwVersion\x18\x08 \x01(\tH\x02\x88\x01\x01\x12&\n\x08location\x18\t \x01(\x0b\x32\x0f.wltPb.LocationH\x03\x88\x01\x01\x12\x30\n\x06\x63onfig\x18\n \x03(\x0b\x32 .wltPb.GatewayStatus.ConfigEntry\x12\x17\n\nbleAddress\x18\x0b \x01(\tH\x04\x88\x01\x01\x1aH\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.wltPb.GatewayConfigValue:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_locationB\r\n\x0b_bleAddress\"}\n\x0bGatewayInfo\x12\x30\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1f.wltPb.GatewayInfo.EntriesEntry\x1a<\n\x0c\x45ntriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\"\x1b\n\x0bGatewayLogs\x12\x0c\n\x04logs\x18\x01 \x03(\t\"\x92\x01\n\x0c\x41\x63tionStatus\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\r\x12\x0e\n\x06status\x18\x02 \x01(\r\x12\x11\n\x04step\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08progress\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08\x62ridgeId\x18\x05 \x01(\x0cH\x02\x88\x01\x01\x42\x07\n\x05_stepB\x0b\n\t_progressB\x0b\n\t_bridgeId\"\x8e\x02\n\x0f\x44ownlinkMessage\x12#\n\x08txPacket\x18\x01 \x01(\x0b\x32\x0f.wltPb.TxPacketH\x00\x12-\n\rgatewayAction\x18\x02 \x01(\x0b\x32\x14.wltPb.GatewayActionH\x00\x12-\n\rbridgeUpgrade\x18\x03 \x01(\x0b\x32\x14.wltPb.BridgeUpgradeH\x00\x12-\n\rgatewayConfig\x18\x04 \x01(\x0b\x32\x14.wltPb.GatewayConfigH\x00\x12-\n\rcustomMessage\x18\x06 \x01(\x0b\x32\x14.wltPb.CustomMessageH\x00\x42\x06\n\x04typeJ\x04\x08\x05\x10\x06R\x0c\x63ustomBroker\"F\n\x08TxPacket\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x12\n\nmaxRetries\x18\x02 \x01(\r\x12\x15\n\rmaxDurationMs\x18\x03 \x01(\r\"\x1f\n\rGatewayAction\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\"\xa5\x01\n\rBridgeUpgrade\x12\x14\n\x0crebootPacket\x18\x01 \x01(\x0c\x12\x17\n\x0ftxMaxDurationMs\x18\x02 \x01(\r\x12\x14\n\x0ctxMaxRetries\x18\x03 \x01(\r\x12\x10\n\x08\x62ridgeId\x18\x04 \x01(\t\x12\x13\n\x0bversionUuid\x18\x05 \x01(\t\x12\x13\n\x0bupgradeBlSd\x18\x06 \x01(\x08\x12\x13\n\x0bimageDirUrl\x18\x07 \x01(\t\"\xc6\x02\n\rGatewayConfig\x12\x14\n\x07version\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0c\x62leSwVersion\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x1f\n\x12interfaceSwVersion\x18\x03 \x01(\tH\x02\x88\x01\x01\x12&\n\x08location\x18\x04 \x01(\x0b\x32\x0f.wltPb.LocationH\x03\x88\x01\x01\x12\x30\n\x06\x63onfig\x18\x05 \x03(\x0b\x32 .wltPb.GatewayConfig.ConfigEntry\x1aH\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.wltPb.GatewayConfigValue:\x02\x38\x01\x42\n\n\x08_versionB\x0f\n\r_bleSwVersionB\x15\n\x13_interfaceSwVersionB\x0b\n\t_location\"\x81\x01\n\rCustomMessage\x12\x32\n\x07\x65ntries\x18\x01 \x03(\x0b\x32!.wltPb.CustomMessage.EntriesEntry\x1a<\n\x0c\x45ntriesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.wltPb.Value:\x02\x38\x01\x62\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -63,22 +63,22 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
63
63
|
_globals['_GATEWAYINFO_ENTRIESENTRY']._serialized_end=1450
|
|
64
64
|
_globals['_GATEWAYLOGS']._serialized_start=1452
|
|
65
65
|
_globals['_GATEWAYLOGS']._serialized_end=1479
|
|
66
|
-
_globals['_ACTIONSTATUS']._serialized_start=
|
|
67
|
-
_globals['_ACTIONSTATUS']._serialized_end=
|
|
68
|
-
_globals['_DOWNLINKMESSAGE']._serialized_start=
|
|
69
|
-
_globals['_DOWNLINKMESSAGE']._serialized_end=
|
|
70
|
-
_globals['_TXPACKET']._serialized_start=
|
|
71
|
-
_globals['_TXPACKET']._serialized_end=
|
|
72
|
-
_globals['_GATEWAYACTION']._serialized_start=
|
|
73
|
-
_globals['_GATEWAYACTION']._serialized_end=
|
|
74
|
-
_globals['_BRIDGEUPGRADE']._serialized_start=
|
|
75
|
-
_globals['_BRIDGEUPGRADE']._serialized_end=
|
|
76
|
-
_globals['_GATEWAYCONFIG']._serialized_start=
|
|
77
|
-
_globals['_GATEWAYCONFIG']._serialized_end=
|
|
66
|
+
_globals['_ACTIONSTATUS']._serialized_start=1482
|
|
67
|
+
_globals['_ACTIONSTATUS']._serialized_end=1628
|
|
68
|
+
_globals['_DOWNLINKMESSAGE']._serialized_start=1631
|
|
69
|
+
_globals['_DOWNLINKMESSAGE']._serialized_end=1901
|
|
70
|
+
_globals['_TXPACKET']._serialized_start=1903
|
|
71
|
+
_globals['_TXPACKET']._serialized_end=1973
|
|
72
|
+
_globals['_GATEWAYACTION']._serialized_start=1975
|
|
73
|
+
_globals['_GATEWAYACTION']._serialized_end=2006
|
|
74
|
+
_globals['_BRIDGEUPGRADE']._serialized_start=2009
|
|
75
|
+
_globals['_BRIDGEUPGRADE']._serialized_end=2174
|
|
76
|
+
_globals['_GATEWAYCONFIG']._serialized_start=2177
|
|
77
|
+
_globals['_GATEWAYCONFIG']._serialized_end=2503
|
|
78
78
|
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_start=1171
|
|
79
79
|
_globals['_GATEWAYCONFIG_CONFIGENTRY']._serialized_end=1243
|
|
80
|
-
_globals['_CUSTOMMESSAGE']._serialized_start=
|
|
81
|
-
_globals['_CUSTOMMESSAGE']._serialized_end=
|
|
80
|
+
_globals['_CUSTOMMESSAGE']._serialized_start=2506
|
|
81
|
+
_globals['_CUSTOMMESSAGE']._serialized_end=2635
|
|
82
82
|
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_start=1390
|
|
83
83
|
_globals['_CUSTOMMESSAGE_ENTRIESENTRY']._serialized_end=1450
|
|
84
84
|
# @@protoc_insertion_point(module_scope)
|
brg_certificate/wltPb_pb2.pyi
CHANGED
|
@@ -137,12 +137,18 @@ class GatewayLogs(_message.Message):
|
|
|
137
137
|
def __init__(self, logs: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
138
138
|
|
|
139
139
|
class ActionStatus(_message.Message):
|
|
140
|
-
__slots__ = ("action", "status")
|
|
140
|
+
__slots__ = ("action", "status", "step", "progress", "bridgeId")
|
|
141
141
|
ACTION_FIELD_NUMBER: _ClassVar[int]
|
|
142
142
|
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
143
|
+
STEP_FIELD_NUMBER: _ClassVar[int]
|
|
144
|
+
PROGRESS_FIELD_NUMBER: _ClassVar[int]
|
|
145
|
+
BRIDGEID_FIELD_NUMBER: _ClassVar[int]
|
|
143
146
|
action: int
|
|
144
147
|
status: int
|
|
145
|
-
|
|
148
|
+
step: int
|
|
149
|
+
progress: int
|
|
150
|
+
bridgeId: bytes
|
|
151
|
+
def __init__(self, action: _Optional[int] = ..., status: _Optional[int] = ..., step: _Optional[int] = ..., progress: _Optional[int] = ..., bridgeId: _Optional[bytes] = ...) -> None: ...
|
|
146
152
|
|
|
147
153
|
class DownlinkMessage(_message.Message):
|
|
148
154
|
__slots__ = ("txPacket", "gatewayAction", "bridgeUpgrade", "gatewayConfig", "customMessage")
|
brg_certificate/wlt_types.py
CHANGED
gw_certificate/cert_results.py
CHANGED
|
@@ -39,6 +39,7 @@ def generate_pdf_results_file(gw_cert):
|
|
|
39
39
|
module_header = STYLES_PDF.get("MODULE_HEADER", ParagraphStyle("Default"))
|
|
40
40
|
test_header = STYLES_PDF.get("TEST_HEADER", ParagraphStyle("Default"))
|
|
41
41
|
text_style_bold = STYLES_PDF.get("BLACK_BOLD", ParagraphStyle("Default"))
|
|
42
|
+
text_style_centered = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
42
43
|
if gw_cert.error:
|
|
43
44
|
title = Paragraph(f"<b>Wiliot Gateway Certificate Error!</b>", red_header)
|
|
44
45
|
hdr_page.append(title)
|
|
@@ -50,11 +51,17 @@ def generate_pdf_results_file(gw_cert):
|
|
|
50
51
|
hdr_page.append(Spacer(1, 20))
|
|
51
52
|
hdr_page.append(Paragraph(f"<b>Summary</b>", module_header))
|
|
52
53
|
hdr_page.append(Spacer(1, 20))
|
|
54
|
+
hdr_page.append(Paragraph("<u>Run Info:</u>", text_style_bold))
|
|
53
55
|
hdr_page.append(Paragraph(f"Run date: {gw_cert.current_datetime.strftime('%d/%m/%Y, %H:%M:%S')}", text_style_bold))
|
|
54
56
|
hdr_page.append(Paragraph(f"Tests duration: {format_timedelta(gw_cert.runtime())}", text_style_bold))
|
|
55
57
|
hdr_page.append(Paragraph(f"Certificate version: {gw_cert.gw_cert_version}", text_style_bold))
|
|
56
|
-
hdr_page.append(
|
|
57
|
-
|
|
58
|
+
hdr_page.append(Spacer(1, 10))
|
|
59
|
+
if gw_cert.use_uart:
|
|
60
|
+
hdr_page.append(Paragraph("<u>Certification Kit Info:</u>", text_style_bold))
|
|
61
|
+
hdr_page.append(Paragraph(f"BLE simulator mac: {gw_cert.uart.mac}", text_style_bold))
|
|
62
|
+
hdr_page.append(Paragraph(f"BLE simulator version: {gw_cert.uart.fw_version}", text_style_bold))
|
|
63
|
+
hdr_page.append(Spacer(1, 10))
|
|
64
|
+
hdr_page.append(Paragraph("<u>Tested Device Info:</u>", text_style_bold))
|
|
58
65
|
hdr_page.append(Paragraph(f"Tested gateway ID: {gw_cert.gw_id}", text_style_bold))
|
|
59
66
|
hdr_page.append(Spacer(1, 20))
|
|
60
67
|
|
|
@@ -73,8 +80,8 @@ def generate_pdf_results_file(gw_cert):
|
|
|
73
80
|
text_style_center = STYLES_PDF.get("BLACK", ParagraphStyle("Default"))
|
|
74
81
|
text_style_left = STYLES_PDF.get("BLACK_LEFT", ParagraphStyle("Default"))
|
|
75
82
|
for test in gw_cert.tests:
|
|
76
|
-
summary_data += [[test, pass_or_fail_pdf(test), format_timedelta(test.duration)]]
|
|
77
|
-
elements.append(Paragraph(f"<b>{test
|
|
83
|
+
summary_data += [[Paragraph(f'<a href="#{test}">{test}</a>', text_style_centered), pass_or_fail_pdf(test), format_timedelta(test.duration)]]
|
|
84
|
+
elements.append(Paragraph(f"<a name='{test}'/><b>{test}</b>", module_header))
|
|
78
85
|
elements.append(Spacer(1, 20))
|
|
79
86
|
elements.append(pass_or_fail_pdf(test))
|
|
80
87
|
elements.append(Spacer(1, 10))
|
gw_certificate/gw_certificate.py
CHANGED
|
@@ -81,7 +81,6 @@ class GWCertificate:
|
|
|
81
81
|
debug_print(f'UART Ports:{self.uart_comports}')
|
|
82
82
|
if len(self.uart_comports) < 1:
|
|
83
83
|
self.error = "A Wiliot certification kit must be connected to USB!"
|
|
84
|
-
cert_results.generate_pdf_results_file(self)
|
|
85
84
|
raise GWCertificateError(self.error)
|
|
86
85
|
|
|
87
86
|
for port in self.uart_comports:
|
|
@@ -92,7 +91,6 @@ class GWCertificate:
|
|
|
92
91
|
debug_print(f'Port: {port} - {e}')
|
|
93
92
|
if type(self.uart) is not UARTInterface:
|
|
94
93
|
self.error = "Cannot initialize any port!"
|
|
95
|
-
cert_results.generate_pdf_results_file(self)
|
|
96
94
|
raise GWCertificateError(self.error)
|
|
97
95
|
self.ble_sim = BLESimulator(self.uart)
|
|
98
96
|
self.sniffer = BLESniffer(self.uart, logger_filepath=self.sniffer_logger_filepath)
|
|
@@ -27,8 +27,8 @@ def filter_actions(actions_names):
|
|
|
27
27
|
def main():
|
|
28
28
|
usage = (
|
|
29
29
|
"usage: wlt-gw-certificate [-h] -owner OWNER -gw GW\n"
|
|
30
|
-
f" [-tests {{connection, uplink, downlink, stress}}] [-update] [-pps {STRESS_DEFAULT_PPS}]\n"
|
|
31
|
-
"
|
|
30
|
+
f" [-tests {{connection, uplink, downlink, actions, stress}}] [-update] [-pps {STRESS_DEFAULT_PPS}]\n"
|
|
31
|
+
f" [-actions {{info, reboot, bridgeota}}] [-agg AGG] [-env {{prod, test, dev}}]"
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
parser = ArgumentParser(prog='wlt-gw-certificate',
|
|
@@ -43,7 +43,7 @@ def main():
|
|
|
43
43
|
help="Tests to run. Registration omitted by default.", required=False, nargs='+',
|
|
44
44
|
default=['connection', 'uplink', 'downlink', 'actions', 'stress'])
|
|
45
45
|
optional.add_argument('-actions', type=str, choices=['info', 'reboot', 'bridgeota'],
|
|
46
|
-
help="Action stages to run under ActionsTest", required=False, nargs='+', default=['info', 'reboot', '
|
|
46
|
+
help="Action stages to run under ActionsTest", required=False, nargs='+', default=['info', 'reboot', 'bridgeota'])
|
|
47
47
|
optional.add_argument('-update', action='store_true', help='Update test board firmware', default=False, required=False)
|
|
48
48
|
optional.add_argument('-pps', type=int, help='Single packets-per-second rate to simulate in the stress test',
|
|
49
49
|
choices=STRESS_DEFAULT_PPS, default=None, required=False)
|
|
@@ -167,7 +167,7 @@ class UARTInterface:
|
|
|
167
167
|
def check_fw_supported(self):
|
|
168
168
|
hex_version = version.parse(os.path.splitext(os.path.basename(LATEST_VERSION_PATH))[0].split('_')[0])
|
|
169
169
|
if self.fw_version >= hex_version:
|
|
170
|
-
debug_print(f'
|
|
170
|
+
debug_print(f'Certification kit version {self.fw_version}')
|
|
171
171
|
return True
|
|
172
172
|
return False
|
|
173
173
|
|
gw_certificate/tests/actions.py
CHANGED
|
@@ -128,7 +128,7 @@ class BridgeOTAStage(GenericActionsStage):
|
|
|
128
128
|
def __init__(self, **kwargs):
|
|
129
129
|
super().__init__(**kwargs, stage_name=type(self).__name__)
|
|
130
130
|
self.stage_tooltip = "Issues a bridge OTA action to the gateway. Expects it to upgrade the bridge"
|
|
131
|
-
self.error_summary = "
|
|
131
|
+
self.error_summary = "Bridge wasn't upgraded."
|
|
132
132
|
self.action = "Bridge Upgrade"
|
|
133
133
|
|
|
134
134
|
OTA_VERSIONS_TO_USE = ("4.4.52", "4.4.53")
|
|
@@ -195,6 +195,7 @@ class BridgeOTAStage(GenericActionsStage):
|
|
|
195
195
|
|
|
196
196
|
# Calculate whether stage pass/failed
|
|
197
197
|
if self.action_status is None or self.status_code != 0:
|
|
198
|
+
debug_print("Failed to receive an actionStatus message.")
|
|
198
199
|
self.stage_pass = MINIMUM_SCORE
|
|
199
200
|
self.add_to_stage_report(f"The bridge OTA test failed")
|
|
200
201
|
if self.action_status is None:
|
|
@@ -204,17 +205,22 @@ class BridgeOTAStage(GenericActionsStage):
|
|
|
204
205
|
elif self.status_code != 0:
|
|
205
206
|
self.add_to_stage_report(f"Uploaded actionStatus status value received is {self.status_code}.")
|
|
206
207
|
if self.current_version == self.desired_version:
|
|
208
|
+
debug_print("Bridge was upgraded successfully")
|
|
209
|
+
self.error_summary = "Failed to receive actionStatus message."
|
|
207
210
|
self.add_to_stage_report(f"Note that the bridge was actually upgraded successfully.")
|
|
211
|
+
self.add_to_stage_report(f"Reboot packet received {(self.reboot_packet_ts - self.start_time).total_seconds():.1f}s after start.")
|
|
208
212
|
self.add_to_stage_report(f"{GW_BRIDGE_OTA_DOC}")
|
|
209
213
|
else:
|
|
210
214
|
if self.current_version == self.desired_version:
|
|
211
215
|
self.stage_pass = PERFECT_SCORE
|
|
216
|
+
debug_print("Bridge was upgraded successfully, actionStatus message received")
|
|
212
217
|
self.add_to_stage_report(f"Bridge was upgraded and an actionStatus message was received from the gateway.")
|
|
213
218
|
self.add_to_stage_report(f"Action status received {(self.action_status_ts - self.start_time).total_seconds():.1f}s after start.")
|
|
214
219
|
self.add_to_stage_report(f"Reboot packet received {(self.reboot_packet_ts - self.start_time).total_seconds():.1f}s after start.")
|
|
215
220
|
self.add_to_stage_report(f"Action status received {(self.action_status_ts - self.reboot_packet_ts).total_seconds():.1f}s after reboot.")
|
|
216
221
|
else:
|
|
217
222
|
self.stage_pass = MINIMUM_SCORE
|
|
223
|
+
debug_print("Bridge failed to upgrade")
|
|
218
224
|
self.add_to_stage_report(f"The bridge OTA test failed")
|
|
219
225
|
self.add_to_stage_report(f"Uploaded actionStatus message indicated success although the bridge was not upgraded.")
|
|
220
226
|
|
|
@@ -66,6 +66,7 @@ class GenericRegistrationStage(GenericStage):
|
|
|
66
66
|
debug_print(f"Kick response:{response}")
|
|
67
67
|
|
|
68
68
|
def validate_kong_logs(self, endpoint:Literal['device-authorize', 'registry', 'token', 'refresh']):
|
|
69
|
+
message = None
|
|
69
70
|
try:
|
|
70
71
|
message = self.edge.get_kong_logs(self.gw_id)
|
|
71
72
|
except WiliotCloudError as wce:
|
|
@@ -78,7 +79,7 @@ class GenericRegistrationStage(GenericStage):
|
|
|
78
79
|
return False
|
|
79
80
|
elif status_code == None:
|
|
80
81
|
raise wce
|
|
81
|
-
if message.get('status_code') != 200:
|
|
82
|
+
if isinstance(message, dict) and message.get('status_code') != 200:
|
|
82
83
|
debug_print(f"Failed fetching logs, status_code:{message.get('status_code')}")
|
|
83
84
|
return False
|
|
84
85
|
|