wiliot-certificate 1.5.1a1__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/wlt_cmd_if.html +3 -2
- brg_certificate/brg_certificate_cli.py +18 -3
- brg_certificate/cert_common.py +82 -26
- brg_certificate/cert_data_sim.py +22 -4
- brg_certificate/cert_defines.py +10 -5
- brg_certificate/cert_gw_sim.py +4 -2
- brg_certificate/cert_mqtt.py +7 -6
- brg_certificate/cert_prints.py +14 -1
- brg_certificate/cert_protobuf.py +7 -7
- brg_certificate/cert_results.py +91 -64
- brg_certificate/cert_utils.py +9 -4
- brg_certificate/certificate_bcc_sanity_test_list.txt +10 -5
- brg_certificate/certificate_bcc_test_list.txt +14 -9
- brg_certificate/certificate_sanity_test_list.txt +10 -4
- brg_certificate/certificate_test_list.txt +13 -9
- brg_certificate/tests/calibration/interval_test/interval_test.json +2 -2
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +3 -2
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +2 -2
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
- brg_certificate/tests/datapath/aging_test/aging_test.json +4 -5
- brg_certificate/tests/datapath/aging_test/aging_test.py +39 -32
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- 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 +2 -2
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +2 -2
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +3 -3
- 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 +2 -2
- 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 +2 -2
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -3
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
- 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 +3 -3
- 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 +3 -3
- 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 +8 -8
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +102 -101
- brg_certificate/tests/datapath/stress_test/stress_test.json +14 -15
- brg_certificate/tests/datapath/stress_test/stress_test.py +102 -101
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +2 -2
- 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 +2 -2
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +2 -2
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -18
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +14 -8
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -8
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +2 -2
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +22 -9
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +2 -2
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +6 -5
- brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +3 -3
- 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 +3 -3
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +4 -3
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +3 -3
- 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 +5 -5
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +109 -112
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +5 -5
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +111 -114
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +12 -6
- 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 +4 -4
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +158 -172
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -2
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +4 -3
- 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 +13 -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 +2 -2
- 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/wlt_types.py +2 -1
- {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +40 -40
- {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +98 -94
- {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
- {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-1.5.1a1.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/wlt_types.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wiliot_certificate
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.2a1
|
|
4
4
|
Summary: A library for certifying Wiliot-compliant boards
|
|
5
5
|
Author-email: Wiliot <support@wiliot.com>
|
|
6
6
|
License: MIT License
|
|
@@ -79,21 +79,6 @@ Websocket Port: 80
|
|
|
79
79
|
|
|
80
80
|
More information can be found at https://mqtt.eclipseprojects.io/.
|
|
81
81
|
|
|
82
|
-
#### Connection Test
|
|
83
|
-
Processes status packet sent by the GW to the MQTT Broker and validates it according to API Version.
|
|
84
|
-
|
|
85
|
-
#### Uplink Test
|
|
86
|
-
Simulates Wiliot MEL and validates that data is uploaded correctly to the cloud.
|
|
87
|
-
|
|
88
|
-
#### Downlink Test
|
|
89
|
-
Publishes advertising actions (txPacket) via MQTT to the GW and validates their advertisements.
|
|
90
|
-
|
|
91
|
-
#### Actions Test
|
|
92
|
-
Publishes different actions via MQTT to the GW and validates the outcome.
|
|
93
|
-
|
|
94
|
-
#### Stress Test
|
|
95
|
-
Advertise Wiliot packets with incrementing delays to evaluate GW's capability in handling different packets-per-second rates.
|
|
96
|
-
|
|
97
82
|
#### GW Certificate Release Notes:
|
|
98
83
|
Release:
|
|
99
84
|
- Standalone wiliot-certificate package
|
|
@@ -138,33 +123,48 @@ Websocket Port: 80
|
|
|
138
123
|
|
|
139
124
|
More information can be found at https://mqtt.eclipseprojects.io/.
|
|
140
125
|
|
|
141
|
-
#### XXX Test
|
|
142
|
-
TEST EXPLANATION
|
|
143
|
-
|
|
144
126
|
#### BRG Certificate Release Notes:
|
|
145
127
|
1.3.0:
|
|
146
128
|
- FIRST VERSION
|
|
147
129
|
|
|
148
|
-
|
|
149
130
|
```
|
|
150
|
-
usage:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
--brg, -b BRG
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
--brg1, -b1 BRG1
|
|
161
|
-
--
|
|
162
|
-
--
|
|
163
|
-
|
|
164
|
-
--
|
|
165
|
-
--
|
|
166
|
-
--
|
|
167
|
-
--
|
|
168
|
-
--
|
|
169
|
-
--
|
|
131
|
+
usage: brg_certificate_cli.py [-h] [--brg BRG] [--brg_cloud_connectivity BRG_CLOUD_CONNECTIVITY] [--brg1 BRG1] --gw GW [--data {tags,sim}] [--port PORT] [--clean] [--tl TL] [--run RUN]
|
|
132
|
+
[--drun DRUN] [--exit_on_test_failure] [--exit_on_param_failure] [--analyze_interference]
|
|
133
|
+
|
|
134
|
+
Bridge Certificate CLI
|
|
135
|
+
|
|
136
|
+
options:
|
|
137
|
+
-h, --help show this help message and exit
|
|
138
|
+
--brg, -b BRG Bridge id to run on the tests
|
|
139
|
+
--brg_cloud_connectivity, -bcc BRG_CLOUD_CONNECTIVITY
|
|
140
|
+
Bridge with cloud connectivity id to run on the tests
|
|
141
|
+
--brg1, -b1 BRG1 Second bridge id to run on tests two bridges needed
|
|
142
|
+
--gw, -g GW GW id to run on the test, SIM prefix is used for Gateway simulation
|
|
143
|
+
--data, -d {tags,sim}
|
|
144
|
+
Choose if data generated from real tags or by simulation
|
|
145
|
+
--port, -p PORT Enable UT using UART connection for Gateway Simulation or Data Simulation
|
|
146
|
+
--clean Clean all logs
|
|
147
|
+
--tl TL Test list file to use
|
|
148
|
+
--run RUN String to filter tests to run
|
|
149
|
+
--drun DRUN String to filter tests not to run
|
|
150
|
+
--exit_on_test_failure
|
|
151
|
+
Stop running the tests if a test failed
|
|
152
|
+
--exit_on_param_failure
|
|
153
|
+
Sets exit_on_param_failure mode to true in order to prevent tests from continuing iteration over all possibilities in case of failure
|
|
154
|
+
--analyze_interference, -ai
|
|
155
|
+
Analyze interference before tests start (relevant only for Gateway Simulator)
|
|
156
|
+
|
|
157
|
+
run examples:
|
|
158
|
+
Run command example with COM PORT connection:
|
|
159
|
+
wlt-cert-brg --gw SIM --brg <XXXXXXXXXXXX> --port <COM_PORT>
|
|
160
|
+
Run command example with remote GW connection:
|
|
161
|
+
wlt-cert-brg --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX>
|
|
162
|
+
Run command example for running datapath module tests only:
|
|
163
|
+
wlt-cert-brg --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX> --run datapath
|
|
164
|
+
Run command example with sanity test list:
|
|
165
|
+
wlt-cert-brg --gw <YYYYYYYYYYYY> --brg <XXXXXXXXXXXX> --tl certificate_sanity_test_list.txt
|
|
166
|
+
Run command example with COM PORT connection for bridge with cloud connectivity:
|
|
167
|
+
wlt-cert-brg --gw SIM --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt --port <COM_PORT>
|
|
168
|
+
Run command example with remote GW connection for bridge with cloud connectivity:
|
|
169
|
+
wlt-cert-brg --gw <YYYYYYYYYYYY> --brg_cloud_connectivity <XXXXXXXXXXXX> --tl certificate_bcc_test_list.txt
|
|
170
170
|
```
|