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
|
@@ -20,7 +20,7 @@ import random
|
|
|
20
20
|
# brg module logic is working properly, and no tag packet is accidentally being treated as signal indicator packet.
|
|
21
21
|
# phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect
|
|
22
22
|
# to see signal indicator packets from both BRG's, according to the tx params.
|
|
23
|
-
# phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal
|
|
23
|
+
# phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicator packets.
|
|
24
24
|
# that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
|
|
25
25
|
|
|
26
26
|
|
|
@@ -29,7 +29,11 @@ DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
|
|
|
29
29
|
NUM_OF_SCANNING_CYCLE = 2
|
|
30
30
|
DEFAULT_SCAN_TIME = 60
|
|
31
31
|
SCAN_DELAY_TIME = 5
|
|
32
|
-
VALUES_DICT = {0:(5,3),1:(5,3),
|
|
32
|
+
VALUES_DICT = {0: (5, 3), 1: (5, 3),
|
|
33
|
+
2: (60, 4),
|
|
34
|
+
3: (ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP),
|
|
35
|
+
4: [(45, 3), (90, 4)],
|
|
36
|
+
5: (15, 1)}
|
|
33
37
|
CYCLE_IDX = 0
|
|
34
38
|
REP_IDX = 1
|
|
35
39
|
TX_BRG_IDX = 0
|
|
@@ -38,32 +42,16 @@ TEST_SUB1G_ENERGY_PATTERNS = [ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000, ag.SUB
|
|
|
38
42
|
ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_916300, ag.SUB1G_ENERGY_PATTERN_SINGLE_TONE_917500,
|
|
39
43
|
ag.SUB1G_ENERGY_PATTERN_AUSTRALIA, ag.SUB1G_ENERGY_PATTERN_ISRAEL, ag.SUB1G_ENERGY_PATTERN_NZ_HOPPING]
|
|
40
44
|
|
|
41
|
-
hex2id_get =lambda id_str : "{:012X}".format(id_str)
|
|
42
45
|
|
|
43
46
|
# Helper function #
|
|
44
47
|
def get_phase_tx_params_values(phase, brg):
|
|
45
48
|
if phase == 4:
|
|
46
|
-
return VALUES_DICT[phase][brg][CYCLE_IDX]
|
|
49
|
+
return VALUES_DICT[phase][brg][CYCLE_IDX], VALUES_DICT[phase][brg][REP_IDX]
|
|
47
50
|
else:
|
|
48
51
|
return VALUES_DICT[phase][CYCLE_IDX], VALUES_DICT[phase][REP_IDX]
|
|
49
52
|
|
|
50
|
-
# Test functions #
|
|
51
|
-
def mqtt_scan_n_create_log_file(test, duration, phase):
|
|
52
|
-
test.mqttc.flush_pkts()
|
|
53
|
-
mqtt_scan_wait(test, duration=duration)
|
|
54
|
-
generate_log_file(test, phase)
|
|
55
|
-
|
|
56
|
-
def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
|
|
57
|
-
if rx_brg == test.brg1:
|
|
58
|
-
all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
59
|
-
elif rx_brg == test.brg0:
|
|
60
|
-
all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
61
|
-
signal_ind_pkts = []
|
|
62
|
-
for p in all_sensor_packets:
|
|
63
|
-
if p[SENSOR_UUID] == "{:06X}".format(ag.SENSOR_SERVICE_ID_SIGNAL_INDICATOR) and p[BRIDGE_ID] == rx_brg.id_str and p[SENSOR_ID] == tx_brg.id_str:
|
|
64
|
-
signal_ind_pkts.append(p)
|
|
65
|
-
return signal_ind_pkts
|
|
66
53
|
|
|
54
|
+
# Test functions #
|
|
67
55
|
def terminate_test(test, phase=0, revert_rx_brg=False, revert_tx_brg=False, modules=[]):
|
|
68
56
|
# Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
|
|
69
57
|
utPrint("Terminating test!!!!!!!!\n", "BLUE")
|
|
@@ -73,8 +61,7 @@ def terminate_test(test, phase=0, revert_rx_brg=False, revert_tx_brg=False, modu
|
|
|
73
61
|
test, response = cert_config.config_brg1_defaults(test, modules=restore_modules)
|
|
74
62
|
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
75
63
|
test.rc = TEST_FAILED
|
|
76
|
-
test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
|
|
77
|
-
f"{restore_modules} to default configuration!")
|
|
64
|
+
test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules {restore_modules} to default configuration!")
|
|
78
65
|
|
|
79
66
|
if revert_tx_brg:
|
|
80
67
|
restore_modules = [modules[0]] if (test.internal_brg or phase != 4) else modules
|
|
@@ -82,11 +69,10 @@ def terminate_test(test, phase=0, revert_rx_brg=False, revert_tx_brg=False, modu
|
|
|
82
69
|
test, response = cert_config.config_brg_defaults(test, modules=restore_modules)
|
|
83
70
|
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
84
71
|
test.rc = TEST_FAILED
|
|
85
|
-
test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
|
|
86
|
-
f"{restore_modules} to default configuration!")
|
|
72
|
+
test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules {restore_modules} to default configuration!")
|
|
87
73
|
return cert_common.test_epilog(test)
|
|
88
74
|
|
|
89
|
-
|
|
75
|
+
|
|
90
76
|
def run(test):
|
|
91
77
|
|
|
92
78
|
# Test modules evaluation #
|
|
@@ -120,36 +106,37 @@ def run(test):
|
|
|
120
106
|
|
|
121
107
|
# configuring RX #
|
|
122
108
|
utPrint(f"Configuring BRG {rx_brg_.id_str} as SUB1G Signal Indicator Receiver", "BOLD")
|
|
123
|
-
test =
|
|
124
|
-
|
|
109
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_SUB1G_RSSI_THRESHOLD],
|
|
110
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold])[0]
|
|
125
111
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
126
112
|
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
127
113
|
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
128
|
-
utPrint(f"BRG {rx_brg_.id_str}
|
|
114
|
+
utPrint(f"BRG {rx_brg_.id_str} successfully configured to be Receiver", "GREEN")
|
|
129
115
|
|
|
130
116
|
# configuring TX #
|
|
131
117
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as SUB1G Signal Indicator Transmitter\n", "BOLD")
|
|
132
118
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
133
|
-
|
|
119
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
120
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
134
121
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
135
122
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
136
123
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
137
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
138
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
124
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
125
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
139
126
|
f"repetition = {tx_signal_ind_rep}, pattern = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
140
|
-
|
|
127
|
+
|
|
141
128
|
# Analyzing RSSI Threshold violation #
|
|
142
129
|
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
143
|
-
received_signal_ind_pkts =
|
|
144
|
-
|
|
145
|
-
if
|
|
130
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
131
|
+
rssi_threshold_violation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1 * rssi_threshold]
|
|
132
|
+
if rssi_threshold_violation_pkts:
|
|
146
133
|
test.rc = TEST_FAILED
|
|
147
134
|
test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed" +
|
|
148
|
-
|
|
135
|
+
f" {len(rssi_threshold_violation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
|
|
149
136
|
|
|
150
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
137
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
151
138
|
if test.rc == TEST_FAILED:
|
|
152
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
139
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
153
140
|
|
|
154
141
|
phase = 1
|
|
155
142
|
functionality_run_print(f"phase {phase}")
|
|
@@ -161,49 +148,52 @@ def run(test):
|
|
|
161
148
|
|
|
162
149
|
# configuring RX #
|
|
163
150
|
utPrint(f"Configuring BRG {rx_brg_.id_str} as SUB1G Signal Indicator Receiver", "BOLD")
|
|
164
|
-
test =
|
|
151
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
|
|
152
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
|
|
165
153
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
166
154
|
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
167
155
|
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
168
|
-
utPrint(f"BRG {rx_brg_.id_str}
|
|
156
|
+
utPrint(f"BRG {rx_brg_.id_str} successfully configured to be Receiver", "GREEN")
|
|
169
157
|
|
|
170
158
|
for energy_pattern in TEST_SUB1G_ENERGY_PATTERNS:
|
|
171
159
|
utPrint(f"Energy pattern is {energy_pattern}", "WARNING")
|
|
172
160
|
|
|
173
161
|
# configuring RX BRG to desired pattern #
|
|
174
162
|
utPrint(f"Configuring RX BRG {rx_brg_.id_str} to EP {energy_pattern}", "BOLD")
|
|
175
|
-
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
163
|
+
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
164
|
+
pattern=energy_pattern, duty_cycle=30))
|
|
176
165
|
test = cert_config.brg1_configure(test=test, cfg_pkt=receiver_cfg_pkt)[0]
|
|
177
166
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
178
|
-
test.add_reason(f"
|
|
179
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
180
|
-
utPrint(f"Receiver BRG {rx_brg_.id_str}
|
|
167
|
+
test.add_reason(f"Receiver BRG {rx_brg_.id_str} didn't received sub1g EP configuration!")
|
|
168
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
169
|
+
utPrint(f"Receiver BRG {rx_brg_.id_str} successfully configured to desired sub1g EP", "GREEN")
|
|
181
170
|
|
|
182
171
|
# configuring TX #
|
|
183
172
|
# in sub1g must configure also the energy pattern
|
|
184
173
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as SUB1G Signal Indicator Transmitter\n", "BOLD")
|
|
185
174
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
186
|
-
|
|
175
|
+
signal_indicator_cycle=tx_signal_ind_cycle,
|
|
176
|
+
signal_indicator_rep=tx_signal_ind_rep, pattern=energy_pattern, duty_cycle=30))
|
|
187
177
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
188
178
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
189
179
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
190
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
191
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
180
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
181
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
192
182
|
f"repetition = {tx_signal_ind_rep}, pattern = {energy_pattern}", "GREEN")
|
|
193
183
|
|
|
194
184
|
# phase analysis #
|
|
195
185
|
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
196
186
|
expected_signal_ind_pkts = NUM_OF_SCANNING_CYCLE
|
|
197
|
-
received_signal_ind_pkts =
|
|
187
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
198
188
|
if len(received_signal_ind_pkts) < expected_signal_ind_pkts:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
field_functionality_pass_fail_print(test,'Energy pattern',energy_pattern)
|
|
189
|
+
test.rc = TEST_FAILED
|
|
190
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
191
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
192
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
193
|
+
field_functionality_pass_fail_print(test, 'Energy pattern', energy_pattern)
|
|
204
194
|
if test.rc == TEST_FAILED:
|
|
205
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
206
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
195
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
196
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
207
197
|
|
|
208
198
|
phase = 2
|
|
209
199
|
functionality_run_print(f"phase {phase}")
|
|
@@ -214,39 +204,40 @@ def run(test):
|
|
|
214
204
|
|
|
215
205
|
# configuring RX BRG to default pattern #
|
|
216
206
|
utPrint(f"Configuring BRG {rx_brg_.id_str} to default EP", "BOLD")
|
|
217
|
-
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
207
|
+
receiver_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
208
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
218
209
|
test = cert_config.brg1_configure(test=test, cfg_pkt=receiver_cfg_pkt)[0]
|
|
219
210
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
220
|
-
test.add_reason(f"
|
|
221
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
222
|
-
utPrint(f"Receiver BRG {rx_brg_.id_str}
|
|
211
|
+
test.add_reason(f"Receiver BRG {rx_brg_.id_str} didn't revert to default sub1g EP!")
|
|
212
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
213
|
+
utPrint(f"Receiver BRG {rx_brg_.id_str} successfully configured to desired sub1g EP", "GREEN")
|
|
223
214
|
|
|
224
215
|
# configuring transmitter, SUB1G_ENERGY_PATTERN_ISRAEL is must here because this is the receiver freq #
|
|
225
216
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter\n", "BOLD")
|
|
226
217
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
219
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL, duty_cycle=30))
|
|
229
220
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
230
221
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
231
222
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
232
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
233
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
234
|
-
|
|
223
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
224
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
225
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
235
226
|
|
|
236
227
|
# phase analysis #
|
|
237
|
-
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE*tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
228
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
238
229
|
expected_signal_ind_pkts = NUM_OF_SCANNING_CYCLE
|
|
239
|
-
received_signal_ind_pkts =
|
|
230
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
240
231
|
if (not len(received_signal_ind_pkts) or
|
|
241
232
|
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
242
233
|
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
234
|
+
test.rc = TEST_FAILED
|
|
235
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
236
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
237
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
238
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
248
239
|
if test.rc == TEST_FAILED:
|
|
249
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
240
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
250
241
|
|
|
251
242
|
phase = 3
|
|
252
243
|
functionality_run_print(f"phase {phase}")
|
|
@@ -262,19 +253,18 @@ def run(test):
|
|
|
262
253
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
263
254
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
264
255
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't revert to default (no signal indicator tx)!")
|
|
265
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
266
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
267
|
-
|
|
256
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
257
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to default!!! cycle = {tx_signal_ind_cycle},"
|
|
258
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
268
259
|
|
|
269
260
|
# phase analysis #
|
|
270
261
|
mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, phase)
|
|
271
262
|
expected_signal_ind_pkts = 0
|
|
272
|
-
received_signal_ind_pkts =
|
|
263
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
273
264
|
if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
265
|
+
test.rc = TEST_FAILED
|
|
266
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG {rx_brg_.id_str}")
|
|
267
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
278
268
|
if test.rc == TEST_FAILED:
|
|
279
269
|
return terminate_test(test, phase=phase, revert_rx_brg=True, modules=modules)
|
|
280
270
|
|
|
@@ -283,76 +273,80 @@ def run(test):
|
|
|
283
273
|
functionality_run_print(f"phase {phase}")
|
|
284
274
|
# Phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
|
|
285
275
|
# expecting to see signal indicator packets from both BRG's, according to the tx params.
|
|
286
|
-
utPrint(
|
|
276
|
+
utPrint("Both BRG's are transmitter and receivers, with different values\n", "HEADER")
|
|
287
277
|
|
|
288
278
|
# configuring first BRG (tx_brg_) #
|
|
289
279
|
tx_brg_signal_indicator_cycle, tx_brg_signal_indicator_rep = get_phase_tx_params_values(phase, TX_BRG_IDX)
|
|
290
280
|
# configuring first brg (tx_brg_) as receiver
|
|
291
281
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
292
|
-
test =
|
|
282
|
+
test = cert_config.brg_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
|
|
283
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
|
|
293
284
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
294
285
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
295
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
286
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
296
287
|
utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "GREEN")
|
|
297
288
|
# configuring first brg (tx_brg_) as transmitter
|
|
298
289
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
299
290
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
300
|
-
|
|
301
|
-
|
|
291
|
+
signal_indicator_cycle=tx_brg_signal_indicator_cycle,
|
|
292
|
+
signal_indicator_rep=tx_brg_signal_indicator_rep,
|
|
293
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
302
294
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
303
295
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
304
296
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
305
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
306
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
307
|
-
|
|
297
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
298
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be transmitter - cycle = {tx_brg_signal_indicator_cycle},"
|
|
299
|
+
f"repetition = {tx_brg_signal_indicator_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
308
300
|
|
|
309
301
|
# configuring second BRG (rx_brg_), already configured as rx, need only tx configuration #
|
|
310
302
|
rx_brg_signal_indicator_cycle, rx_brg_signal_indicator_rep = get_phase_tx_params_values(phase, RX_BRG_IDX)
|
|
311
303
|
# configuring second brg (rx_brg_) as transmitter
|
|
312
304
|
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter\n", "BOLD")
|
|
313
305
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=rx_brg_.id_int,
|
|
314
|
-
|
|
315
|
-
|
|
306
|
+
signal_indicator_cycle=rx_brg_signal_indicator_cycle,
|
|
307
|
+
signal_indicator_rep=rx_brg_signal_indicator_rep,
|
|
308
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
316
309
|
test = cert_config.brg1_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
317
310
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
318
311
|
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
319
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
320
|
-
utPrint(f"BRG {rx_brg_.id_str}
|
|
321
|
-
|
|
312
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
313
|
+
utPrint(f"BRG {rx_brg_.id_str} successfully configured to be transmitter - cycle = {rx_brg_signal_indicator_cycle},"
|
|
314
|
+
f"repetition = {rx_brg_signal_indicator_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
322
315
|
|
|
323
316
|
# phase analysis #
|
|
324
|
-
|
|
317
|
+
duration = NUM_OF_SCANNING_CYCLE * max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) + SCAN_DELAY_TIME
|
|
318
|
+
mqtt_scan_n_create_log_file(test, duration, phase)
|
|
325
319
|
|
|
326
|
-
#
|
|
320
|
+
# Analyzing tx_brg_ performance as receiver
|
|
327
321
|
rx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / rx_brg_signal_indicator_cycle
|
|
328
322
|
expected_signal_ind_pkts = int(NUM_OF_SCANNING_CYCLE * rx_brg_tx_cycles)
|
|
329
|
-
received_signal_ind_pkts =
|
|
323
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
|
|
330
324
|
if (not len(received_signal_ind_pkts) or
|
|
331
325
|
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
332
326
|
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
327
|
+
test.rc = TEST_FAILED
|
|
328
|
+
test.add_reason(f"Phase {phase} failed - BRG {tx_brg_.id_str} received wrong number of "
|
|
329
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
330
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
337
331
|
if test.rc == TEST_FAILED:
|
|
338
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
339
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
332
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
333
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
340
334
|
|
|
341
|
-
#
|
|
335
|
+
# Analyzing rx_brg_ performance as receiver
|
|
342
336
|
tx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / tx_brg_signal_indicator_cycle
|
|
343
337
|
expected_signal_ind_pkts = int(NUM_OF_SCANNING_CYCLE * tx_brg_tx_cycles)
|
|
344
|
-
received_signal_ind_pkts =
|
|
338
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
345
339
|
if (not len(received_signal_ind_pkts) or
|
|
346
340
|
len(received_signal_ind_pkts) < expected_signal_ind_pkts or
|
|
347
341
|
len(received_signal_ind_pkts) > expected_signal_ind_pkts):
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
342
|
+
test.rc = TEST_FAILED
|
|
343
|
+
test.add_reason(f"Phase {phase} failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
344
|
+
f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
345
|
+
f"expected {expected_signal_ind_pkts} packets")
|
|
352
346
|
if test.rc == TEST_FAILED:
|
|
353
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
354
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
355
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
347
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
348
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
349
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
356
350
|
|
|
357
351
|
phase = 5 if not test.internal_brg else 4
|
|
358
352
|
functionality_run_print(f"phase {phase}")
|
|
@@ -367,31 +361,30 @@ def run(test):
|
|
|
367
361
|
test = cert_config.config_brg1_defaults(test, modules=modules)[0]
|
|
368
362
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
369
363
|
test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
|
|
370
|
-
return terminate_test(test, phase=phase, revert_rx_brg=True,revert_tx_brg=True, modules=modules)
|
|
364
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
371
365
|
|
|
372
366
|
# configuring transmitter #
|
|
373
367
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
374
368
|
transmitter_cfg_pkt = WltPkt(hdr=DEFAULT_HDR, pkt=tx_module(seq_id=random.randrange(99), brg_mac=tx_brg_.id_int,
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
signal_indicator_cycle=tx_signal_ind_cycle, signal_indicator_rep=tx_signal_ind_rep,
|
|
370
|
+
pattern=ag.SUB1G_ENERGY_PATTERN_ISRAEL))
|
|
377
371
|
test = cert_config.brg_configure(test=test, cfg_pkt=transmitter_cfg_pkt)[0]
|
|
378
372
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
379
373
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
380
374
|
return terminate_test(test, phase=phase, revert_tx_brg=True, modules=modules)
|
|
381
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
382
|
-
|
|
375
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
376
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
383
377
|
|
|
384
378
|
# phase analysis #
|
|
385
|
-
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE*tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
379
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
386
380
|
expected_signal_ind_pkts = 0
|
|
387
|
-
received_signal_ind_pkts =
|
|
381
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
388
382
|
if len(received_signal_ind_pkts) != expected_signal_ind_pkts:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
field_functionality_pass_fail_print(test,'phase',phase)
|
|
383
|
+
test.rc = TEST_FAILED
|
|
384
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG {rx_brg_.id_str}")
|
|
385
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
393
386
|
if test.rc == TEST_FAILED:
|
|
394
|
-
return terminate_test(test, phase=phase, revert_rx_brg=False,revert_tx_brg=True, modules=modules)
|
|
387
|
+
return terminate_test(test, phase=phase, revert_rx_brg=False, revert_tx_brg=True, modules=modules)
|
|
395
388
|
|
|
396
389
|
# Test epilog
|
|
397
|
-
return terminate_test(test, phase=phase, revert_rx_brg=False,revert_tx_brg=True, modules=modules)
|
|
390
|
+
return terminate_test(test, phase=phase, revert_rx_brg=False, revert_tx_brg=True, modules=modules)
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"module": "
|
|
2
|
+
"name": "Signal Indicator Configuration",
|
|
3
|
+
"module": "Energizer Sub-1GHz",
|
|
4
4
|
"purpose": "Test configuration for supported energy_sub1g signal indicator cycle & repetitions sets of values",
|
|
5
|
-
"
|
|
5
|
+
"documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Sub1-Ghz-Energizer-module",
|
|
6
6
|
"initialCondition": "Bridge configured to defaults",
|
|
7
|
-
"procedure": ["Test prolog",
|
|
7
|
+
"procedure": ["Test prolog",
|
|
8
|
+
"For each supported value - configure the BRG and verify the value",
|
|
9
|
+
"Test epilog and revert to defaults"],
|
|
8
10
|
"expectedOutcome": "All values configured successfully",
|
|
9
11
|
"mandatory": 1,
|
|
10
12
|
"multiBridgeTest": 0,
|
|
11
13
|
"gwOnlyTest": 0,
|
|
14
|
+
"internalBridge": 1,
|
|
12
15
|
"allSupportedValues": [[60,4], [100,3]]
|
|
13
16
|
}
|
|
@@ -4,6 +4,7 @@ from brg_certificate.wlt_types import *
|
|
|
4
4
|
import brg_certificate.cert_common as cert_common
|
|
5
5
|
import brg_certificate.cert_config as cert_config
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
def run(test):
|
|
8
9
|
|
|
9
10
|
fields = [BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP]
|
|
@@ -24,4 +25,4 @@ def run(test):
|
|
|
24
25
|
else:
|
|
25
26
|
test.reset_result()
|
|
26
27
|
|
|
27
|
-
return cert_common.test_epilog(test, revert_brgs=True, modules=[sub1g_module])
|
|
28
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[sub1g_module])
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Power Management",
|
|
3
|
+
"module": "Power Management",
|
|
4
|
+
"purpose": "Validate the bridge power management functionality",
|
|
5
|
+
"documentation": "https://community.wiliot.com/customers/s/article/Bridge-Power-Management",
|
|
6
|
+
"initialCondition": "Bridge configured to defaults",
|
|
7
|
+
"procedure": ["Test prolog",
|
|
8
|
+
"Configure power management static mode - on_duration= 30 [sec] ,sleep_duration= 60 [sec], keep_alive_period= 20 [sec]",
|
|
9
|
+
"Verify bridge sent appropriate amount of HB_Sleep_pkts",
|
|
10
|
+
"Turn off power management mode",
|
|
11
|
+
"Test epilog"],
|
|
12
|
+
"expectedOutcome": "The bridge sent the expected amount of HB_Sleep_pkts",
|
|
13
|
+
"mandatory": 0,
|
|
14
|
+
"multiBridgeTest": 0,
|
|
15
|
+
"gwOnlyTest": 0,
|
|
16
|
+
"internalBridge": 1,
|
|
17
|
+
"allSupportedValues": []
|
|
18
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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_mqtt as cert_mqtt
|
|
6
|
+
|
|
7
|
+
# Test MACROS #
|
|
8
|
+
SEC_TO_MS = 1000
|
|
9
|
+
LOW_VALUE_IDX = 0
|
|
10
|
+
HIGH_VALUE_IDX = -1
|
|
11
|
+
STATIC_MODE = 0
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Test Functions #
|
|
15
|
+
def num_to_str(id):
|
|
16
|
+
return str(id).zfill(2)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_expected_hb_sleep_msgs_count(pkt):
|
|
20
|
+
# sent cfg is static_sleep_duration = 60, static_keep_alive_period = 20
|
|
21
|
+
periods_ratio = int(pkt.static_sleep_duration / pkt.static_keep_alive_period)
|
|
22
|
+
if not (pkt.static_sleep_duration % pkt.static_keep_alive_period):
|
|
23
|
+
return [periods_ratio - 1, periods_ratio]
|
|
24
|
+
else:
|
|
25
|
+
return [periods_ratio, periods_ratio + 1]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_hb_sleep_pkts(test, start_ts, end_ts):
|
|
29
|
+
mgmt_pkts_found = cert_mqtt.get_brg2gw_mgmt_pkts(test.mqttc, test)
|
|
30
|
+
# Screen pkts according to ts
|
|
31
|
+
mgmt_pkts = [p for p in mgmt_pkts_found if (start_ts <= p[TIMESTAMP] and p[TIMESTAMP] <= end_ts)]
|
|
32
|
+
# return count of HbSleep pkts
|
|
33
|
+
return len([p for p in mgmt_pkts if isinstance(p[MGMT_PKT].pkt, eval_pkt(f'Brg2GwHbSleepV{test.active_brg.api_version}'))])
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def brg_pwr_mgmt_sleep_state_analysis(test, wltpkt, start_ts, end_ts):
|
|
37
|
+
utPrint("Analyzing HB Sleep pkts count", "HEADER")
|
|
38
|
+
hb_sleep_pkts = get_hb_sleep_pkts(test, start_ts, end_ts)
|
|
39
|
+
exp_hb_sleep_msgs = get_expected_hb_sleep_msgs_count(wltpkt.pkt)
|
|
40
|
+
|
|
41
|
+
if (not hb_sleep_pkts or
|
|
42
|
+
hb_sleep_pkts < exp_hb_sleep_msgs[LOW_VALUE_IDX] or
|
|
43
|
+
hb_sleep_pkts > exp_hb_sleep_msgs[HIGH_VALUE_IDX]):
|
|
44
|
+
test.rc = TEST_FAILED
|
|
45
|
+
test.add_reason(f"Didn't received expected number of HB_SLEEP pkts during sleep state, "
|
|
46
|
+
f"Found {hb_sleep_pkts} Expected {exp_hb_sleep_msgs[LOW_VALUE_IDX]}-{exp_hb_sleep_msgs[HIGH_VALUE_IDX]}")
|
|
47
|
+
else:
|
|
48
|
+
utPrint(f"Success! found {hb_sleep_pkts} HB_SLEEP pkts "
|
|
49
|
+
f"(expected {exp_hb_sleep_msgs[LOW_VALUE_IDX]}-{exp_hb_sleep_msgs[HIGH_VALUE_IDX]})", "BLUE")
|
|
50
|
+
|
|
51
|
+
return test
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def run(test):
|
|
55
|
+
|
|
56
|
+
test = cert_common.test_prolog(test)
|
|
57
|
+
if test.rc == TEST_FAILED:
|
|
58
|
+
return cert_common.test_epilog(test)
|
|
59
|
+
|
|
60
|
+
# Turn on pwr mgmt static mode - 30 sec on, 60 sec sleep
|
|
61
|
+
test, wltpkt = cert_common.brg_pwr_mgmt_turn_on(test)
|
|
62
|
+
if test.rc == TEST_FAILED:
|
|
63
|
+
# Need to turn off just in case the ON was successful but didn't receive the ack packet
|
|
64
|
+
test = cert_common.brg_pwr_mgmt_turn_off(test)
|
|
65
|
+
cert_mqtt.dump_pkts(test, log=test.module_name)
|
|
66
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[eval_pkt(f'ModulePwrMgmtV{test.active_brg.api_version}')])
|
|
67
|
+
|
|
68
|
+
# On duration starts
|
|
69
|
+
utPrint(f"On duration started - Waiting for {int(wltpkt.pkt.static_on_duration)} seconds!", "WARNING")
|
|
70
|
+
cert_common.wait_time_n_print(wltpkt.pkt.static_on_duration)
|
|
71
|
+
utPrint(f"On duration expired - Entering sleep state for {int(wltpkt.pkt.static_sleep_duration)} seconds!", "BLUE")
|
|
72
|
+
# Sleep duration starts
|
|
73
|
+
sleep_state_start_ts = int(datetime.datetime.now().timestamp() * SEC_TO_MS)
|
|
74
|
+
test.mqttc.flush_pkts()
|
|
75
|
+
cert_common.wait_time_n_print(wltpkt.pkt.static_sleep_duration)
|
|
76
|
+
sleep_state_end_ts = int(datetime.datetime.now().timestamp() * SEC_TO_MS)
|
|
77
|
+
utPrint(f"Sleep duration expired - Returning to on state for {int(wltpkt.pkt.static_on_duration)} seconds!", "BLUE")
|
|
78
|
+
|
|
79
|
+
# Sleep state analysis - check for SLEEP_HB packet
|
|
80
|
+
test = brg_pwr_mgmt_sleep_state_analysis(test, wltpkt, sleep_state_start_ts, sleep_state_end_ts)
|
|
81
|
+
test = cert_common.brg_pwr_mgmt_turn_off(test)
|
|
82
|
+
|
|
83
|
+
cert_mqtt.dump_pkts(test, log=test.module_name)
|
|
84
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[eval_pkt(f'ModulePwrMgmtV{test.active_brg.api_version}')])
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "External Sensors",
|
|
3
|
+
"module": "BLE Sensor",
|
|
4
|
+
"purpose": "Verify the external_sensor module functionality - configuration, data collection and data transmission.",
|
|
5
|
+
"documentation": "<TEST_DOCUMENTATION_LINK>",
|
|
6
|
+
"initialCondition": "Bridge configured to defaults",
|
|
7
|
+
"procedure": ["Test prolog",
|
|
8
|
+
"tag_data_only - No external sensor configured, only tag data is expected.",
|
|
9
|
+
"rssi_threshold - One external sensor with no scrambling is configured and rssi threshold is set to -25. We expect to receive sensor packets only from the registered sensor & with rssi value between 0 to -25.",
|
|
10
|
+
"snsr0_no_scrmbl - One external sensor with no scrambling is configured and no rssi threshold is set. We expect to receive unscrambled sensor packets only from the registered sensor, with no rssi limitations.",
|
|
11
|
+
"snsr1_scrmbl - One external sensor with scrambling is configured with and no rssi threshold is set. We expect to receive scrambled sensor packets only from the registered sensor, with no rssi limitations.",
|
|
12
|
+
"snsr0_scrmbl_snsr1_no_scrmbl - Two external sensors are configured - one with scrambling and one without. No rssi threshold is set. We expect to receive sensor packets from both sensors, with the first sensor's data scrambled and the second sensor's data unscrambled.",
|
|
13
|
+
"snsr0_scrmbl_snsr1_scrmbl - Two external sensors are configured - both with scrambling. No rssi threshold is set. We expect to receive sensor packets from both sensors, with both sensors' data scrambled.",
|
|
14
|
+
"Test epilog"],
|
|
15
|
+
"expectedOutcome": "All phases passed successfully!",
|
|
16
|
+
"mandatory": 0,
|
|
17
|
+
"multiBridgeTest": 0,
|
|
18
|
+
"gwOnlyTest": 0,
|
|
19
|
+
"internalBridge": 1,
|
|
20
|
+
"allSupportedValues": ["tag_data_only", "rssi_threshold", "snsr0_no_scrmbl", "snsr1_scrmbl", "snsr0_scrmbl_snsr1_no_scrmbl", "snsr0_scrmbl_snsr1_scrmbl"]
|
|
21
|
+
}
|