wiliot-certificate 1.5.2a1__py3-none-any.whl → 4.4.0__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 +105 -114
- brg_certificate/ag/energous_v1_defines.py +105 -114
- brg_certificate/ag/energous_v2_defines.py +105 -114
- brg_certificate/ag/energous_v3_defines.py +105 -114
- brg_certificate/ag/energous_v4_defines.py +105 -114
- brg_certificate/ag/fanstel_lan_v0_defines.py +105 -114
- brg_certificate/ag/fanstel_lte_v0_defines.py +105 -114
- brg_certificate/ag/fanstel_wifi_v0_defines.py +105 -114
- brg_certificate/ag/minew_lte_v0_defines.py +105 -114
- brg_certificate/ag/wlt_types.html +983 -150
- brg_certificate/ag/wlt_types_ag.py +1326 -248
- brg_certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +69 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +101 -0
- brg_certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +45 -0
- brg_certificate/ag/wlt_types_ag_jsons/calibration.json +75 -0
- brg_certificate/ag/wlt_types_ag_jsons/custom.json +99 -0
- brg_certificate/ag/wlt_types_ag_jsons/datapath.json +133 -8
- brg_certificate/ag/wlt_types_ag_jsons/energy2400.json +99 -0
- brg_certificate/ag/wlt_types_ag_jsons/energySub1g.json +96 -0
- brg_certificate/ag/wlt_types_ag_jsons/externalSensor.json +113 -0
- brg_certificate/ag/wlt_types_ag_jsons/interface.json +157 -0
- brg_certificate/ag/wlt_types_ag_jsons/powerManagement.json +205 -0
- brg_certificate/cert_common.py +61 -11
- brg_certificate/cert_config.py +12 -7
- brg_certificate/cert_utils.py +3 -1
- brg_certificate/certificate_bcc_test_list.txt +0 -2
- brg_certificate/certificate_test_list.txt +4 -4
- brg_certificate/tests/calibration/interval_test/interval_test.json +1 -1
- brg_certificate/tests/calibration/interval_test/interval_test.py +5 -5
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/calibration/output_power_test/output_power_test.py +5 -5
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +16 -10
- brg_certificate/tests/datapath/aging_test/aging_test.py +10 -9
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +8 -13
- brg_certificate/tests/datapath/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +5 -5
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +1 -1
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +11 -7
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +11 -4
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +10 -10
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +5 -6
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +10 -9
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -10
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +1 -1
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -10
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +11 -10
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +1 -1
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +5 -6
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +39 -37
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +46 -46
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +2 -3
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +21 -17
- brg_certificate/tests/datapath/stress_test/stress_test.json +2 -3
- brg_certificate/tests/datapath/stress_test/stress_test.py +20 -17
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +1 -1
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +1 -1
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +12 -10
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +1 -1
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +13 -13
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +1 -1
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +2 -2
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +1 -1
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +5 -5
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +1 -1
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +5 -5
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +5 -5
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +2 -2
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +256 -278
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +2 -2
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +256 -278
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +3 -3
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +30 -91
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +1 -1
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +5 -5
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +1 -1
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +5 -5
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +2 -2
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +1 -1
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +5 -5
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +2 -2
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +1 -1
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +6 -7
- brg_certificate/wltPb_pb2.py +4 -4
- brg_certificate/wltPb_pb2.pyi +2 -1
- gw_certificate/api_if/gw_capabilities.py +37 -1
- gw_certificate/common/serialization_formatter.py +93 -0
- gw_certificate/common/wltPb_pb2.py +50 -38
- gw_certificate/common/wltPb_pb2.pyi +42 -35
- gw_certificate/gw_certificate.py +4 -2
- gw_certificate/gw_certificate_cli.py +5 -4
- gw_certificate/interface/4.4.91_app.zip +0 -0
- gw_certificate/interface/{4.4.52_sd_bl_app.zip → 4.4.91_sd_bl_app.zip} +0 -0
- gw_certificate/interface/ble_simulator.py +5 -3
- gw_certificate/interface/flash_fw.py +90 -0
- gw_certificate/interface/mqtt.py +39 -23
- gw_certificate/interface/pkt_generator.py +0 -44
- gw_certificate/interface/uart_if.py +25 -12
- gw_certificate/tests/actions.py +33 -5
- gw_certificate/tests/connection.py +3 -1
- gw_certificate/tests/downlink.py +2 -2
- gw_certificate/tests/generic.py +5 -4
- gw_certificate/tests/registration.py +4 -4
- gw_certificate/tests/static/generated_packet_table.py +47 -25
- gw_certificate/tests/static/packet_table.csv +10067 -10051
- gw_certificate/tests/static/uplink_defines.py +2 -1
- gw_certificate/tests/throughput.py +3 -2
- gw_certificate/tests/uplink.py +171 -32
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/METADATA +71 -30
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/RECORD +119 -117
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/WHEEL +1 -1
- gw_certificate/interface/4.4.52_app.zip +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-1.5.2a1.dist-info → wiliot_certificate-4.4.0.dist-info}/top_level.txt +0 -0
|
@@ -11,7 +11,7 @@ def run(test):
|
|
|
11
11
|
|
|
12
12
|
# We add the field BRG_RX_CHANNEL so internal BRGs will be configured to channel 37 (default is 39)
|
|
13
13
|
fields = [BRG_PKT_FILTER, BRG_RX_CHANNEL, BRG_PACER_INTERVAL]
|
|
14
|
-
datapath_module =
|
|
14
|
+
datapath_module = test.active_brg.datapath
|
|
15
15
|
|
|
16
16
|
test = cert_common.test_prolog(test)
|
|
17
17
|
if test.rc == TEST_FAILED:
|
|
@@ -22,11 +22,12 @@ def run(test):
|
|
|
22
22
|
module=datapath_module)[0]
|
|
23
23
|
test.set_phase_rc(param.name, test.rc)
|
|
24
24
|
test.add_phase_reason(param.name, test.reason)
|
|
25
|
-
if test.rc == TEST_FAILED
|
|
26
|
-
test.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if test.rc == TEST_FAILED:
|
|
26
|
+
if test.exit_on_param_failure:
|
|
27
|
+
break # break the whole for loop and keep the test as failed
|
|
28
|
+
else:
|
|
29
|
+
test.reset_result() # reset result and continue to next param
|
|
30
|
+
continue
|
|
30
31
|
print("waiting 5 seconds for datapath to clear")
|
|
31
32
|
print_update_wait(5)
|
|
32
33
|
|
|
@@ -51,9 +52,9 @@ def run(test):
|
|
|
51
52
|
field_functionality_pass_fail_print(test, fields[0], value=param.name)
|
|
52
53
|
test.set_phase_rc(param.name, test.rc)
|
|
53
54
|
test.add_phase_reason(param.name, test.reason)
|
|
54
|
-
if test.rc == TEST_FAILED
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
if test.rc == TEST_FAILED:
|
|
56
|
+
if test.exit_on_param_failure:
|
|
57
|
+
break # break the whole for loop and keep the test as failed
|
|
58
|
+
test.reset_result() # reset result and continue to next param
|
|
58
59
|
|
|
59
60
|
return cert_common.test_epilog(test, revert_brgs=True, revert_gws=test.internal_brg, modules=[datapath_module])
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Checking for packets violating RSSI threshold",
|
|
10
10
|
"Test epilog and revert to defaults"],
|
|
11
11
|
"expectedOutcome": "RSSI Threshold configured successfully and no pixel packets with RSSI weaker than the threshold have been echoed.",
|
|
12
|
-
"mandatory":
|
|
12
|
+
"mandatory": 0,
|
|
13
13
|
"multiBridgeTest": 0,
|
|
14
14
|
"gwOnlyTest": 0,
|
|
15
15
|
"internalBridge": 1,
|
|
@@ -30,7 +30,7 @@ def rssi_threshold_analysis(test, df, threshold):
|
|
|
30
30
|
def run(test):
|
|
31
31
|
|
|
32
32
|
fields = [BRG_RSSI_THRESHOLD]
|
|
33
|
-
datapath_module =
|
|
33
|
+
datapath_module = test.active_brg.datapath
|
|
34
34
|
|
|
35
35
|
test = cert_common.test_prolog(test)
|
|
36
36
|
if test.rc == TEST_FAILED:
|
|
@@ -39,14 +39,15 @@ def run(test):
|
|
|
39
39
|
# Configure the BRG with RSSI threshold and check for packets violating the threshold
|
|
40
40
|
for param in test.params:
|
|
41
41
|
functionality_run_print(f"test for RSSI threshold of {param.value}")
|
|
42
|
-
|
|
43
42
|
test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=datapath_module)[0]
|
|
44
43
|
test.set_phase_rc(param.name, test.rc)
|
|
45
44
|
test.add_phase_reason(param.name, test.reason)
|
|
46
|
-
if test.rc == TEST_FAILED
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
if test.rc == TEST_FAILED:
|
|
46
|
+
if test.exit_on_param_failure:
|
|
47
|
+
break # break the whole for loop and keep the test as failed
|
|
48
|
+
else:
|
|
49
|
+
test.reset_result() # reset result and continue to next param
|
|
50
|
+
continue
|
|
50
51
|
print("waiting 5 seconds for datapath to clear")
|
|
51
52
|
print_update_wait(5)
|
|
52
53
|
|
|
@@ -67,9 +68,9 @@ def run(test):
|
|
|
67
68
|
field_functionality_pass_fail_print(test, fields[0], value=param.name)
|
|
68
69
|
test.set_phase_rc(param.name, test.rc)
|
|
69
70
|
test.add_phase_reason(param.name, test.reason)
|
|
70
|
-
if test.rc == TEST_FAILED
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
if test.rc == TEST_FAILED:
|
|
72
|
+
if test.exit_on_param_failure:
|
|
73
|
+
break # break the whole for loop and keep the test as failed
|
|
74
|
+
test.reset_result() # reset result and continue to next param
|
|
74
75
|
|
|
75
76
|
return cert_common.test_epilog(test, revert_brgs=True, revert_gws=test.internal_brg, modules=[datapath_module])
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"For each supported value - configure the BRG and verify the value",
|
|
9
9
|
"Test epilog and revert to defaults"],
|
|
10
10
|
"expectedOutcome": "All values configured successfully",
|
|
11
|
-
"mandatory":
|
|
11
|
+
"mandatory": 0,
|
|
12
12
|
"multiBridgeTest": 0,
|
|
13
13
|
"gwOnlyTest": 0,
|
|
14
14
|
"internalBridge": 1,
|
|
@@ -16,7 +16,7 @@ def run(test):
|
|
|
16
16
|
|
|
17
17
|
fields = [BRG_RX_CHANNEL]
|
|
18
18
|
print(test.params)
|
|
19
|
-
datapath_module =
|
|
19
|
+
datapath_module = test.active_brg.datapath
|
|
20
20
|
|
|
21
21
|
# We use this flag to know whether the BRG is currently in BLE5 mode and needs special configuration next time it is configured
|
|
22
22
|
ble5_state = False
|
|
@@ -30,16 +30,15 @@ def run(test):
|
|
|
30
30
|
test = cert_config.brg_configure_ble5(test, fields=fields, values=[param.value], module=datapath_module)[0]
|
|
31
31
|
else:
|
|
32
32
|
test = cert_config.brg_configure(test, fields=fields, values=[param.value], module=datapath_module)[0]
|
|
33
|
-
|
|
34
33
|
# param epilog
|
|
35
34
|
ble5_state = not is_primary_channel(param.value)
|
|
36
35
|
generate_log_file(test, param.name)
|
|
37
36
|
field_functionality_pass_fail_print(test, fields[0], value=param.name)
|
|
38
37
|
test.set_phase_rc(param.name, test.rc)
|
|
39
38
|
test.add_phase_reason(param.name, test.reason)
|
|
40
|
-
if test.rc == TEST_FAILED
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
if test.rc == TEST_FAILED:
|
|
40
|
+
if test.exit_on_param_failure:
|
|
41
|
+
break # break the whole for loop and keep the test as failed
|
|
42
|
+
test.reset_result() # reset result and continue to next param
|
|
44
43
|
|
|
45
44
|
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module], ble5=ble5_state)
|
|
@@ -34,8 +34,8 @@ def scan_and_compare(test, pacer_interval, delay, expected_address_value):
|
|
|
34
34
|
pixel_sim_thread.stop()
|
|
35
35
|
cert_mqtt.dump_pkts(test, log="rx_rate")
|
|
36
36
|
cert_common.display_data(df, tbc=True, nfpkt=True, rssi=True, dir=test.dir)
|
|
37
|
-
|
|
38
|
-
if df
|
|
37
|
+
# check if the dataframe is empty or not
|
|
38
|
+
if len(df) <= 1:
|
|
39
39
|
print("Df is empty")
|
|
40
40
|
test.rc = TEST_FAILED
|
|
41
41
|
test.add_reason("Df is empty")
|
|
@@ -48,11 +48,16 @@ def scan_and_compare(test, pacer_interval, delay, expected_address_value):
|
|
|
48
48
|
print(f"Most common tag: {most_common_tag}")
|
|
49
49
|
df = df[df[TAG_ID] == most_common_tag]
|
|
50
50
|
df = df[[TAG_ID, TBC, PACKET_TYPE, DATETIME]]
|
|
51
|
+
length = len(df)
|
|
52
|
+
mid_index = int(length // 2)
|
|
53
|
+
if mid_index == 0:
|
|
54
|
+
mid_index = 1
|
|
55
|
+
print(f"Length of df: {length}, mid index: {mid_index}")
|
|
51
56
|
print(f"df:\n {df}")
|
|
52
57
|
|
|
53
58
|
tag = df.iloc[0][TAG_ID]
|
|
54
59
|
# iloc [1:] to skip the first value of tbc_values which could be 0 sometimes.
|
|
55
|
-
actual_address_value = round(df.iloc[
|
|
60
|
+
actual_address_value = round(df.iloc[mid_index:][TBC].mean(), 2) # extract the tbc value from df
|
|
56
61
|
print(f"\nactual address value: {actual_address_value}\nexpected address value: {expected_address_value}")
|
|
57
62
|
THRESHOLD_ADDRESS_VALUE = 5
|
|
58
63
|
# check if the actual address value is in the range of -+5 of the expected address value
|
|
@@ -147,8 +152,9 @@ def diff_rate(test, datapath_module):
|
|
|
147
152
|
df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
148
153
|
pixel_sim_thread.stop()
|
|
149
154
|
df = df[[TAG_ID, TBC]]
|
|
155
|
+
lenght = len(df)
|
|
150
156
|
|
|
151
|
-
if df
|
|
157
|
+
if len(df) <= 1:
|
|
152
158
|
test.add_reason("Df is empty")
|
|
153
159
|
test.rc = TEST_FAILED
|
|
154
160
|
return test
|
|
@@ -156,50 +162,46 @@ def diff_rate(test, datapath_module):
|
|
|
156
162
|
print(f"Df:\n {df}")
|
|
157
163
|
# NOTE: all next rows are specific for the values: delay 0.5 and 3, and in relation address values 128 and 235
|
|
158
164
|
# check if the last tbc value is as we expected for delay 3 sec we need to get 235 according to LUT table
|
|
159
|
-
# we define tolerance of +-
|
|
165
|
+
# we define tolerance of +-10 units for address value
|
|
166
|
+
|
|
167
|
+
# Most important check, verify it converges to the correct value
|
|
160
168
|
if df.iloc[-1][TBC] not in range(232, 237):
|
|
161
169
|
test.rc = TEST_FAILED
|
|
162
170
|
test.add_reason(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236]")
|
|
163
171
|
print(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236] according to delay:{second_delay / 1000} sec")
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
# check the first change of tbc value after delay changing which is verify the calculation of alpha filter
|
|
178
|
-
second_tbc = df.iloc[index + 1][TBC]
|
|
179
|
-
expected_address_value = 200
|
|
180
|
-
# 4 is equal to 0.09 sec error
|
|
181
|
-
threshold = 4 # 2 equal to 0.04 sec error
|
|
182
|
-
if not expected_address_value - threshold <= second_tbc <= expected_address_value + threshold:
|
|
172
|
+
return test
|
|
173
|
+
# for loop that skip the first row and check if somewhere there is the expected gap 130 to 200
|
|
174
|
+
result = False
|
|
175
|
+
for i in range(0, lenght - 1):
|
|
176
|
+
prev = df.iloc[i][TBC]
|
|
177
|
+
current = df.iloc[i + 1][TBC]
|
|
178
|
+
if prev in range(120, 140) and current in range(190, 210):
|
|
179
|
+
print(f"Found the gap between {prev} and {current}")
|
|
180
|
+
print(f"row {i}: {df.iloc[i][TBC]}")
|
|
181
|
+
print(f"row {i + 1}: {df.iloc[i + 1][TBC]}")
|
|
182
|
+
result = True
|
|
183
|
+
if not result:
|
|
183
184
|
test.rc = TEST_FAILED
|
|
184
|
-
test.add_reason(
|
|
185
|
-
print(f"first change of address value is wrong.\n"
|
|
186
|
-
f"alpha filter probably is not define well\n"
|
|
187
|
-
f"TBC value: {second_tbc}, expected value [196,204]")
|
|
185
|
+
test.add_reason("Didn't find the correct gap according to alpha filter calculation")
|
|
188
186
|
return test
|
|
189
187
|
|
|
190
188
|
|
|
191
189
|
def run(test):
|
|
190
|
+
|
|
192
191
|
# "Test prolog"
|
|
193
|
-
datapath_module =
|
|
194
|
-
test = cert_common.test_prolog(test)
|
|
195
|
-
if test.rc == TEST_FAILED:
|
|
196
|
-
return cert_common.test_epilog(test)
|
|
192
|
+
datapath_module = test.active_brg.datapath
|
|
197
193
|
|
|
194
|
+
test = cert_common.test_prolog(test)
|
|
198
195
|
pacer_interval = 1
|
|
199
196
|
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
200
197
|
if test.rc == TEST_FAILED:
|
|
201
198
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
202
|
-
|
|
199
|
+
name = test.phases[0].name
|
|
200
|
+
test.set_phase_rc(name, test.rc)
|
|
201
|
+
test.add_phase_reason(name, test.reason)
|
|
202
|
+
|
|
203
|
+
if test.rc == TEST_FAILED:
|
|
204
|
+
return cert_common.test_epilog(test)
|
|
203
205
|
|
|
204
206
|
RX_RATE_TEST_MAP = {"mid_values": mid_values, "diff_pacer": diff_pacer, "min_value": min_value,
|
|
205
207
|
"max_value": max_value, "diff_rate": diff_rate}
|
|
@@ -210,9 +212,9 @@ def run(test):
|
|
|
210
212
|
field_functionality_pass_fail_print(test, param.name)
|
|
211
213
|
test.set_phase_rc(param.name, test.rc)
|
|
212
214
|
test.add_phase_reason(param.name, test.reason)
|
|
213
|
-
if test.rc == TEST_FAILED
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
if test.rc == TEST_FAILED:
|
|
216
|
+
if test.exit_on_param_failure:
|
|
217
|
+
break # break the whole for loop and keep the test as failed
|
|
218
|
+
test.reset_result() # reset result and continue to next param
|
|
217
219
|
|
|
218
220
|
return cert_common.test_epilog(test)
|
|
@@ -11,7 +11,7 @@ import time
|
|
|
11
11
|
def cal_scan_time(test, delay, pacer_interval):
|
|
12
12
|
# Calculate the scan time to ensure at least 5 packets are captured in data scan
|
|
13
13
|
# define the num of packet that you want to get
|
|
14
|
-
num_of_sending_pkt =
|
|
14
|
+
num_of_sending_pkt = 2 # actually it will be 3 because the first one always send
|
|
15
15
|
delay = delay / 1000
|
|
16
16
|
if delay < pacer_interval:
|
|
17
17
|
scan_time = (pacer_interval * num_of_sending_pkt) + 10
|
|
@@ -34,8 +34,8 @@ def scan_and_compare(test, pacer_interval, delay, expected_address_value):
|
|
|
34
34
|
pixel_sim_thread.stop()
|
|
35
35
|
cert_mqtt.dump_pkts(test, log="rx_rate")
|
|
36
36
|
cert_common.display_data(df, tbc=True, nfpkt=True, rssi=True, dir=test.dir)
|
|
37
|
-
|
|
38
|
-
if df
|
|
37
|
+
# check if the dataframe is empty or not
|
|
38
|
+
if len(df) <= 1:
|
|
39
39
|
print("Df is empty")
|
|
40
40
|
test.rc = TEST_FAILED
|
|
41
41
|
test.add_reason("Df is empty")
|
|
@@ -48,11 +48,16 @@ def scan_and_compare(test, pacer_interval, delay, expected_address_value):
|
|
|
48
48
|
print(f"Most common tag: {most_common_tag}")
|
|
49
49
|
df = df[df[TAG_ID] == most_common_tag]
|
|
50
50
|
df = df[[TAG_ID, TBC, PACKET_TYPE, DATETIME]]
|
|
51
|
+
length = len(df)
|
|
52
|
+
mid_index = int(length // 2)
|
|
53
|
+
if mid_index == 0:
|
|
54
|
+
mid_index = 1
|
|
55
|
+
print(f"Length of df: {length}, mid index: {mid_index}")
|
|
51
56
|
print(f"df:\n {df}")
|
|
52
57
|
|
|
53
58
|
tag = df.iloc[0][TAG_ID]
|
|
54
59
|
# iloc [1:] to skip the first value of tbc_values which could be 0 sometimes.
|
|
55
|
-
actual_address_value = round(df.iloc[
|
|
60
|
+
actual_address_value = round(df.iloc[mid_index:][TBC].mean(), 2) # extract the tbc value from df
|
|
56
61
|
print(f"\nactual address value: {actual_address_value}\nexpected address value: {expected_address_value}")
|
|
57
62
|
THRESHOLD_ADDRESS_VALUE = 5
|
|
58
63
|
# check if the actual address value is in the range of -+5 of the expected address value
|
|
@@ -128,29 +133,28 @@ def max_value(test, datapath_module):
|
|
|
128
133
|
def diff_rate(test, datapath_module):
|
|
129
134
|
# diff rate - a filter: Generate packets with delay 1 and change to 5, according the delay change test the tolerance address value
|
|
130
135
|
pacer_interval = 1
|
|
131
|
-
|
|
132
|
-
first_delay =
|
|
133
|
-
first_duration =
|
|
134
|
-
second_delay =
|
|
135
|
-
|
|
136
|
+
delay_duration = [[500, 5], [3000, 3]]
|
|
137
|
+
first_delay = delay_duration[0][0]
|
|
138
|
+
first_duration = delay_duration[0][1]
|
|
139
|
+
second_delay = delay_duration[1][0]
|
|
136
140
|
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
137
141
|
if test.rc == TEST_FAILED:
|
|
138
142
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
139
143
|
return test
|
|
140
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=
|
|
144
|
+
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=2,
|
|
141
145
|
delay=first_delay, pkt_types=[0], pixels_type=GEN3)
|
|
142
146
|
pixel_sim_thread.start()
|
|
143
147
|
time_sleep = first_duration - ((first_delay / 1000) / 2)
|
|
144
148
|
print(f"sleep for {time_sleep} sec\n")
|
|
145
149
|
time.sleep(time_sleep)
|
|
146
150
|
pixel_sim_thread.delay = second_delay
|
|
147
|
-
|
|
148
|
-
scan_time = sum(delay.values()) + 20
|
|
151
|
+
scan_time = sum(duration for _, duration in delay_duration) + 20
|
|
149
152
|
df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
150
153
|
pixel_sim_thread.stop()
|
|
151
154
|
df = df[[TAG_ID, TBC]]
|
|
155
|
+
lenght = len(df)
|
|
152
156
|
|
|
153
|
-
if df
|
|
157
|
+
if len(df) <= 1:
|
|
154
158
|
test.add_reason("Df is empty")
|
|
155
159
|
test.rc = TEST_FAILED
|
|
156
160
|
return test
|
|
@@ -158,50 +162,46 @@ def diff_rate(test, datapath_module):
|
|
|
158
162
|
print(f"Df:\n {df}")
|
|
159
163
|
# NOTE: all next rows are specific for the values: delay 0.5 and 3, and in relation address values 128 and 235
|
|
160
164
|
# check if the last tbc value is as we expected for delay 3 sec we need to get 235 according to LUT table
|
|
161
|
-
# we define tolerance of +-
|
|
165
|
+
# we define tolerance of +-10 units for address value
|
|
166
|
+
|
|
167
|
+
# Most important check, verify it converges to the correct value
|
|
162
168
|
if df.iloc[-1][TBC] not in range(232, 237):
|
|
163
169
|
test.rc = TEST_FAILED
|
|
164
170
|
test.add_reason(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236]")
|
|
165
171
|
print(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236] according to delay:{second_delay / 1000} sec")
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
# check the first change of tbc value after delay changing which is verify the calculation of alpha filter
|
|
180
|
-
second_tbc = df.iloc[index + 1][TBC]
|
|
181
|
-
expected_address_value = 200
|
|
182
|
-
# 4 is equal to 0.09 sec error
|
|
183
|
-
threshold = 4 # 2 equal to 0.04 sec error
|
|
184
|
-
if not expected_address_value - threshold <= second_tbc <= expected_address_value + threshold:
|
|
172
|
+
return test
|
|
173
|
+
# for loop that skip the first row and check if somewhere there is the expected gap 130 to 200
|
|
174
|
+
result = False
|
|
175
|
+
for i in range(0, lenght - 1):
|
|
176
|
+
prev = df.iloc[i][TBC]
|
|
177
|
+
current = df.iloc[i + 1][TBC]
|
|
178
|
+
if prev in range(120, 140) and current in range(190, 210):
|
|
179
|
+
print(f"Found the gap between {prev} and {current}")
|
|
180
|
+
print(f"row {i}: {df.iloc[i][TBC]}")
|
|
181
|
+
print(f"row {i + 1}: {df.iloc[i + 1][TBC]}")
|
|
182
|
+
result = True
|
|
183
|
+
if not result:
|
|
185
184
|
test.rc = TEST_FAILED
|
|
186
|
-
test.add_reason(
|
|
187
|
-
print(f"first change of address value is wrong.\n"
|
|
188
|
-
f"alpha filter probably is not define well\n"
|
|
189
|
-
f"TBC value: {second_tbc}, expected value [196,204]")
|
|
185
|
+
test.add_reason("Didn't find the correct gap according to alpha filter calculation")
|
|
190
186
|
return test
|
|
191
187
|
|
|
192
188
|
|
|
193
189
|
def run(test):
|
|
190
|
+
|
|
194
191
|
# "Test prolog"
|
|
195
|
-
datapath_module =
|
|
196
|
-
test = cert_common.test_prolog(test)
|
|
197
|
-
if test.rc == TEST_FAILED:
|
|
198
|
-
return cert_common.test_epilog(test)
|
|
192
|
+
datapath_module = test.active_brg.datapath
|
|
199
193
|
|
|
194
|
+
test = cert_common.test_prolog(test)
|
|
200
195
|
pacer_interval = 1
|
|
201
196
|
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
202
197
|
if test.rc == TEST_FAILED:
|
|
203
198
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
204
|
-
|
|
199
|
+
name = test.phases[0].name
|
|
200
|
+
test.set_phase_rc(name, test.rc)
|
|
201
|
+
test.add_phase_reason(name, test.reason)
|
|
202
|
+
|
|
203
|
+
if test.rc == TEST_FAILED:
|
|
204
|
+
return cert_common.test_epilog(test)
|
|
205
205
|
|
|
206
206
|
RX_RATE_TEST_MAP = {"mid_values": mid_values, "diff_pacer": diff_pacer, "min_value": min_value,
|
|
207
207
|
"max_value": max_value, "diff_rate": diff_rate}
|
|
@@ -212,9 +212,9 @@ def run(test):
|
|
|
212
212
|
field_functionality_pass_fail_print(test, param.name)
|
|
213
213
|
test.set_phase_rc(param.name, test.rc)
|
|
214
214
|
test.add_phase_reason(param.name, test.reason)
|
|
215
|
-
if test.rc == TEST_FAILED
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
if test.rc == TEST_FAILED:
|
|
216
|
+
if test.exit_on_param_failure:
|
|
217
|
+
break # break the whole for loop and keep the test as failed
|
|
218
|
+
test.reset_result() # reset result and continue to next param
|
|
219
219
|
|
|
220
220
|
return cert_common.test_epilog(test)
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
"rep 3 - config pacer interval 22, then check repetition value = 3, pacer increment = 0, num of tags = all tags",
|
|
12
12
|
"rep 2 - config pacer interval 12, then check repetition value = 2, pacer increment = 0, num of tags = all tags",
|
|
13
13
|
"rep 1 - config pacer interval 7, then check repetition value = 1, pacer increment = 0, num of tags = all tags",
|
|
14
|
-
"rep 1 adaptive pacer - config pacer interval 1, then check repetition value = 1, pacer increment = 3 , num of tags = all tags",
|
|
15
14
|
"Test epilog"],
|
|
16
15
|
"expectedOutcome": "all metrics values will be as expected then the bridge is working correctly and the algorithms are working correctly",
|
|
17
|
-
"mandatory":
|
|
16
|
+
"mandatory": 0,
|
|
18
17
|
"multiBridgeTest": 0,
|
|
19
18
|
"gwOnlyTest": 0,
|
|
20
19
|
"internalBridge": 0,
|
|
21
|
-
"allSupportedValues": ["rep3", "rep2", "rep1"
|
|
20
|
+
"allSupportedValues": ["rep3", "rep2", "rep1"]
|
|
22
21
|
}
|
|
@@ -11,8 +11,13 @@ import time
|
|
|
11
11
|
|
|
12
12
|
def metric_checking_HB(test, check, mgmt_type_list, tx_queue_expected, pacer_increment_expected):
|
|
13
13
|
if not mgmt_type_list:
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if check:
|
|
15
|
+
test.add_reason("\nDidn't find HB pkt, therefore skip all checks\n")
|
|
16
|
+
print("Didn't find HB pkt, therefore will not check tx_queue and pacer increment")
|
|
17
|
+
else:
|
|
18
|
+
test.rc = TEST_PASSED # skip the rc result if we didn't find HB pkt
|
|
19
|
+
print("Didn't find HB pkt, therefore will not check tx_queue and pacer increment")
|
|
20
|
+
|
|
16
21
|
else:
|
|
17
22
|
# check tx queue
|
|
18
23
|
watermarks = [pkt.tx_queue_watermark for pkt in mgmt_type_list]
|
|
@@ -30,7 +35,7 @@ def metric_checking_HB(test, check, mgmt_type_list, tx_queue_expected, pacer_inc
|
|
|
30
35
|
print(f"\npacer_increment value is wrong\nexpected: {pacer_increment_expected}\ngot: {average_pacer_increment_HB}")
|
|
31
36
|
if check:
|
|
32
37
|
test.rc = TEST_FAILED
|
|
33
|
-
test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
|
|
38
|
+
test.add_reason(f"pacer_increment: {average_pacer_increment_HB} expected: {pacer_increment_expected}")
|
|
34
39
|
else:
|
|
35
40
|
print(f"\naverage pacer_increment from HB: {average_pacer_increment_HB}\n")
|
|
36
41
|
if check:
|
|
@@ -96,7 +101,7 @@ def combination_func(test, param, datapath_module, pacer_interval, num_of_sim_ta
|
|
|
96
101
|
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
97
102
|
return test
|
|
98
103
|
else:
|
|
99
|
-
# in case it failed because the repetition value.
|
|
104
|
+
# in case it failed because the repetition value. the reason has been added in the metric_checking_df function
|
|
100
105
|
return test
|
|
101
106
|
|
|
102
107
|
time.sleep(30)
|
|
@@ -107,8 +112,8 @@ def combination_func(test, param, datapath_module, pacer_interval, num_of_sim_ta
|
|
|
107
112
|
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
108
113
|
print("result of first df\n")
|
|
109
114
|
check = False
|
|
110
|
-
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
111
115
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
116
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
112
117
|
time.sleep(30)
|
|
113
118
|
# second df
|
|
114
119
|
df = cert_common.data_scan(test, scan_time=60, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
@@ -117,8 +122,10 @@ def combination_func(test, param, datapath_module, pacer_interval, num_of_sim_ta
|
|
|
117
122
|
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
118
123
|
print("result of second df\n")
|
|
119
124
|
check = True
|
|
120
|
-
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
121
125
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
126
|
+
if param.name != "rep1":
|
|
127
|
+
check = False
|
|
128
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
122
129
|
return test
|
|
123
130
|
|
|
124
131
|
|
|
@@ -147,7 +154,7 @@ def rep1(test, param, datapath_module, num_of_sim_tags):
|
|
|
147
154
|
pacer_interval = 7
|
|
148
155
|
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
149
156
|
repetition_value_expected=[1, 2], tx_queue_expected=[20, 40],
|
|
150
|
-
pacer_increment_expected=[0,
|
|
157
|
+
pacer_increment_expected=[0, 25], brg_latency_expected=[200, 300])
|
|
151
158
|
time.sleep(5)
|
|
152
159
|
return test
|
|
153
160
|
|
|
@@ -165,17 +172,14 @@ def rep1_adaptive_pacer(test, param, datapath_module, num_of_sim_tags):
|
|
|
165
172
|
|
|
166
173
|
def run(test):
|
|
167
174
|
# Test prolog
|
|
168
|
-
datapath_module =
|
|
175
|
+
datapath_module = test.active_brg.datapath
|
|
169
176
|
test = cert_common.test_prolog(test)
|
|
170
177
|
if test.rc == TEST_FAILED:
|
|
171
178
|
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
|
|
172
179
|
# config GW deduplication pkts = 0
|
|
173
180
|
print("Configuring GW with !deduplication_pkts 0")
|
|
174
181
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 0")
|
|
175
|
-
|
|
176
|
-
return cert_common.test_epilog(test, revert_gws=True)
|
|
177
|
-
|
|
178
|
-
STRESS_TEST_MAP = {"rep3": rep3, "rep2": rep2, "rep1": rep1, "rep1_adaptive_pacer": rep1_adaptive_pacer}
|
|
182
|
+
STRESS_TEST_MAP = {"rep3": rep3, "rep2": rep2, "rep1": rep1}
|
|
179
183
|
num_of_pixels = 300
|
|
180
184
|
pixel_sim_thread = cert_data_sim.DataSimThread(test=test,
|
|
181
185
|
num_of_pixels=num_of_pixels,
|
|
@@ -192,11 +196,11 @@ def run(test):
|
|
|
192
196
|
field_functionality_pass_fail_print(test, param.name)
|
|
193
197
|
test.set_phase_rc(param.name, test.rc)
|
|
194
198
|
test.add_phase_reason(param.name, test.reason)
|
|
195
|
-
if test.rc == TEST_FAILED
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
if test.rc == TEST_FAILED:
|
|
200
|
+
if test.exit_on_param_failure:
|
|
201
|
+
break # break the whole for loop and keep the test as failed
|
|
202
|
+
test.reset_result() # reset result and continue to next param
|
|
203
|
+
|
|
200
204
|
pixel_sim_thread.stop()
|
|
201
205
|
# Re-enable unified packets deduplication
|
|
202
206
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 1")
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
"rep 3 - config pacer interval 22, then check repetition value = 3, pacer increment = 0, num of tags = all tags",
|
|
12
12
|
"rep 2 - config pacer interval 12, then check repetition value = 2, pacer increment = 0, num of tags = all tags",
|
|
13
13
|
"rep 1 - config pacer interval 7, then check repetition value = 1, pacer increment = 0, num of tags = all tags",
|
|
14
|
-
"rep 1 adaptive pacer - config pacer interval 1, then check repetition value = 1, pacer increment = 3 , num of tags = all tags",
|
|
15
14
|
"Test epilog"],
|
|
16
15
|
"expectedOutcome": "all metrics values will be as expected then the bridge is working correctly and the algorithms are working correctly",
|
|
17
|
-
"mandatory":
|
|
16
|
+
"mandatory": 0,
|
|
18
17
|
"multiBridgeTest": 0,
|
|
19
18
|
"gwOnlyTest": 0,
|
|
20
19
|
"internalBridge": 0,
|
|
21
|
-
"allSupportedValues": ["rep3", "rep2", "rep1"
|
|
20
|
+
"allSupportedValues": ["rep3", "rep2", "rep1"]
|
|
22
21
|
}
|