wiliot-certificate 1.5.1a1__py3-none-any.whl → 1.5.3a1__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 (133) hide show
  1. brg_certificate/ag/energous_v0_defines.py +3 -3
  2. brg_certificate/ag/energous_v1_defines.py +3 -3
  3. brg_certificate/ag/energous_v2_defines.py +3 -3
  4. brg_certificate/ag/energous_v3_defines.py +3 -3
  5. brg_certificate/ag/energous_v4_defines.py +3 -3
  6. brg_certificate/ag/fanstel_lan_v0_defines.py +3 -3
  7. brg_certificate/ag/fanstel_lte_v0_defines.py +3 -3
  8. brg_certificate/ag/fanstel_wifi_v0_defines.py +3 -3
  9. brg_certificate/ag/minew_lte_v0_defines.py +3 -3
  10. brg_certificate/ag/wlt_cmd_if.html +3 -2
  11. brg_certificate/ag/wlt_types.html +3 -3
  12. brg_certificate/ag/wlt_types_ag.py +8 -8
  13. brg_certificate/brg_certificate_cli.py +18 -3
  14. brg_certificate/cert_common.py +134 -28
  15. brg_certificate/cert_config.py +12 -7
  16. brg_certificate/cert_data_sim.py +22 -4
  17. brg_certificate/cert_defines.py +10 -5
  18. brg_certificate/cert_gw_sim.py +4 -2
  19. brg_certificate/cert_mqtt.py +7 -6
  20. brg_certificate/cert_prints.py +14 -1
  21. brg_certificate/cert_protobuf.py +7 -7
  22. brg_certificate/cert_results.py +91 -64
  23. brg_certificate/cert_utils.py +12 -5
  24. brg_certificate/certificate_bcc_sanity_test_list.txt +10 -5
  25. brg_certificate/certificate_bcc_test_list.txt +16 -11
  26. brg_certificate/certificate_sanity_test_list.txt +10 -4
  27. brg_certificate/certificate_test_list.txt +14 -10
  28. brg_certificate/tests/calibration/interval_test/interval_test.json +2 -2
  29. brg_certificate/tests/calibration/interval_test/interval_test.py +1 -1
  30. brg_certificate/tests/calibration/output_power_test/output_power_test.json +3 -2
  31. brg_certificate/tests/calibration/output_power_test/output_power_test.py +1 -1
  32. brg_certificate/tests/calibration/pattern_test/pattern_test.json +2 -2
  33. brg_certificate/tests/calibration/pattern_test/pattern_test.py +27 -28
  34. brg_certificate/tests/datapath/aging_test/aging_test.json +4 -5
  35. brg_certificate/tests/datapath/aging_test/aging_test.py +40 -33
  36. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -2
  37. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +13 -12
  38. brg_certificate/tests/datapath/output_power_test/output_power_test.json +2 -2
  39. brg_certificate/tests/datapath/output_power_test/output_power_test.py +3 -2
  40. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +3 -3
  41. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +7 -4
  42. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +2 -2
  43. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +7 -4
  44. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +2 -2
  45. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +5 -3
  46. brg_certificate/tests/datapath/pattern_test/pattern_test.json +2 -2
  47. brg_certificate/tests/datapath/pattern_test/pattern_test.py +3 -2
  48. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +3 -3
  49. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
  50. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +2 -2
  51. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +12 -7
  52. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +2 -2
  53. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +12 -8
  54. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +3 -3
  55. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +8 -6
  56. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +2 -2
  57. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
  58. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +3 -3
  59. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +108 -74
  60. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +3 -3
  61. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +129 -119
  62. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +8 -8
  63. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +103 -102
  64. brg_certificate/tests/datapath/stress_test/stress_test.json +14 -15
  65. brg_certificate/tests/datapath/stress_test/stress_test.py +103 -102
  66. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +2 -2
  67. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +8 -3
  68. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +2 -2
  69. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +9 -7
  70. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +2 -2
  71. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +11 -27
  72. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +14 -8
  73. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.py +1 -1
  74. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +13 -8
  75. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +2 -2
  76. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +24 -11
  77. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +2 -2
  78. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +6 -5
  79. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +3 -3
  80. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
  81. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +3 -3
  82. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +3 -2
  83. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +4 -3
  84. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +3 -2
  85. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +3 -3
  86. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +3 -2
  87. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +7 -7
  88. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +270 -295
  89. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +7 -7
  90. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +270 -295
  91. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +12 -6
  92. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
  93. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +4 -4
  94. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +130 -207
  95. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +2 -2
  96. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +3 -2
  97. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +4 -3
  98. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +3 -2
  99. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +13 -7
  100. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +119 -126
  101. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +2 -2
  102. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +3 -2
  103. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
  104. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
  105. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
  106. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
  107. brg_certificate/wlt_types.py +2 -1
  108. gw_certificate/api_if/gw_capabilities.py +37 -1
  109. gw_certificate/common/serialization_formatter.py +80 -0
  110. gw_certificate/common/wltPb_pb2.py +50 -38
  111. gw_certificate/common/wltPb_pb2.pyi +40 -34
  112. gw_certificate/gw_certificate.py +4 -2
  113. gw_certificate/gw_certificate_cli.py +5 -4
  114. gw_certificate/interface/4.4.82_app.zip +0 -0
  115. gw_certificate/interface/{4.4.52_sd_bl_app.zip → 4.4.82_sd_bl_app.zip} +0 -0
  116. gw_certificate/interface/mqtt.py +39 -23
  117. gw_certificate/interface/pkt_generator.py +0 -44
  118. gw_certificate/interface/uart_if.py +20 -9
  119. gw_certificate/tests/actions.py +33 -5
  120. gw_certificate/tests/connection.py +3 -1
  121. gw_certificate/tests/generic.py +1 -1
  122. gw_certificate/tests/registration.py +4 -4
  123. gw_certificate/tests/static/generated_packet_table.py +47 -25
  124. gw_certificate/tests/static/packet_table.csv +10067 -10051
  125. gw_certificate/tests/static/uplink_defines.py +1 -0
  126. gw_certificate/tests/uplink.py +142 -22
  127. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/METADATA +40 -40
  128. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/RECORD +132 -127
  129. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/WHEEL +1 -1
  130. gw_certificate/interface/4.4.52_app.zip +0 -0
  131. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/entry_points.txt +0 -0
  132. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/licenses/LICENSE +0 -0
  133. {wiliot_certificate-1.5.1a1.dist-info → wiliot_certificate-1.5.3a1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "pkt_filter_test",
3
- "module": "datapath",
2
+ "name": "Packet Filter Gen2 Pixels",
3
+ "module": "Datapath",
4
4
  "purpose": "Test packet filter feature configuration and functionality in the bridge for different packet filters",
5
5
  "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Pacing",
6
6
  "initialCondition": "Bridge & data simulator configured to defaults",
@@ -6,22 +6,24 @@ import brg_certificate.cert_config as cert_config
6
6
 
7
7
  PKT_FILTER_TEST_PACER_INTERVAL = 10
8
8
 
9
+
9
10
  def run(test):
10
11
 
11
12
  # We add the field BRG_RX_CHANNEL so internal BRGs will be configured to channel 37 (default is 39)
12
13
  fields = [BRG_PKT_FILTER, BRG_RX_CHANNEL, BRG_PACER_INTERVAL]
13
- datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
14
+ datapath_module = test.active_brg.datapath
14
15
 
15
16
  test = cert_common.test_prolog(test)
16
17
  if test.rc == TEST_FAILED:
17
18
  return cert_common.test_epilog(test)
18
19
 
19
-
20
20
  for param in test.params:
21
- test = cert_config.brg_configure(test, fields=fields, values=[param.value, ag.RX_CHANNEL_37, PKT_FILTER_TEST_PACER_INTERVAL], module=datapath_module)[0]
21
+ test = cert_config.brg_configure(test, fields=fields, values=[param.value, ag.RX_CHANNEL_37, PKT_FILTER_TEST_PACER_INTERVAL],
22
+ module=datapath_module)[0]
22
23
  test.set_phase_rc(param.name, test.rc)
23
24
  test.add_phase_reason(param.name, test.reason)
24
25
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
26
+ test.add_reason(f"Failed to configure BRG with {param.name} filter")
25
27
  break
26
28
  else:
27
29
  test.reset_result()
@@ -32,17 +34,19 @@ def run(test):
32
34
  if test.data == DATA_SIMULATION:
33
35
  # start generating pkts and send them using data simulator
34
36
  num_of_pixels = 5
35
- pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=num_of_pixels, duplicates=2, delay=0, pkt_types=[0,1,2])
37
+ pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=num_of_pixels,
38
+ duplicates=2, delay=0, pkt_types=[0, 1, 2])
36
39
  pixel_sim_thread.start()
37
- df = cert_common.data_scan(test, brg_data=(not test.internal_brg), gw_data=test.internal_brg, scan_time=PKT_FILTER_TEST_PACER_INTERVAL*6, per_pkt_type=True,
38
- pkt_filter_cfg=param.value, flush_pkts=True)
40
+ df = cert_common.data_scan(test, brg_data=(not test.internal_brg), gw_data=test.internal_brg,
41
+ scan_time=PKT_FILTER_TEST_PACER_INTERVAL * 6, per_pkt_type=True,
42
+ pkt_filter_cfg=param.value, flush_pkts=True)
39
43
  if test.data == DATA_SIMULATION:
40
44
  # stop generating pkts with data simulator and wait a few seconds for full flush
41
45
  pixel_sim_thread.stop()
42
46
  time.sleep(5)
43
47
  cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"pkt_filter_{param.name}_", dir=test.dir)
44
- test = cert_common.pacing_analysis(test, pacer_interval=PKT_FILTER_TEST_PACER_INTERVAL, df=df, pkt_filter_cfg=param.value, num_of_pixels=num_of_pixels)
45
- # param epilog
48
+ test = cert_common.pacing_analysis(test, pacer_interval=PKT_FILTER_TEST_PACER_INTERVAL, df=df,
49
+ pkt_filter_cfg=param.value, num_of_pixels=num_of_pixels)
46
50
  generate_log_file(test, param.name)
47
51
  field_functionality_pass_fail_print(test, fields[0], value=param.name)
48
52
  test.set_phase_rc(param.name, test.rc)
@@ -1,8 +1,8 @@
1
1
  {
2
- "name": "rssi_threshold_test",
3
- "module": "datapath",
2
+ "name": "RSSI Threshold",
3
+ "module": "Datapath",
4
4
  "purpose": "Test RSSI threshold configuration and functionality in the bridge",
5
- "documentation": "TODO",
5
+ "documentation": "<TEST_DOCUMENTATION_LINK>",
6
6
  "initialCondition": "Bridge configured to defaults",
7
7
  "procedure": ["Test prolog",
8
8
  "RSSI Threshold configuration",
@@ -4,36 +4,38 @@ 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 rssi_threshold_analysis(test, df, threshold):
8
9
  tags_count = len(list(df[TAG_ID].unique()))
9
10
 
10
11
  # Filter rows where RSSI is higher than threshold
11
- low_rssi_df = df[df[RSSI] >= (-1)*threshold]
12
+ low_rssi_df = df[df[RSSI] >= (-1) * threshold]
12
13
 
13
14
  # Extract all tag IDs from those filtered rows
14
15
  low_rssi_tag_ids = low_rssi_df[TAG_ID].unique()
15
16
  failed_tags = len(low_rssi_tag_ids)
16
17
 
17
18
  if failed_tags:
18
- test.rc =TEST_FAILED
19
- print("Tag IDs with RSSI exceeding", (-1)*threshold, ":", low_rssi_tag_ids)
19
+ test.rc = TEST_FAILED
20
+ print("Tag IDs with RSSI exceeding", (-1) * threshold, ":", low_rssi_tag_ids)
20
21
 
21
22
  if test.rc == TEST_FAILED:
22
- test.add_reason(f"{failed_tags}/{tags_count} tags rssi violating threshold of {(-1)*threshold}")
23
+ test.add_reason(f"{failed_tags}/{tags_count} tags rssi violating threshold of {(-1) * threshold}")
23
24
  print(test.reason)
24
25
  else:
25
26
  test.rc = TEST_PASSED
26
27
  return test
27
28
 
29
+
28
30
  def run(test):
29
31
 
30
32
  fields = [BRG_RSSI_THRESHOLD]
31
- datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
33
+ datapath_module = test.active_brg.datapath
32
34
 
33
35
  test = cert_common.test_prolog(test)
34
36
  if test.rc == TEST_FAILED:
35
37
  return cert_common.test_epilog(test)
36
-
38
+
37
39
  # Configure the BRG with RSSI threshold and check for packets violating the threshold
38
40
  for param in test.params:
39
41
  functionality_run_print(f"test for RSSI threshold of {param.value}")
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "rx_channel_test",
3
- "module": "datapath",
2
+ "name": "Rx Channel",
3
+ "module": "Datapath",
4
4
  "purpose": "Test configuration for all supported datapath rx channel values",
5
5
  "documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Configuration",
6
6
  "initialCondition": "Bridge configured to defaults",
@@ -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 = test.active_brg.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
- datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
193
+ datapath_module = test.active_brg.datapath
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": [