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
|
@@ -8,185 +8,186 @@ from brg_certificate.cert_gw_sim import DEDUPLICATION_PKTS
|
|
|
8
8
|
import statistics
|
|
9
9
|
import time
|
|
10
10
|
|
|
11
|
-
def configure_pacer_n_times(test, num_of_times, pacer_interval, datapath_module):
|
|
12
|
-
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
13
|
-
if test.rc == TEST_FAILED:
|
|
14
|
-
for i in range(num_of_times):
|
|
15
|
-
if test.rc == TEST_PASSED:
|
|
16
|
-
return test
|
|
17
|
-
print(f"sleeping for 10 seconds before trying to configure pacer again\n")
|
|
18
|
-
time.sleep(10)
|
|
19
|
-
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
20
|
-
test.add_reason("Didn't succeed to configure after two attempts - No pkt was found!")
|
|
21
|
-
return test
|
|
22
11
|
|
|
23
|
-
def metric_checking_HB(test, mgmt_type_list, tx_queue_expected, pacer_increment_expected):
|
|
12
|
+
def metric_checking_HB(test, check, mgmt_type_list, tx_queue_expected, pacer_increment_expected):
|
|
24
13
|
if not mgmt_type_list:
|
|
25
|
-
test.add_reason("\nDidn't find HB pkt, therefore
|
|
26
|
-
print(
|
|
14
|
+
test.add_reason("\nDidn't find HB pkt, therefore skip all checks\n")
|
|
15
|
+
print("Didn't find HB pkt, therefore will not check tx_queue and pacer increment")
|
|
27
16
|
else:
|
|
28
|
-
#check tx queue
|
|
17
|
+
# check tx queue
|
|
29
18
|
watermarks = [pkt.tx_queue_watermark for pkt in mgmt_type_list]
|
|
30
19
|
half_index = len(watermarks) // 2
|
|
31
20
|
tx_queue_HB = statistics.mean(watermarks[half_index:])
|
|
32
21
|
if not (tx_queue_expected[0] <= tx_queue_HB <= tx_queue_expected[1]):
|
|
33
|
-
print(f"\ntx_queue
|
|
22
|
+
print(f"\ntx_queue: {tx_queue_HB} expected: {tx_queue_expected},")
|
|
34
23
|
else:
|
|
35
24
|
print(f"\ntx_queue from HB: {tx_queue_HB}\n")
|
|
36
|
-
|
|
25
|
+
|
|
37
26
|
# check pacer increment
|
|
38
27
|
pacer_increment_HB = [pkt.effective_pacer_increment for pkt in mgmt_type_list]
|
|
39
28
|
average_pacer_increment_HB = statistics.mean(pacer_increment_HB)
|
|
40
29
|
if not (pacer_increment_expected[0] <= average_pacer_increment_HB <= pacer_increment_expected[1]):
|
|
41
|
-
test.rc = TEST_FAILED
|
|
42
|
-
test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
|
|
43
30
|
print(f"\npacer_increment value is wrong\nexpected: {pacer_increment_expected}\ngot: {average_pacer_increment_HB}")
|
|
31
|
+
if check:
|
|
32
|
+
test.rc = TEST_FAILED
|
|
33
|
+
test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
|
|
44
34
|
else:
|
|
45
|
-
test.add_reason(f"pacer_increment: {average_pacer_increment_HB}")
|
|
46
35
|
print(f"\naverage pacer_increment from HB: {average_pacer_increment_HB}\n")
|
|
36
|
+
if check:
|
|
37
|
+
test.add_reason(f"pacer_increment: {average_pacer_increment_HB}")
|
|
47
38
|
return test
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
|
|
41
|
+
def metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_pixels_expected):
|
|
50
42
|
if df.empty:
|
|
51
|
-
print(
|
|
43
|
+
print("Df is empty, therefore will not check repetitions, brg latency and num of tags")
|
|
52
44
|
test.rc = TEST_FAILED
|
|
53
|
-
test.add_reason(
|
|
45
|
+
test.add_reason("Df is empty, therefore skip all checks")
|
|
54
46
|
else:
|
|
55
47
|
print(f"result of pacer interval: {pacer_interval}\n")
|
|
56
48
|
# check repetition value
|
|
57
49
|
payload_counts_per_tag = df.groupby(TAG_ID)[PAYLOAD].value_counts()
|
|
58
50
|
average_payload_count = round(payload_counts_per_tag.mean(), 2)
|
|
59
51
|
if not repetition_value_expected[0] <= average_payload_count <= repetition_value_expected[1]:
|
|
52
|
+
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
60
53
|
if check:
|
|
61
54
|
test.rc = TEST_FAILED
|
|
62
|
-
test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected}
|
|
63
|
-
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
64
|
-
else:
|
|
65
|
-
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
55
|
+
test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected}")
|
|
66
56
|
else:
|
|
57
|
+
print(f"Repetition value is correct! got: {average_payload_count}")
|
|
67
58
|
if check:
|
|
68
59
|
test.add_reason(f"Repetition value: {average_payload_count}")
|
|
69
|
-
|
|
70
|
-
else:
|
|
71
|
-
print(f"Repetition value is correct! got: {average_payload_count}")
|
|
72
|
-
|
|
60
|
+
|
|
73
61
|
# check num of tags, with tolerance of 5%
|
|
74
|
-
num_of_tags = len(df[TAG_ID].unique())
|
|
75
|
-
if not num_of_pixels_expected*0.95 <= num_of_tags <= num_of_pixels_expected*1.05:
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
num_of_tags = len(df[TAG_ID].unique())
|
|
63
|
+
if not num_of_pixels_expected * 0.95 <= num_of_tags <= num_of_pixels_expected * 1.05:
|
|
64
|
+
print(f"\nnum of tags is not as expected\nexpected: {num_of_pixels_expected}, got: {num_of_tags}")
|
|
65
|
+
if check:
|
|
66
|
+
test.add_reason(f"num of tags: {num_of_tags}")
|
|
78
67
|
else:
|
|
79
68
|
print(f"\nnum of tags from df: {num_of_tags}\n")
|
|
80
|
-
|
|
81
|
-
#check brg_latency
|
|
82
|
-
brg_latency_avg = round(df[BRG_LATENCY].mean(),2)
|
|
83
|
-
if
|
|
84
|
-
|
|
85
|
-
print(f"Average brg_latency: {brg_latency_avg}")
|
|
86
|
-
else:
|
|
87
|
-
print(f"Average brg_latency: {brg_latency_avg}")
|
|
69
|
+
|
|
70
|
+
# check brg_latency
|
|
71
|
+
brg_latency_avg = round(df[BRG_LATENCY].mean(), 2)
|
|
72
|
+
if not (brg_latency_expected[0] <= brg_latency_avg <= brg_latency_expected[1]):
|
|
73
|
+
print(f"Average brg_latency: {brg_latency_avg} , expected: {brg_latency_expected}")
|
|
88
74
|
else:
|
|
89
75
|
print(f"Average brg_latency: {brg_latency_avg}")
|
|
90
|
-
return test
|
|
76
|
+
return test
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def combination_func(test, param, datapath_module, pacer_interval, num_of_sim_tags, repetition_value_expected,
|
|
80
|
+
tx_queue_expected, pacer_increment_expected, brg_latency_expected):
|
|
81
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
82
|
+
if test.rc == TEST_FAILED:
|
|
83
|
+
print("Failed to configure pacer interval")
|
|
84
|
+
test.add_reason("Failed to configure pacer interval")
|
|
85
|
+
return test
|
|
86
|
+
if param.name == "rep1_adaptive_pacer":
|
|
87
|
+
print(f"run phase: {param.name}")
|
|
88
|
+
df = cert_common.data_scan(test, scan_time=30, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
89
|
+
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
90
|
+
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
91
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
92
|
+
|
|
93
|
+
check = True
|
|
94
|
+
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
95
|
+
if not test.rc == TEST_FAILED:
|
|
96
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
97
|
+
return test
|
|
98
|
+
else:
|
|
99
|
+
# in case it failed because the repetition value.
|
|
100
|
+
return test
|
|
91
101
|
|
|
92
|
-
def combination_func(test, datapath_module, pacer_interval, num_of_sim_tags, repetition_value_expected, tx_queue_expected, pacer_increment_expected, brg_latency_expected):
|
|
93
|
-
test = configure_pacer_n_times(test, 2, pacer_interval, datapath_module)
|
|
94
102
|
time.sleep(30)
|
|
95
|
-
# first df
|
|
103
|
+
# first df
|
|
96
104
|
df = cert_common.data_scan(test, scan_time=30, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
97
105
|
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
98
106
|
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
99
|
-
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
100
|
-
print(
|
|
107
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
108
|
+
print("result of first df\n")
|
|
101
109
|
check = False
|
|
110
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
102
111
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
103
112
|
time.sleep(30)
|
|
104
|
-
# second df
|
|
113
|
+
# second df
|
|
105
114
|
df = cert_common.data_scan(test, scan_time=60, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
106
115
|
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
107
116
|
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
108
|
-
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
109
|
-
print(
|
|
117
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
118
|
+
print("result of second df\n")
|
|
110
119
|
check = True
|
|
120
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
111
121
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
112
|
-
test = metric_checking_HB(test, hbs, tx_queue_expected, pacer_increment_expected)
|
|
113
122
|
return test
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
|
|
125
|
+
def rep3(test, param, datapath_module, num_of_sim_tags):
|
|
126
|
+
# step 1 - config pacer interval=15 , then check repetition value = 3, tx_queue ~ 0, pacer increment ~ 0, brg latency ~ 0
|
|
127
|
+
pacer_interval = 22
|
|
128
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
129
|
+
repetition_value_expected=[2, 3], tx_queue_expected=[20, 40],
|
|
130
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[0, 10])
|
|
119
131
|
time.sleep(5)
|
|
120
132
|
return test
|
|
121
133
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
|
|
135
|
+
def rep2(test, param, datapath_module, num_of_sim_tags):
|
|
136
|
+
# step 2 - config pacer interval 9, then check repetition value = 2, tx_queue = 20-40, pacer increment = 0, brg latency = 0-200
|
|
137
|
+
pacer_interval = 12
|
|
138
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
139
|
+
repetition_value_expected=[1.5, 2.5], tx_queue_expected=[20, 40],
|
|
140
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[10, 200])
|
|
126
141
|
time.sleep(5)
|
|
127
142
|
return test
|
|
128
143
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
144
|
+
|
|
145
|
+
def rep1(test, param, datapath_module, num_of_sim_tags):
|
|
146
|
+
# "step 3 - config pacer interval 6 , then check repetition value = 1, tx_queue 40-60, pacer increment ~ 0, brg latency 200-300
|
|
147
|
+
pacer_interval = 7
|
|
148
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
149
|
+
repetition_value_expected=[1, 2], tx_queue_expected=[20, 40],
|
|
150
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[200, 300])
|
|
133
151
|
time.sleep(5)
|
|
134
152
|
return test
|
|
135
153
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
|
|
155
|
+
def rep1_adaptive_pacer(test, param, datapath_module, num_of_sim_tags):
|
|
156
|
+
# step 4 - config pacer interval 1, then check repetition value = 1, tx_queue > 60, pacer increment = 3, brg latency > 300
|
|
157
|
+
pacer_interval = 1
|
|
158
|
+
|
|
159
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
160
|
+
repetition_value_expected=[1, 2], tx_queue_expected=[20, 40],
|
|
161
|
+
pacer_increment_expected=[2, 50], brg_latency_expected=[300, 1000])
|
|
140
162
|
time.sleep(5)
|
|
141
163
|
return test
|
|
142
164
|
|
|
143
|
-
def pixels_burst(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
|
|
144
|
-
#NOTE: I skipped this phase
|
|
145
|
-
# "pixel_burst - config pacer interval 15 , then add more 200 packets with 0 delay(0.02 sec) , then check repetition value = 1 and not 2 "
|
|
146
|
-
pixel_sim_thread.stop()
|
|
147
|
-
pacer_interval = 15
|
|
148
|
-
test = configure_pacer_n_times(test, 2, pacer_interval, datapath_module)
|
|
149
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=num_of_sim_tags, duplicates=1, delay=0, pkt_types=[0],pixels_type=GEN3)
|
|
150
|
-
pixel_sim_thread.start()
|
|
151
|
-
df = cert_common.data_scan(test, scan_time=180 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
152
|
-
check = True
|
|
153
|
-
test = metric_checking_df(test, check, pacer_interval, df, [2,3], [0,10], 200)
|
|
154
|
-
# we must have df, so we will try twice again to get it
|
|
155
|
-
if test.rc == TEST_FAILED:
|
|
156
|
-
for i in range(2):
|
|
157
|
-
if test.rc == TEST_PASSED:
|
|
158
|
-
break
|
|
159
|
-
df = cert_common.data_scan(test, scan_time=30 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
160
|
-
test =metric_checking_df(test, check, pacer_interval, df, [2,3], [0,10], 200)
|
|
161
|
-
pixel_sim_thread.stop()
|
|
162
|
-
#change the number of pixels to 400, and check that the repetition value is 1 in short time
|
|
163
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=400, duplicates=1, delay=0, pkt_types=[0],pixels_type=GEN3)
|
|
164
|
-
pixel_sim_thread.start()
|
|
165
|
-
df = cert_common.data_scan(test, scan_time=30 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
166
|
-
test = metric_checking_df(test, check, pacer_interval, df, [1,2], [0,10], 400)
|
|
167
|
-
pixel_sim_thread.stop()
|
|
168
|
-
return test
|
|
169
165
|
|
|
170
166
|
def run(test):
|
|
171
167
|
# Test prolog
|
|
172
168
|
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
173
169
|
test = cert_common.test_prolog(test)
|
|
174
170
|
if test.rc == TEST_FAILED:
|
|
175
|
-
return cert_common.test_epilog(test)
|
|
176
|
-
#config GW deduplication pkts = 0
|
|
171
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
|
|
172
|
+
# config GW deduplication pkts = 0
|
|
177
173
|
print("Configuring GW with !deduplication_pkts 0")
|
|
178
174
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 0")
|
|
179
175
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
180
176
|
return cert_common.test_epilog(test, revert_gws=True)
|
|
181
177
|
|
|
182
|
-
STRESS_TEST_MAP = {"rep3":rep3, "rep2": rep2
|
|
178
|
+
STRESS_TEST_MAP = {"rep3": rep3, "rep2": rep2, "rep1": rep1, "rep1_adaptive_pacer": rep1_adaptive_pacer}
|
|
183
179
|
num_of_pixels = 300
|
|
184
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test,
|
|
180
|
+
pixel_sim_thread = cert_data_sim.DataSimThread(test=test,
|
|
181
|
+
num_of_pixels=num_of_pixels,
|
|
182
|
+
duplicates=1,
|
|
183
|
+
delay=0,
|
|
184
|
+
pkt_types=[0],
|
|
185
|
+
pixels_type=GEN3)
|
|
185
186
|
pixel_sim_thread.start()
|
|
186
187
|
time.sleep(30)
|
|
187
188
|
for param in test.params:
|
|
188
189
|
functionality_run_print(param.name)
|
|
189
|
-
test = STRESS_TEST_MAP[param.value](test, datapath_module, num_of_pixels)
|
|
190
|
+
test = STRESS_TEST_MAP[param.value](test, param, datapath_module, num_of_pixels)
|
|
190
191
|
generate_log_file(test, param.name)
|
|
191
192
|
field_functionality_pass_fail_print(test, param.name)
|
|
192
193
|
test.set_phase_rc(param.name, test.rc)
|
|
@@ -200,4 +201,4 @@ def run(test):
|
|
|
200
201
|
# Re-enable unified packets deduplication
|
|
201
202
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 1")
|
|
202
203
|
|
|
203
|
-
return cert_common.test_epilog(test, revert_brgs=True,
|
|
204
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"module": "
|
|
4
|
-
"purpose":
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "Stress Test Gen2 Pixels",
|
|
3
|
+
"module": "Datapath",
|
|
4
|
+
"purpose": "verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly under stress conditions with Gen3 pixels",
|
|
5
|
+
"documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Relaying-data",
|
|
6
|
+
"add more links here - about adaptive repetition, adaptive pacer"],
|
|
7
7
|
"initialCondition": "Bridge configured to defaults",
|
|
8
|
-
"procedure": [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
"procedure": ["Test prolog",
|
|
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
|
+
"rep 1 adaptive pacer - config pacer interval 1, then check repetition value = 1, pacer increment = 3 , num of tags = all tags",
|
|
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",
|
|
17
17
|
"mandatory": 1,
|
|
18
18
|
"multiBridgeTest": 0,
|
|
19
19
|
"gwOnlyTest": 0,
|
|
20
|
-
"internalBridge":
|
|
20
|
+
"internalBridge": 0,
|
|
21
21
|
"allSupportedValues": ["rep3", "rep2", "rep1", "rep1_adaptive_pacer"]
|
|
22
|
-
|
|
23
22
|
}
|
|
@@ -8,185 +8,186 @@ from brg_certificate.cert_gw_sim import DEDUPLICATION_PKTS
|
|
|
8
8
|
import statistics
|
|
9
9
|
import time
|
|
10
10
|
|
|
11
|
-
def configure_pacer_n_times(test, num_of_times, pacer_interval, datapath_module):
|
|
12
|
-
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
13
|
-
if test.rc == TEST_FAILED:
|
|
14
|
-
for i in range(num_of_times):
|
|
15
|
-
if test.rc == TEST_PASSED:
|
|
16
|
-
return test
|
|
17
|
-
print(f"sleeping for 10 seconds before trying to configure pacer again\n")
|
|
18
|
-
time.sleep(10)
|
|
19
|
-
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
20
|
-
test.add_reason("Didn't succeed to configure after two attempts - No pkt was found!")
|
|
21
|
-
return test
|
|
22
11
|
|
|
23
|
-
def metric_checking_HB(test, mgmt_type_list, tx_queue_expected, pacer_increment_expected):
|
|
12
|
+
def metric_checking_HB(test, check, mgmt_type_list, tx_queue_expected, pacer_increment_expected):
|
|
24
13
|
if not mgmt_type_list:
|
|
25
|
-
test.add_reason("\nDidn't find HB pkt, therefore
|
|
26
|
-
print(
|
|
14
|
+
test.add_reason("\nDidn't find HB pkt, therefore skip all checks\n")
|
|
15
|
+
print("Didn't find HB pkt, therefore will not check tx_queue and pacer increment")
|
|
27
16
|
else:
|
|
28
|
-
#check tx queue
|
|
17
|
+
# check tx queue
|
|
29
18
|
watermarks = [pkt.tx_queue_watermark for pkt in mgmt_type_list]
|
|
30
19
|
half_index = len(watermarks) // 2
|
|
31
20
|
tx_queue_HB = statistics.mean(watermarks[half_index:])
|
|
32
21
|
if not (tx_queue_expected[0] <= tx_queue_HB <= tx_queue_expected[1]):
|
|
33
|
-
print(f"\ntx_queue
|
|
22
|
+
print(f"\ntx_queue: {tx_queue_HB} expected: {tx_queue_expected},")
|
|
34
23
|
else:
|
|
35
24
|
print(f"\ntx_queue from HB: {tx_queue_HB}\n")
|
|
36
|
-
|
|
25
|
+
|
|
37
26
|
# check pacer increment
|
|
38
27
|
pacer_increment_HB = [pkt.effective_pacer_increment for pkt in mgmt_type_list]
|
|
39
28
|
average_pacer_increment_HB = statistics.mean(pacer_increment_HB)
|
|
40
29
|
if not (pacer_increment_expected[0] <= average_pacer_increment_HB <= pacer_increment_expected[1]):
|
|
41
|
-
test.rc = TEST_FAILED
|
|
42
|
-
test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
|
|
43
30
|
print(f"\npacer_increment value is wrong\nexpected: {pacer_increment_expected}\ngot: {average_pacer_increment_HB}")
|
|
31
|
+
if check:
|
|
32
|
+
test.rc = TEST_FAILED
|
|
33
|
+
test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
|
|
44
34
|
else:
|
|
45
|
-
test.add_reason(f"pacer_increment: {average_pacer_increment_HB}")
|
|
46
35
|
print(f"\naverage pacer_increment from HB: {average_pacer_increment_HB}\n")
|
|
36
|
+
if check:
|
|
37
|
+
test.add_reason(f"pacer_increment: {average_pacer_increment_HB}")
|
|
47
38
|
return test
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
|
|
41
|
+
def metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_pixels_expected):
|
|
50
42
|
if df.empty:
|
|
51
|
-
print(
|
|
43
|
+
print("Df is empty, therefore will not check repetitions, brg latency and num of tags")
|
|
52
44
|
test.rc = TEST_FAILED
|
|
53
|
-
test.add_reason(
|
|
45
|
+
test.add_reason("Df is empty, therefore skip all checks")
|
|
54
46
|
else:
|
|
55
47
|
print(f"result of pacer interval: {pacer_interval}\n")
|
|
56
48
|
# check repetition value
|
|
57
49
|
payload_counts_per_tag = df.groupby(TAG_ID)[PAYLOAD].value_counts()
|
|
58
50
|
average_payload_count = round(payload_counts_per_tag.mean(), 2)
|
|
59
51
|
if not repetition_value_expected[0] <= average_payload_count <= repetition_value_expected[1]:
|
|
52
|
+
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
60
53
|
if check:
|
|
61
54
|
test.rc = TEST_FAILED
|
|
62
|
-
test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected}
|
|
63
|
-
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
64
|
-
else:
|
|
65
|
-
print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
|
|
55
|
+
test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected}")
|
|
66
56
|
else:
|
|
57
|
+
print(f"Repetition value is correct! got: {average_payload_count}")
|
|
67
58
|
if check:
|
|
68
59
|
test.add_reason(f"Repetition value: {average_payload_count}")
|
|
69
|
-
|
|
70
|
-
else:
|
|
71
|
-
print(f"Repetition value is correct! got: {average_payload_count}")
|
|
72
|
-
|
|
60
|
+
|
|
73
61
|
# check num of tags, with tolerance of 5%
|
|
74
|
-
num_of_tags = len(df[TAG_ID].unique())
|
|
75
|
-
if not num_of_pixels_expected*0.95 <= num_of_tags <= num_of_pixels_expected*1.05:
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
num_of_tags = len(df[TAG_ID].unique())
|
|
63
|
+
if not num_of_pixels_expected * 0.95 <= num_of_tags <= num_of_pixels_expected * 1.05:
|
|
64
|
+
print(f"\nnum of tags is not as expected\nexpected: {num_of_pixels_expected}, got: {num_of_tags}")
|
|
65
|
+
if check:
|
|
66
|
+
test.add_reason(f"num of tags: {num_of_tags}")
|
|
78
67
|
else:
|
|
79
68
|
print(f"\nnum of tags from df: {num_of_tags}\n")
|
|
80
|
-
|
|
81
|
-
#check brg_latency
|
|
82
|
-
brg_latency_avg = round(df[BRG_LATENCY].mean(),2)
|
|
83
|
-
if
|
|
84
|
-
|
|
85
|
-
print(f"Average brg_latency: {brg_latency_avg}")
|
|
86
|
-
else:
|
|
87
|
-
print(f"Average brg_latency: {brg_latency_avg}")
|
|
69
|
+
|
|
70
|
+
# check brg_latency
|
|
71
|
+
brg_latency_avg = round(df[BRG_LATENCY].mean(), 2)
|
|
72
|
+
if not (brg_latency_expected[0] <= brg_latency_avg <= brg_latency_expected[1]):
|
|
73
|
+
print(f"Average brg_latency: {brg_latency_avg} , expected: {brg_latency_expected}")
|
|
88
74
|
else:
|
|
89
75
|
print(f"Average brg_latency: {brg_latency_avg}")
|
|
90
|
-
return test
|
|
76
|
+
return test
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def combination_func(test, param, datapath_module, pacer_interval, num_of_sim_tags, repetition_value_expected,
|
|
80
|
+
tx_queue_expected, pacer_increment_expected, brg_latency_expected):
|
|
81
|
+
test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
|
|
82
|
+
if test.rc == TEST_FAILED:
|
|
83
|
+
print("Failed to configure pacer interval")
|
|
84
|
+
test.add_reason("Failed to configure pacer interval")
|
|
85
|
+
return test
|
|
86
|
+
if param.name == "rep1_adaptive_pacer":
|
|
87
|
+
print(f"run phase: {param.name}")
|
|
88
|
+
df = cert_common.data_scan(test, scan_time=30, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
89
|
+
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
90
|
+
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
91
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
92
|
+
|
|
93
|
+
check = True
|
|
94
|
+
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
95
|
+
if not test.rc == TEST_FAILED:
|
|
96
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
97
|
+
return test
|
|
98
|
+
else:
|
|
99
|
+
# in case it failed because the repetition value.
|
|
100
|
+
return test
|
|
91
101
|
|
|
92
|
-
def combination_func(test, datapath_module, pacer_interval, num_of_sim_tags, repetition_value_expected, tx_queue_expected, pacer_increment_expected, brg_latency_expected):
|
|
93
|
-
test = configure_pacer_n_times(test, 2, pacer_interval, datapath_module)
|
|
94
102
|
time.sleep(30)
|
|
95
|
-
# first df
|
|
103
|
+
# first df
|
|
96
104
|
df = cert_common.data_scan(test, scan_time=30, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
97
105
|
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
98
106
|
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
99
|
-
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
100
|
-
print(
|
|
107
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
108
|
+
print("result of first df\n")
|
|
101
109
|
check = False
|
|
110
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
102
111
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
103
112
|
time.sleep(30)
|
|
104
|
-
# second df
|
|
113
|
+
# second df
|
|
105
114
|
df = cert_common.data_scan(test, scan_time=60, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
106
115
|
cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
|
|
107
116
|
test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
|
|
108
|
-
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
109
|
-
print(
|
|
117
|
+
hbs = [p[MGMT_PKT].pkt for p in hbs]
|
|
118
|
+
print("result of second df\n")
|
|
110
119
|
check = True
|
|
120
|
+
test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
|
|
111
121
|
test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
|
|
112
|
-
test = metric_checking_HB(test, hbs, tx_queue_expected, pacer_increment_expected)
|
|
113
122
|
return test
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
|
|
125
|
+
def rep3(test, param, datapath_module, num_of_sim_tags):
|
|
126
|
+
# step 1 - config pacer interval=15 , then check repetition value = 3, tx_queue ~ 0, pacer increment ~ 0, brg latency ~ 0
|
|
127
|
+
pacer_interval = 22
|
|
128
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
129
|
+
repetition_value_expected=[2, 3], tx_queue_expected=[20, 40],
|
|
130
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[0, 10])
|
|
119
131
|
time.sleep(5)
|
|
120
132
|
return test
|
|
121
133
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
|
|
135
|
+
def rep2(test, param, datapath_module, num_of_sim_tags):
|
|
136
|
+
# step 2 - config pacer interval 9, then check repetition value = 2, tx_queue = 20-40, pacer increment = 0, brg latency = 0-200
|
|
137
|
+
pacer_interval = 12
|
|
138
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
139
|
+
repetition_value_expected=[1.5, 2.5], tx_queue_expected=[20, 40],
|
|
140
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[10, 200])
|
|
126
141
|
time.sleep(5)
|
|
127
142
|
return test
|
|
128
143
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
144
|
+
|
|
145
|
+
def rep1(test, param, datapath_module, num_of_sim_tags):
|
|
146
|
+
# "step 3 - config pacer interval 6 , then check repetition value = 1, tx_queue 40-60, pacer increment ~ 0, brg latency 200-300
|
|
147
|
+
pacer_interval = 7
|
|
148
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
149
|
+
repetition_value_expected=[1, 2], tx_queue_expected=[20, 40],
|
|
150
|
+
pacer_increment_expected=[0, 2], brg_latency_expected=[200, 300])
|
|
133
151
|
time.sleep(5)
|
|
134
152
|
return test
|
|
135
153
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
|
|
155
|
+
def rep1_adaptive_pacer(test, param, datapath_module, num_of_sim_tags):
|
|
156
|
+
# step 4 - config pacer interval 1, then check repetition value = 1, tx_queue > 60, pacer increment = 3, brg latency > 300
|
|
157
|
+
pacer_interval = 1
|
|
158
|
+
|
|
159
|
+
test = combination_func(test, param, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags,
|
|
160
|
+
repetition_value_expected=[1, 2], tx_queue_expected=[20, 40],
|
|
161
|
+
pacer_increment_expected=[2, 50], brg_latency_expected=[300, 1000])
|
|
140
162
|
time.sleep(5)
|
|
141
163
|
return test
|
|
142
164
|
|
|
143
|
-
def pixels_burst(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
|
|
144
|
-
#NOTE: I skipped this phase
|
|
145
|
-
# "pixel_burst - config pacer interval 15 , then add more 200 packets with 0 delay(0.02 sec) , then check repetition value = 1 and not 2 "
|
|
146
|
-
pixel_sim_thread.stop()
|
|
147
|
-
pacer_interval = 15
|
|
148
|
-
test = configure_pacer_n_times(test, 2, pacer_interval, datapath_module)
|
|
149
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=num_of_sim_tags, duplicates=1, delay=0, pkt_types=[0],pixels_type=GEN2)
|
|
150
|
-
pixel_sim_thread.start()
|
|
151
|
-
df = cert_common.data_scan(test, scan_time=180 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
152
|
-
check = True
|
|
153
|
-
test = metric_checking_df(test, check, pacer_interval, df, [2,3], [0,10], 200)
|
|
154
|
-
# we must have df, so we will try twice again to get it
|
|
155
|
-
if test.rc == TEST_FAILED:
|
|
156
|
-
for i in range(2):
|
|
157
|
-
if test.rc == TEST_PASSED:
|
|
158
|
-
break
|
|
159
|
-
df = cert_common.data_scan(test, scan_time=30 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
160
|
-
test =metric_checking_df(test, check, pacer_interval, df, [2,3], [0,10], 200)
|
|
161
|
-
pixel_sim_thread.stop()
|
|
162
|
-
#change the number of pixels to 400, and check that the repetition value is 1 in short time
|
|
163
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=400, duplicates=1, delay=0, pkt_types=[0],pixels_type=GEN2)
|
|
164
|
-
pixel_sim_thread.start()
|
|
165
|
-
df = cert_common.data_scan(test, scan_time=30 , brg_data=(not test.internal_brg), gw_data=test.internal_brg)
|
|
166
|
-
test = metric_checking_df(test, check, pacer_interval, df, [1,2], [0,10], 400)
|
|
167
|
-
pixel_sim_thread.stop()
|
|
168
|
-
return test
|
|
169
165
|
|
|
170
166
|
def run(test):
|
|
171
167
|
# Test prolog
|
|
172
168
|
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
173
169
|
test = cert_common.test_prolog(test)
|
|
174
170
|
if test.rc == TEST_FAILED:
|
|
175
|
-
return cert_common.test_epilog(test)
|
|
176
|
-
#config GW deduplication pkts = 0
|
|
171
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
|
|
172
|
+
# config GW deduplication pkts = 0
|
|
177
173
|
print("Configuring GW with !deduplication_pkts 0")
|
|
178
174
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 0")
|
|
179
175
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
180
176
|
return cert_common.test_epilog(test, revert_gws=True)
|
|
181
177
|
|
|
182
|
-
STRESS_TEST_MAP = {"rep3":rep3, "rep2": rep2
|
|
178
|
+
STRESS_TEST_MAP = {"rep3": rep3, "rep2": rep2, "rep1": rep1, "rep1_adaptive_pacer": rep1_adaptive_pacer}
|
|
183
179
|
num_of_pixels = 300
|
|
184
|
-
pixel_sim_thread = cert_data_sim.DataSimThread(test=test,
|
|
180
|
+
pixel_sim_thread = cert_data_sim.DataSimThread(test=test,
|
|
181
|
+
num_of_pixels=num_of_pixels,
|
|
182
|
+
duplicates=1,
|
|
183
|
+
delay=0,
|
|
184
|
+
pkt_types=[0],
|
|
185
|
+
pixels_type=GEN2)
|
|
185
186
|
pixel_sim_thread.start()
|
|
186
187
|
time.sleep(30)
|
|
187
188
|
for param in test.params:
|
|
188
189
|
functionality_run_print(param.name)
|
|
189
|
-
test = STRESS_TEST_MAP[param.value](test, datapath_module, num_of_pixels)
|
|
190
|
+
test = STRESS_TEST_MAP[param.value](test, param, datapath_module, num_of_pixels)
|
|
190
191
|
generate_log_file(test, param.name)
|
|
191
192
|
field_functionality_pass_fail_print(test, param.name)
|
|
192
193
|
test.set_phase_rc(param.name, test.rc)
|
|
@@ -200,4 +201,4 @@ def run(test):
|
|
|
200
201
|
# Re-enable unified packets deduplication
|
|
201
202
|
cert_config.gw_action(test, f"{DEDUPLICATION_PKTS} 1")
|
|
202
203
|
|
|
203
|
-
return cert_common.test_epilog(test, revert_brgs=True,
|
|
204
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
|