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
|
@@ -7,194 +7,204 @@ import brg_certificate.cert_config as cert_config
|
|
|
7
7
|
import brg_certificate.cert_data_sim as cert_data_sim
|
|
8
8
|
import time
|
|
9
9
|
|
|
10
|
-
SANITY_ADDRESS_VALUE = 192
|
|
11
|
-
DELAY_FOR_SANITY_1 = 1000 # 1 sec
|
|
12
|
-
SANITY_DELAY_ADDRESS_VALUES = { 1000: 192, 5000: 243, 500: 128 }
|
|
13
|
-
MIN_ADDRESS_VALUE = 1
|
|
14
|
-
MAX_ADDRESS_VALUE = 255
|
|
15
|
-
PACER_INTERVAL_LIST = [30, 60]
|
|
16
|
-
THRESHOLD_ADDRESS_VALUE = 5
|
|
17
10
|
|
|
18
11
|
def cal_scan_time(test, delay, pacer_interval):
|
|
19
12
|
# Calculate the scan time to ensure at least 5 packets are captured in data scan
|
|
20
|
-
# define the num of packet that you want to get
|
|
21
|
-
num_of_sending_pkt = 3
|
|
22
|
-
delay = delay/1000
|
|
23
|
-
if delay < pacer_interval
|
|
24
|
-
scan_time =(pacer_interval*num_of_sending_pkt)+10
|
|
13
|
+
# define the num of packet that you want to get
|
|
14
|
+
num_of_sending_pkt = 3 # actually it will be 3 because the first one always send
|
|
15
|
+
delay = delay / 1000
|
|
16
|
+
if delay < pacer_interval:
|
|
17
|
+
scan_time = (pacer_interval * num_of_sending_pkt) + 10
|
|
25
18
|
elif pacer_interval <= delay:
|
|
26
|
-
scan_time = (delay*num_of_sending_pkt)+10
|
|
27
|
-
# verify scan time value
|
|
28
|
-
if scan_time < (2*pacer_interval):
|
|
29
|
-
print(
|
|
19
|
+
scan_time = (delay * num_of_sending_pkt) + 10
|
|
20
|
+
# verify scan time value
|
|
21
|
+
if scan_time < (2 * pacer_interval):
|
|
22
|
+
print("scan time is too low in related to pacer interval")
|
|
30
23
|
test.rc == TEST_FAILED
|
|
31
|
-
test.add_reason(
|
|
24
|
+
test.add_reason("scan time is too low in related to pacer interval value")
|
|
32
25
|
return test, scan_time
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
|
|
28
|
+
def scan_and_compare(test, pacer_interval, delay, expected_address_value):
|
|
29
|
+
|
|
36
30
|
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3, delay=delay, pkt_types=[0], pixels_type=GEN3)
|
|
37
31
|
pixel_sim_thread.start()
|
|
38
|
-
test, scan_time = cal_scan_time(test, delay, pacer_interval)
|
|
39
|
-
df = cert_common.data_scan(test, brg_data=(not test.internal_brg), gw_data=test.internal_brg
|
|
32
|
+
test, scan_time = cal_scan_time(test, delay, pacer_interval)
|
|
33
|
+
df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
40
34
|
pixel_sim_thread.stop()
|
|
41
35
|
cert_mqtt.dump_pkts(test, log="rx_rate")
|
|
42
36
|
cert_common.display_data(df, tbc=True, nfpkt=True, rssi=True, dir=test.dir)
|
|
43
|
-
|
|
44
|
-
# Divided the dataframe by tag_id and continue with df's tag that has the highest number of rows.
|
|
45
|
-
tag_counts = df[TAG_ID].value_counts()
|
|
46
|
-
print(f"Tag counts:\n{tag_counts.to_string(header=False)}")
|
|
47
|
-
most_common_tag = tag_counts.idxmax()
|
|
48
|
-
print(f"Most common tag: {most_common_tag}")
|
|
49
|
-
df = df[df[TAG_ID] == most_common_tag]
|
|
37
|
+
|
|
50
38
|
if df.empty:
|
|
51
|
-
print(
|
|
39
|
+
print("Df is empty")
|
|
40
|
+
test.rc = TEST_FAILED
|
|
41
|
+
test.add_reason("Df is empty")
|
|
52
42
|
return test
|
|
53
43
|
else:
|
|
44
|
+
# Divided the dataframe by tag_id and continue with df's tag that has the highest number of rows.
|
|
45
|
+
tag_counts = df[TAG_ID].value_counts()
|
|
46
|
+
print(f"Tag counts:\n{tag_counts.to_string(header=False)}")
|
|
47
|
+
most_common_tag = tag_counts.idxmax()
|
|
48
|
+
print(f"Most common tag: {most_common_tag}")
|
|
49
|
+
df = df[df[TAG_ID] == most_common_tag]
|
|
54
50
|
df = df[[TAG_ID, TBC, PACKET_TYPE, DATETIME]]
|
|
55
51
|
print(f"df:\n {df}")
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
actual_address_value = df.iloc[1:][TBC].mean()
|
|
67
|
-
print(f"\nactual_address_value: {actual_address_value}\nexpected address value: {expected_address_value}")
|
|
68
|
-
|
|
69
|
-
# check if the actual address value is in the range of 5% of the expected address value
|
|
70
|
-
if not ((expected_address_value-THRESHOLD_ADDRESS_VALUE) <= actual_address_value <= (expected_address_value+THRESHOLD_ADDRESS_VALUE)):
|
|
71
|
-
print(f"\n Address value for tag {tag} is {actual_address_value} when the expected value: {expected_address_value}!\n")
|
|
72
|
-
test.rc = TEST_FAILED
|
|
73
|
-
test.add_reason(f"Address value for tag {tag} is {actual_address_value} instead of {expected_address_value}!")
|
|
74
|
-
|
|
75
|
-
if test.params == [mid_values] and delay == 1000:
|
|
76
|
-
# these following lines for checking 0 value in the first packet.
|
|
77
|
-
first_row = df.iloc[0][TBC]
|
|
78
|
-
second_row = df.iloc[1][TBC]
|
|
79
|
-
if first_row != 0 and second_row != 0:
|
|
53
|
+
tag = df.iloc[0][TAG_ID]
|
|
54
|
+
# iloc [1:] to skip the first value of tbc_values which could be 0 sometimes.
|
|
55
|
+
actual_address_value = round(df.iloc[1:][TBC].mean(), 2) # extract the tbc value from df
|
|
56
|
+
print(f"\nactual address value: {actual_address_value}\nexpected address value: {expected_address_value}")
|
|
57
|
+
THRESHOLD_ADDRESS_VALUE = 5
|
|
58
|
+
# check if the actual address value is in the range of -+5 of the expected address value
|
|
59
|
+
if (actual_address_value < (expected_address_value - THRESHOLD_ADDRESS_VALUE) or
|
|
60
|
+
actual_address_value > (expected_address_value + THRESHOLD_ADDRESS_VALUE)):
|
|
61
|
+
print(f"\nAddress value for tag {tag} is {actual_address_value}, expected value: {expected_address_value}!\n")
|
|
80
62
|
test.rc = TEST_FAILED
|
|
81
|
-
test.add_reason(f"
|
|
82
|
-
|
|
63
|
+
test.add_reason(f"Address value for tag {tag} is {actual_address_value} expected: {expected_address_value}!\n")
|
|
64
|
+
if test.params == [mid_values] and delay == 1000:
|
|
65
|
+
# checking 0 value in the first packet.
|
|
66
|
+
first_row = df.iloc[0][TBC]
|
|
67
|
+
second_row = df.iloc[1][TBC]
|
|
68
|
+
if first_row != 0 and second_row != 0:
|
|
69
|
+
test.rc = TEST_FAILED
|
|
70
|
+
test.add_reason("first tbc value is not 0 as supposed to be while sanity checking")
|
|
71
|
+
return test
|
|
72
|
+
|
|
83
73
|
|
|
84
74
|
def mid_values(test, datapath_module):
|
|
85
|
-
# mid values - Sanity check: Generate packets with delays of 1, 5, and 0.5 seconds.
|
|
75
|
+
# mid values - Sanity check: Generate packets with delays of 1, 5, and 0.5 seconds.
|
|
76
|
+
# Check address values 192, 243, and 128. Verify that the address value is 0 for the first packet.
|
|
77
|
+
SANITY_DELAY_ADDRESS_VALUES = {1000: 192, 5000: 243, 500: 128}
|
|
86
78
|
for delay, expected_address_value in SANITY_DELAY_ADDRESS_VALUES.items():
|
|
87
|
-
pacer_interval = 1
|
|
88
|
-
test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=expected_address_value)
|
|
89
|
-
|
|
90
|
-
time.sleep(2)
|
|
79
|
+
pacer_interval = 1
|
|
80
|
+
test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=expected_address_value)
|
|
81
|
+
time.sleep(2)
|
|
91
82
|
return test
|
|
92
|
-
|
|
83
|
+
|
|
84
|
+
|
|
93
85
|
def diff_pacer(test, datapath_module):
|
|
94
86
|
# diff pacer - Generate packets with a 1-second delay and pacer intervals of 30 and 60. Ensure the address value remains 192.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
SANITY_ADDRESS_VALUE = 192
|
|
88
|
+
PACER_INTERVAL_LIST = [30, 60]
|
|
89
|
+
delay = 1000 # 1 sec
|
|
98
90
|
for pacer_interval in PACER_INTERVAL_LIST:
|
|
99
|
-
test = cert_config.brg_configure(test, fields=
|
|
100
|
-
if test.rc ==TEST_FAILED:
|
|
91
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
92
|
+
if test.rc == TEST_FAILED:
|
|
101
93
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
102
|
-
return test
|
|
94
|
+
return test
|
|
103
95
|
test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=SANITY_ADDRESS_VALUE)
|
|
104
|
-
|
|
96
|
+
time.sleep(2)
|
|
105
97
|
return test
|
|
106
98
|
|
|
99
|
+
|
|
107
100
|
def min_value(test, datapath_module):
|
|
108
|
-
#
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
test = cert_config.brg_configure(test, fields=
|
|
112
|
-
if test.rc ==TEST_FAILED:
|
|
101
|
+
# min_value - Minimum value: Generate packets with a 0.1-second delay. Verify that the address value is 1.
|
|
102
|
+
MIN_ADDRESS_VALUE = 1
|
|
103
|
+
pacer_interval = 1
|
|
104
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
105
|
+
if test.rc == TEST_FAILED:
|
|
113
106
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
114
|
-
return test
|
|
107
|
+
return test
|
|
115
108
|
delay = 100
|
|
116
|
-
test = scan_and_compare(test, pacer_interval=pacer_interval
|
|
109
|
+
test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=MIN_ADDRESS_VALUE)
|
|
117
110
|
time.sleep(2)
|
|
118
|
-
return test
|
|
111
|
+
return test
|
|
112
|
+
|
|
119
113
|
|
|
120
114
|
def max_value(test, datapath_module):
|
|
121
115
|
# max value - Maximum value: Generate packets with a 70-second delay and a pacer interval of 80. Verify that the address value is 255.
|
|
116
|
+
MAX_ADDRESS_VALUE = 255
|
|
122
117
|
pacer_interval = 80
|
|
123
|
-
|
|
124
|
-
test
|
|
125
|
-
if test.rc ==TEST_FAILED:
|
|
118
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
119
|
+
if test.rc == TEST_FAILED:
|
|
126
120
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
127
|
-
return test
|
|
121
|
+
return test
|
|
128
122
|
delay = 70000
|
|
129
|
-
test = scan_and_compare(test, pacer_interval=pacer_interval
|
|
123
|
+
test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=MAX_ADDRESS_VALUE)
|
|
130
124
|
time.sleep(2)
|
|
131
|
-
return test
|
|
125
|
+
return test
|
|
126
|
+
|
|
132
127
|
|
|
133
128
|
def diff_rate(test, datapath_module):
|
|
134
129
|
# diff rate - a filter: Generate packets with delay 1 and change to 5, according the delay change test the tolerance address value
|
|
135
|
-
pacer_interval = 1
|
|
136
|
-
delay = {500:5, 3000:30}
|
|
137
|
-
first_delay = list(delay.keys())[0]
|
|
130
|
+
pacer_interval = 1
|
|
131
|
+
delay = {500: 5, 3000: 30} # key=delay and value = the duration it will be activated
|
|
132
|
+
first_delay = list(delay.keys())[0]
|
|
138
133
|
first_duration = list(delay.values())[0]
|
|
139
|
-
second_delay = list(delay.keys())[1]
|
|
140
|
-
second_duration = list(delay.values())[1]
|
|
134
|
+
second_delay = list(delay.keys())[1]
|
|
141
135
|
|
|
142
|
-
|
|
143
|
-
test
|
|
144
|
-
if test.rc ==TEST_FAILED:
|
|
136
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
137
|
+
if test.rc == TEST_FAILED:
|
|
145
138
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
146
|
-
return test
|
|
147
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3,
|
|
139
|
+
return test
|
|
140
|
+
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3,
|
|
141
|
+
delay=first_delay, pkt_types=[0], pixels_type=GEN3)
|
|
148
142
|
pixel_sim_thread.start()
|
|
149
|
-
time_sleep = first_duration-((first_delay/1000)/2)
|
|
143
|
+
time_sleep = first_duration - ((first_delay / 1000) / 2)
|
|
150
144
|
print(f"sleep for {time_sleep} sec\n")
|
|
151
145
|
time.sleep(time_sleep)
|
|
152
146
|
pixel_sim_thread.delay = second_delay
|
|
153
147
|
print(f"changing delay value to {second_delay}\n")
|
|
154
|
-
scan_time = sum(delay.values())
|
|
155
|
-
df = cert_common.data_scan(test, scan_time=scan_time
|
|
148
|
+
scan_time = sum(delay.values()) + 20
|
|
149
|
+
df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
156
150
|
pixel_sim_thread.stop()
|
|
151
|
+
df = df[[TAG_ID, TBC]]
|
|
152
|
+
|
|
157
153
|
if df.empty:
|
|
158
|
-
|
|
154
|
+
test.add_reason("Df is empty")
|
|
155
|
+
test.rc = TEST_FAILED
|
|
159
156
|
return test
|
|
160
157
|
else:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
#
|
|
164
|
-
#
|
|
165
|
-
# we define tolerance of +-2 units for address value
|
|
158
|
+
print(f"Df:\n {df}")
|
|
159
|
+
# NOTE: all next rows are specific for the values: delay 0.5 and 3, and in relation address values 128 and 235
|
|
160
|
+
# 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 +-2 units for address value
|
|
166
162
|
if df.iloc[-1][TBC] not in range(232, 237):
|
|
167
163
|
test.rc = TEST_FAILED
|
|
168
|
-
test.add_reason(f"
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
test.add_reason(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236]")
|
|
165
|
+
print(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236] according to delay:{second_delay / 1000} sec")
|
|
166
|
+
# skip the first packet in case the second one is still from the last delay value
|
|
167
|
+
index = 0
|
|
168
|
+
if df.iloc[1][TBC] in range(232, 237):
|
|
169
|
+
index = 1
|
|
170
|
+
|
|
171
|
+
# verify the first tbc value
|
|
172
|
+
first_tbc = df.iloc[index][TBC]
|
|
173
|
+
if first_tbc not in range(120, 145):
|
|
172
174
|
test.rc = TEST_FAILED
|
|
173
|
-
test.add_reason(f"
|
|
175
|
+
test.add_reason(f"TBC value: {first_tbc}, expected value [120,144]")
|
|
176
|
+
print(f"TBC value of last packet before the delay change is wrong\n"
|
|
177
|
+
f"TBC value: {first_tbc}, expected value [120,144] according to delay:{first_delay / 1000} sec")
|
|
174
178
|
|
|
175
|
-
# check the first change of tbc value after delay changing
|
|
176
|
-
second_tbc = df.iloc[1][TBC]
|
|
177
|
-
expected_address_value = 200
|
|
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:
|
|
179
185
|
test.rc = TEST_FAILED
|
|
180
|
-
test.add_reason(f"
|
|
186
|
+
test.add_reason(f"TBC value: {second_tbc}, expected value [196,204]")
|
|
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]")
|
|
181
190
|
return test
|
|
182
191
|
|
|
192
|
+
|
|
183
193
|
def run(test):
|
|
184
194
|
# "Test prolog"
|
|
185
195
|
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
186
196
|
test = cert_common.test_prolog(test)
|
|
187
197
|
if test.rc == TEST_FAILED:
|
|
188
198
|
return cert_common.test_epilog(test)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
pacer_interval =
|
|
192
|
-
test
|
|
193
|
-
if test.rc ==TEST_FAILED:
|
|
199
|
+
|
|
200
|
+
pacer_interval = 1
|
|
201
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
202
|
+
if test.rc == TEST_FAILED:
|
|
194
203
|
test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
|
|
195
|
-
return test
|
|
204
|
+
return test
|
|
196
205
|
|
|
197
|
-
RX_RATE_TEST_MAP = {"mid_values":mid_values, "diff_pacer":diff_pacer, "min_value": min_value,
|
|
206
|
+
RX_RATE_TEST_MAP = {"mid_values": mid_values, "diff_pacer": diff_pacer, "min_value": min_value,
|
|
207
|
+
"max_value": max_value, "diff_rate": diff_rate}
|
|
198
208
|
for param in test.params:
|
|
199
209
|
functionality_run_print(param.name)
|
|
200
210
|
test = RX_RATE_TEST_MAP[param.value](test, datapath_module)
|
|
@@ -207,4 +217,4 @@ def run(test):
|
|
|
207
217
|
else:
|
|
208
218
|
test.reset_result()
|
|
209
219
|
|
|
210
|
-
return cert_common.test_epilog(test)
|
|
220
|
+
return cert_common.test_epilog(test)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"module": "
|
|
4
|
-
"purpose":
|
|
5
|
-
"verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly"],
|
|
2
|
+
"name": "Stress Test Gen3 Pixels",
|
|
3
|
+
"module": "Datapath",
|
|
4
|
+
"purpose": "verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly under stress conditions with Gen3 pixels",
|
|
6
5
|
"documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Relaying-data",
|
|
7
6
|
"add more links here - about adaptive repetition, adaptive pacer"],
|
|
8
7
|
"initialCondition": "Bridge configured to defaults",
|
|
9
8
|
"procedure": ["Test prolog",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"rep
|
|
13
|
-
"rep
|
|
9
|
+
"Configure GW to allow packets duplications",
|
|
10
|
+
"define simulation with 300 pixels & 0 delay(0.02 sec) time",
|
|
11
|
+
"rep 3 - config pacer interval 22, then check repetition value = 3, pacer increment = 0, num of tags = all tags",
|
|
12
|
+
"rep 2 - config pacer interval 12, then check repetition value = 2, pacer increment = 0, num of tags = all tags",
|
|
13
|
+
"rep 1 - config pacer interval 7, then check repetition value = 1, pacer increment = 0, num of tags = all tags",
|
|
14
14
|
"rep 1 adaptive pacer - config pacer interval 1, then check repetition value = 1, pacer increment = 3 , num of tags = all tags",
|
|
15
15
|
"Test epilog"],
|
|
16
16
|
"expectedOutcome": "all metrics values will be as expected then the bridge is working correctly and the algorithms are working correctly",
|