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.
Files changed (98) hide show
  1. brg_certificate/ag/wlt_cmd_if.html +3 -2
  2. brg_certificate/brg_certificate_cli.py +18 -3
  3. brg_certificate/cert_common.py +82 -26
  4. brg_certificate/cert_data_sim.py +22 -4
  5. brg_certificate/cert_defines.py +10 -5
  6. brg_certificate/cert_gw_sim.py +4 -2
  7. brg_certificate/cert_mqtt.py +7 -6
  8. brg_certificate/cert_prints.py +14 -1
  9. brg_certificate/cert_protobuf.py +7 -7
  10. brg_certificate/cert_results.py +91 -64
  11. brg_certificate/cert_utils.py +9 -4
  12. brg_certificate/certificate_bcc_sanity_test_list.txt +10 -5
  13. brg_certificate/certificate_bcc_test_list.txt +14 -9
  14. brg_certificate/certificate_sanity_test_list.txt +10 -4
  15. brg_certificate/certificate_test_list.txt +13 -9
  16. brg_certificate/tests/calibration/interval_test/interval_test.json +2 -2
  17. brg_certificate/tests/calibration/output_power_test/output_power_test.json +3 -2
  18. brg_certificate/tests/calibration/pattern_test/pattern_test.json +2 -2
  19. brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
  20. brg_certificate/tests/datapath/aging_test/aging_test.json +4 -5
  21. brg_certificate/tests/datapath/aging_test/aging_test.py +39 -32
  22. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -2
  23. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
  24. brg_certificate/tests/datapath/output_power_test/output_power_test.json +2 -2
  25. brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
  26. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +3 -3
  27. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
  28. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +2 -2
  29. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
  30. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -2
  31. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
  32. brg_certificate/tests/datapath/pattern_test/pattern_test.json +2 -2
  33. brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
  34. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +3 -3
  35. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
  36. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -2
  37. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
  38. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -2
  39. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
  40. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -3
  41. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
  42. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  43. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
  44. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +3 -3
  45. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
  46. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +3 -3
  47. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
  48. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +8 -8
  49. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +102 -101
  50. brg_certificate/tests/datapath/stress_test/stress_test.json +14 -15
  51. brg_certificate/tests/datapath/stress_test/stress_test.py +102 -101
  52. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +2 -2
  53. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
  54. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -2
  55. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
  56. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +2 -2
  57. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -18
  58. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +14 -8
  59. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -8
  60. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +2 -2
  61. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +22 -9
  62. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +2 -2
  63. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +6 -5
  64. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +3 -3
  65. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
  66. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +3 -3
  67. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
  68. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +4 -3
  69. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
  70. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +3 -3
  71. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
  72. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +5 -5
  73. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +109 -112
  74. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +5 -5
  75. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +111 -114
  76. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +12 -6
  77. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
  78. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +4 -4
  79. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +158 -172
  80. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -2
  81. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
  82. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +4 -3
  83. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
  84. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -7
  85. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
  86. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +2 -2
  87. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
  88. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
  89. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
  90. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
  91. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
  92. brg_certificate/wlt_types.py +2 -1
  93. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +40 -40
  94. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +98 -94
  95. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
  96. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
  97. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/licenses/LICENSE +0 -0
  98. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
@@ -4,18 +4,22 @@ from brg_certificate.wlt_types import *
4
4
  import brg_certificate.cert_common as cert_common
5
5
  import brg_certificate.cert_config as cert_config
6
6
 
7
+
7
8
  def is_primary_channel(channel):
8
9
  if channel == ag.RX_CHANNEL_37 or channel == ag.RX_CHANNEL_38 or channel == ag.RX_CHANNEL_39:
9
10
  return True
10
11
  else:
11
12
  return False
12
13
 
14
+
13
15
  def run(test):
14
16
 
15
17
  fields = [BRG_RX_CHANNEL]
16
18
  print(test.params)
17
- datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
18
- ble5_state = False # We use this flag to know whether the BRG is currently in BLE5 mode and needs special configuration next time it is configured
19
+ datapath_module = cert_common.get_module_by_name(test.active_brg.modules, "Datapath")
20
+
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
+ ble5_state = False
19
23
 
20
24
  test = cert_common.test_prolog(test)
21
25
  if test.rc == TEST_FAILED:
@@ -38,4 +42,4 @@ def run(test):
38
42
  else:
39
43
  test.reset_result()
40
44
 
41
- return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module], ble5=ble5_state)
45
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module], ble5=ble5_state)
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "rx_rate_gen2",
3
- "module": "datapath",
4
- "purpose": ["Verify the accuracy of the RX rate value"],
2
+ "name": "Rx Rate Gen2 Pixels",
3
+ "module": "Datapath",
4
+ "purpose": "Verify the accuracy of the RX rate value",
5
5
  "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Pacing",
6
6
  "initialCondition": "Bridge set to default configuration",
7
7
  "procedure": [
@@ -7,168 +7,202 @@ 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
+
10
11
  def cal_scan_time(test, delay, pacer_interval):
11
12
  # Calculate the scan time to ensure at least 5 packets are captured in data scan
12
- # define the num of packet that you want to get
13
- num_of_sending_pkt = 2 # actually it will be 3 because the first one always send
14
- delay = delay/1000
15
- if delay < pacer_interval :
16
- 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 = 2 # 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
17
18
  elif pacer_interval <= delay:
18
- scan_time = (delay*num_of_sending_pkt)+10
19
- # verify scan time value
20
- if scan_time < (2*pacer_interval):
21
- print(f"scan time is too low in related to pacer interval")
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")
22
23
  test.rc == TEST_FAILED
23
- test.add_reason(f"scan time is too low in related to pacer interval value")
24
+ test.add_reason("scan time is too low in related to pacer interval value")
24
25
  return test, scan_time
25
26
 
26
- def scan_and_compare(test, pacer_interval, delay ,expected_address_value):
27
- pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3, delay=delay, pkt_types=[0], pixels_type=GEN2)
27
+
28
+ def scan_and_compare(test, pacer_interval, delay, expected_address_value):
29
+
30
+ pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3, delay=delay, pkt_types=[0], pixels_type=GEN3)
28
31
  pixel_sim_thread.start()
29
- test, scan_time = cal_scan_time(test, delay, pacer_interval)
32
+ test, scan_time = cal_scan_time(test, delay, pacer_interval)
30
33
  df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
31
34
  pixel_sim_thread.stop()
32
35
  cert_mqtt.dump_pkts(test, log="rx_rate")
33
36
  cert_common.display_data(df, tbc=True, nfpkt=True, rssi=True, dir=test.dir)
34
-
37
+
35
38
  if df.empty:
36
- print(f"df is empty")
39
+ print("Df is empty")
40
+ test.rc = TEST_FAILED
41
+ test.add_reason("Df is empty")
42
+ return test
37
43
  else:
38
- df = df[[TAG_ID, TBC]]
39
- print(f"df:\n {df}")
44
+ # Divided the dataframe by tag_id and continue with df's tag that has the highest number of rows.
40
45
  tag_counts = df[TAG_ID].value_counts()
41
46
  print(f"Tag counts:\n{tag_counts.to_string(header=False)}")
42
47
  most_common_tag = tag_counts.idxmax()
43
48
  print(f"Most common tag: {most_common_tag}")
44
49
  df = df[df[TAG_ID] == most_common_tag]
50
+ df = df[[TAG_ID, TBC, PACKET_TYPE, DATETIME]]
51
+ print(f"df:\n {df}")
45
52
 
46
53
  tag = df.iloc[0][TAG_ID]
47
- # iloc [1:] to skip the first value of tbc_values which could be 0 sometimes.
48
- actual_address_value = df.iloc[1:][TBC].mean() # extract the tbc value from df
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
49
56
  print(f"\nactual address value: {actual_address_value}\nexpected address value: {expected_address_value}")
50
- THRESHOLD_ADDRESS_VALUE = 5
57
+ THRESHOLD_ADDRESS_VALUE = 5
51
58
  # check if the actual address value is in the range of -+5 of the expected address value
52
- if not ((expected_address_value-THRESHOLD_ADDRESS_VALUE) <= actual_address_value <= (expected_address_value+THRESHOLD_ADDRESS_VALUE)):
53
- print(f"\n Address value for tag {tag} is {actual_address_value} when the expected value: {expected_address_value}!\n")
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")
54
62
  test.rc = TEST_FAILED
55
- test.add_reason(f"Address value for tag {tag} is {actual_address_value} instead of {expected_address_value}!")
63
+ test.add_reason(f"Address value for tag {tag} is {actual_address_value} expected: {expected_address_value}!\n")
56
64
  if test.params == [mid_values] and delay == 1000:
57
65
  # checking 0 value in the first packet.
58
66
  first_row = df.iloc[0][TBC]
59
67
  second_row = df.iloc[1][TBC]
60
68
  if first_row != 0 and second_row != 0:
61
69
  test.rc = TEST_FAILED
62
- test.add_reason(f"first tbc value is not 0 as supposed to be while sanity checking")
63
- return test
70
+ test.add_reason("first tbc value is not 0 as supposed to be while sanity checking")
71
+ return test
72
+
64
73
 
65
74
  def mid_values(test, datapath_module):
66
- # mid values - Sanity check: Generate packets with delays of 1, 5, and 0.5 seconds. Check address values 192, 243, and 128. Verify that the address value is 0 for the first packet.
67
- SANITY_DELAY_ADDRESS_VALUES = { 1000: 192, 5000: 243, 500: 128 }
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}
68
78
  for delay, expected_address_value in SANITY_DELAY_ADDRESS_VALUES.items():
69
- pacer_interval = 1
70
- test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=expected_address_value)
79
+ pacer_interval = 1
80
+ test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=expected_address_value)
71
81
  time.sleep(2)
72
82
  return test
73
-
83
+
84
+
74
85
  def diff_pacer(test, datapath_module):
75
86
  # diff pacer - Generate packets with a 1-second delay and pacer intervals of 30 and 60. Ensure the address value remains 192.
76
- SANITY_ADDRESS_VALUE = 192
87
+ SANITY_ADDRESS_VALUE = 192
77
88
  PACER_INTERVAL_LIST = [30, 60]
78
- delay = 1000 # 1 sec
89
+ delay = 1000 # 1 sec
79
90
  for pacer_interval in PACER_INTERVAL_LIST:
80
91
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
81
- if test.rc ==TEST_FAILED:
92
+ if test.rc == TEST_FAILED:
82
93
  test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
83
- return test
94
+ return test
84
95
  test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=SANITY_ADDRESS_VALUE)
85
96
  time.sleep(2)
86
97
  return test
87
98
 
99
+
88
100
  def min_value(test, datapath_module):
89
101
  # min_value - Minimum value: Generate packets with a 0.1-second delay. Verify that the address value is 1.
90
- MIN_ADDRESS_VALUE = 1
91
- pacer_interval = 1
102
+ MIN_ADDRESS_VALUE = 1
103
+ pacer_interval = 1
92
104
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
93
- if test.rc ==TEST_FAILED:
105
+ if test.rc == TEST_FAILED:
94
106
  test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
95
- return test
107
+ return test
96
108
  delay = 100
97
- test = scan_and_compare(test, pacer_interval=pacer_interval ,delay=delay, expected_address_value=MIN_ADDRESS_VALUE)
109
+ test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=MIN_ADDRESS_VALUE)
98
110
  time.sleep(2)
99
- return test
111
+ return test
112
+
100
113
 
101
114
  def max_value(test, datapath_module):
102
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.
103
116
  MAX_ADDRESS_VALUE = 255
104
117
  pacer_interval = 80
105
118
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
106
- if test.rc ==TEST_FAILED:
119
+ if test.rc == TEST_FAILED:
107
120
  test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
108
- return test
121
+ return test
109
122
  delay = 70000
110
- test = scan_and_compare(test, pacer_interval=pacer_interval ,delay=delay, expected_address_value=MAX_ADDRESS_VALUE)
123
+ test = scan_and_compare(test, pacer_interval=pacer_interval, delay=delay, expected_address_value=MAX_ADDRESS_VALUE)
111
124
  time.sleep(2)
112
- return test
125
+ return test
126
+
113
127
 
114
128
  def diff_rate(test, datapath_module):
115
129
  # diff rate - a filter: Generate packets with delay 1 and change to 5, according the delay change test the tolerance address value
116
- pacer_interval = 1
130
+ pacer_interval = 1
117
131
  delay_duration = [[500, 5], [3000, 3]]
118
- first_delay = delay_duration[0][0]
119
- first_duration = delay_duration[0][1]
120
- second_delay = delay_duration[1][0]
132
+ first_delay = delay_duration[0][0]
133
+ first_duration = delay_duration[0][1]
134
+ second_delay = delay_duration[1][0]
121
135
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
122
- if test.rc ==TEST_FAILED:
136
+ if test.rc == TEST_FAILED:
123
137
  test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
124
- return test
125
- pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=2, delay=first_delay, pkt_types=[0],pixels_type=GEN2)
138
+ return test
139
+ pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=2,
140
+ delay=first_delay, pkt_types=[0], pixels_type=GEN2)
126
141
  pixel_sim_thread.start()
127
- time_sleep = first_duration-((first_delay/1000)/2)
128
- print(f"time_sleep:{time_sleep}")
142
+ time_sleep = first_duration - ((first_delay / 1000) / 2)
143
+ print(f"sleep for {time_sleep} sec\n")
129
144
  time.sleep(time_sleep)
130
145
  pixel_sim_thread.delay = second_delay
131
- scan_time = sum(duration for _, duration in delay_duration)+20
146
+ scan_time = sum(duration for _, duration in delay_duration) + 20
132
147
  df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
133
148
  pixel_sim_thread.stop()
134
149
  df = df[[TAG_ID, TBC]]
135
- print(f"df: {df}")
136
150
 
137
- #NOTE: all the next code rows are specific for the values: delay 0.5 and 3, and in relation address values 128 and 235
151
+ if df.empty:
152
+ test.add_reason("Df is empty")
153
+ test.rc = TEST_FAILED
154
+ return test
155
+ else:
156
+ print(f"Df:\n {df}")
157
+ # NOTE: all next rows are specific for the values: delay 0.5 and 3, and in relation address values 128 and 235
138
158
  # check if the last tbc value is as we expected for delay 3 sec we need to get 235 according to LUT table
139
- # we define tolerance of +-2 units for address value
159
+ # we define tolerance of +-2 units for address value
140
160
  if df.iloc[-1][TBC] not in range(232, 237):
141
161
  test.rc = TEST_FAILED
142
- test.add_reason(f"Last tbc value is not within the range of 232 to 236 as expected with delay:{second_delay/1000} sec")
162
+ test.add_reason(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236]")
163
+ print(f"TBC value: {df.iloc[-1][TBC]}, expected value [232,236] according to delay:{second_delay / 1000} sec")
164
+ # skip the first packet in case the second one is still from the last delay value
165
+ index = 0
166
+ if df.iloc[1][TBC] in range(232, 237):
167
+ index = 1
143
168
 
144
- # verify the first tbc value
145
- first_tbc = df.iloc[0][TBC]
146
- if first_tbc not in range(123,134):
169
+ # verify the first tbc value
170
+ first_tbc = df.iloc[index][TBC]
171
+ if first_tbc not in range(120, 145):
147
172
  test.rc = TEST_FAILED
148
- test.add_reason(f"tbc value of last packet before the delay change is incorrect")
173
+ test.add_reason(f"TBC value: {first_tbc}, expected value [120,144]")
174
+ print(f"TBC value of last packet before the delay change is wrong\n"
175
+ f"TBC value: {first_tbc}, expected value [120,144] according to delay:{first_delay / 1000} sec")
149
176
 
150
- # check the first change of tbc value after delay changing
151
- second_tbc = df.iloc[1][TBC]
152
- expected_address_value = 200
153
- if not expected_address_value-2 <= second_tbc <= expected_address_value+2:
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:
154
183
  test.rc = TEST_FAILED
155
- test.add_reason(f"the first change of address value is not correct, alpha filter probably is not define well")
184
+ test.add_reason(f"TBC value: {second_tbc}, expected value [196,204]")
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]")
156
188
  return test
157
189
 
190
+
158
191
  def run(test):
159
192
  # "Test prolog"
160
193
  datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
161
194
  test = cert_common.test_prolog(test)
162
195
  if test.rc == TEST_FAILED:
163
196
  return cert_common.test_epilog(test)
164
-
165
- pacer_interval =1
197
+
198
+ pacer_interval = 1
166
199
  test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
167
- if test.rc ==TEST_FAILED:
200
+ if test.rc == TEST_FAILED:
168
201
  test.add_reason(f"Didn't succeed to config pacer interval {pacer_interval}")
169
- return test
202
+ return test
170
203
 
171
- RX_RATE_TEST_MAP = {"mid_values": mid_values, "diff_pacer": diff_pacer, "min_value": min_value, "max_value": max_value, "diff_rate": diff_rate }
204
+ RX_RATE_TEST_MAP = {"mid_values": mid_values, "diff_pacer": diff_pacer, "min_value": min_value,
205
+ "max_value": max_value, "diff_rate": diff_rate}
172
206
  for param in test.params:
173
207
  functionality_run_print(param.name)
174
208
  test = RX_RATE_TEST_MAP[param.value](test, datapath_module)
@@ -181,4 +215,4 @@ def run(test):
181
215
  else:
182
216
  test.reset_result()
183
217
 
184
- return cert_common.test_epilog(test)
218
+ return cert_common.test_epilog(test)
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "rx_rate_gen3",
3
- "module": "datapath",
4
- "purpose": ["Verify the accuracy of the RX rate value"],
2
+ "name": "Rx Rate Gen3 Pixels",
3
+ "module": "Datapath",
4
+ "purpose": "Verify the accuracy of the RX rate value",
5
5
  "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Pacing",
6
6
  "initialCondition": "Bridge set to default configuration",
7
7
  "procedure": [