wiliot-certificate 1.5.0a1__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 (124) hide show
  1. brg_certificate/ag/energous_v0_defines.py +17 -17
  2. brg_certificate/ag/energous_v1_defines.py +17 -17
  3. brg_certificate/ag/energous_v2_defines.py +17 -17
  4. brg_certificate/ag/energous_v3_defines.py +17 -17
  5. brg_certificate/ag/energous_v4_defines.py +17 -17
  6. brg_certificate/ag/fanstel_lan_v0_defines.py +17 -17
  7. brg_certificate/ag/fanstel_lte_v0_defines.py +17 -17
  8. brg_certificate/ag/fanstel_wifi_v0_defines.py +17 -17
  9. brg_certificate/ag/minew_lte_v0_defines.py +17 -17
  10. brg_certificate/ag/wlt_cmd_if.html +3 -2
  11. brg_certificate/ag/wlt_types.html +0 -1
  12. brg_certificate/ag/wlt_types_ag.py +151 -152
  13. brg_certificate/brg_certificate.py +38 -7
  14. brg_certificate/brg_certificate_cli.py +19 -3
  15. brg_certificate/cert_common.py +92 -55
  16. brg_certificate/cert_config.py +6 -4
  17. brg_certificate/cert_data_sim.py +47 -7
  18. brg_certificate/cert_defines.py +20 -6
  19. brg_certificate/cert_gw_sim.py +10 -6
  20. brg_certificate/cert_mqtt.py +9 -6
  21. brg_certificate/cert_prints.py +14 -1
  22. brg_certificate/cert_protobuf.py +7 -7
  23. brg_certificate/cert_results.py +131 -84
  24. brg_certificate/cert_utils.py +13 -7
  25. brg_certificate/certificate_bcc_sanity_test_list.txt +40 -0
  26. brg_certificate/certificate_bcc_test_list.txt +50 -0
  27. brg_certificate/certificate_sanity_test_list.txt +12 -5
  28. brg_certificate/certificate_test_list.txt +16 -6
  29. brg_certificate/tests/calibration/interval_test/interval_test.json +4 -3
  30. brg_certificate/tests/calibration/output_power_test/output_power_test.json +8 -5
  31. brg_certificate/tests/calibration/pattern_test/pattern_test.json +7 -4
  32. brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
  33. brg_certificate/tests/datapath/aging_test/aging_test.json +19 -0
  34. brg_certificate/tests/datapath/aging_test/aging_test.py +142 -0
  35. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +10 -5
  36. brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
  37. brg_certificate/tests/datapath/output_power_test/output_power_test.json +7 -4
  38. brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
  39. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +8 -5
  40. brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
  41. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +7 -4
  42. brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
  43. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +7 -4
  44. brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
  45. brg_certificate/tests/datapath/pattern_test/pattern_test.json +8 -5
  46. brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
  47. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +11 -5
  48. brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
  49. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +10 -4
  50. brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
  51. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +10 -4
  52. brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
  53. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +8 -4
  54. brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
  55. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +7 -4
  56. brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
  57. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +4 -5
  58. brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
  59. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +4 -5
  60. brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
  61. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +15 -23
  62. brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +104 -103
  63. brg_certificate/tests/datapath/stress_test/stress_test.json +15 -23
  64. brg_certificate/tests/datapath/stress_test/stress_test.py +104 -110
  65. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +8 -4
  66. brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
  67. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +8 -4
  68. brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
  69. brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +4 -3
  70. brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -38
  71. brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +15 -8
  72. brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +14 -8
  73. brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +11 -7
  74. brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +25 -12
  75. brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +11 -7
  76. brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +48 -3
  77. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +5 -4
  78. brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
  79. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +8 -5
  80. brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
  81. brg_certificate/tests/energy2400/output_power_test/output_power_test.json +9 -6
  82. brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
  83. brg_certificate/tests/energy2400/pattern_test/pattern_test.json +8 -5
  84. brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
  85. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +20 -0
  86. brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +343 -0
  87. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +20 -0
  88. brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +343 -0
  89. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +14 -7
  90. brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
  91. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +14 -7
  92. brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +198 -125
  93. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +7 -4
  94. brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
  95. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -6
  96. brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
  97. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +14 -7
  98. brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
  99. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +7 -4
  100. brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
  101. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
  102. brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
  103. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
  104. brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
  105. brg_certificate/wltPb_pb2.py +15 -15
  106. brg_certificate/wltPb_pb2.pyi +8 -2
  107. brg_certificate/wlt_types.py +2 -1
  108. gw_certificate/cert_results.py +11 -4
  109. gw_certificate/gw_certificate.py +0 -2
  110. gw_certificate/gw_certificate_cli.py +3 -3
  111. gw_certificate/interface/uart_if.py +1 -1
  112. gw_certificate/tests/actions.py +7 -1
  113. gw_certificate/tests/registration.py +2 -1
  114. gw_certificate/tests/uplink.py +26 -35
  115. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +46 -42
  116. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +120 -112
  117. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
  118. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +0 -13
  119. brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +0 -76
  120. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -13
  121. brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +0 -398
  122. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
  123. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info/licenses}/LICENSE +0 -0
  124. {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
@@ -1,30 +1,22 @@
1
1
  {
2
- "name": "stress test",
3
- "module": "DataPath",
4
- "purpose": [
5
- "verify the functionality of the bridge under stress conditions",
6
- "verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly",
7
- "verify an edge case where the repetition stable and we got a lot of packets in short time"
8
- ],
9
- "documentation": [
10
- "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Relaying-data",
11
- "add more links here - about adaptive repetition, adaptive pacer"
12
- ],
2
+ "name": "Stress Test Gen3 Pixels",
3
+ "module": "Datapath",
4
+ "purpose": "verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly under stress conditions with Gen3 pixels",
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"],
13
7
  "initialCondition": "Bridge configured to defaults",
14
- "procedure": [
15
- "Test prolog",
16
- "define simulation with 200 packets with 0 delay(0.02 sec) ",
17
- "rep 3 - config pacer interval 15, then check repetition value = 3, tx_queue = 0-20, pacer increment = 0, brg latency = 0, num of tags = all tags ",
18
- "rep 2 - config pacer interval 9, then check repetition value = 2, tx_queue = 20-40, pacer increment = 0, brg latency = 0-200, num of tags = all tags",
19
- "rep 1 - config pacer interval 6, then check repetition value = 1, tx_queue = 40-60, pacer increment = 0, brg latency = 200-300, num of tags = all tags",
20
- "rep 1 adaptive pacer - config pacer interval 1 , then check repetition value = 1, tx_queue > 60, pacer increment = 3 , brg latency > 300 , num of tags = all tags",
21
- "pixels burst - config pacer interval 15, then add more 200 packets with 0 delay(0.02 sec), then check repetition value = 1 and not 2",
22
- "Test epilog"
23
- ],
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"],
24
16
  "expectedOutcome": "all metrics values will be as expected then the bridge is working correctly and the algorithms are working correctly",
25
17
  "mandatory": 1,
26
18
  "multiBridgeTest": 0,
27
19
  "gwOnlyTest": 0,
28
- "allSupportedValues": ["rep3", "rep2", "rep1", "rep1_adaptive_pacer", "pixels_burst"]
29
-
20
+ "internalBridge": 0,
21
+ "allSupportedValues": ["rep3", "rep2", "rep1", "rep1_adaptive_pacer"]
30
22
  }
@@ -6,187 +6,188 @@ import brg_certificate.cert_config as cert_config
6
6
  import brg_certificate.cert_data_sim as cert_data_sim
7
7
  from brg_certificate.cert_gw_sim import DEDUPLICATION_PKTS
8
8
  import statistics
9
- import datetime
10
- import sys
11
9
  import time
12
10
 
13
- def configure_pacer_n_times(test, num_of_times, pacer_interval, datapath_module):
14
- test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
15
- if test.rc == TEST_FAILED:
16
- for i in range(num_of_times):
17
- if test.rc == TEST_PASSED:
18
- return test
19
- print(f"sleeping for 10 seconds before trying to configure pacer again\n")
20
- time.sleep(10)
21
- test = cert_config.brg_configure(test, fields=[BRG_PACER_INTERVAL], values=[pacer_interval], module=datapath_module)[0]
22
- test.add_reason("Didn't succeed to configure after two attempts - No pkt was found!")
23
- return test
24
11
 
25
- 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):
26
13
  if not mgmt_type_list:
27
- test.add_reason("\nDidn't find HB pkt, therefore will not check tx_queue and pacer increment\n")
28
- print(f"Didn't find HB pkt, therefore will not check tx_queue and pacer increment")
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")
29
16
  else:
30
- #check tx queue
17
+ # check tx queue
31
18
  watermarks = [pkt.tx_queue_watermark for pkt in mgmt_type_list]
32
19
  half_index = len(watermarks) // 2
33
20
  tx_queue_HB = statistics.mean(watermarks[half_index:])
34
21
  if not (tx_queue_expected[0] <= tx_queue_HB <= tx_queue_expected[1]):
35
- test.add_reason(f"tx_queue: {tx_queue_HB}")
36
- print(f"\ntx_queue value is wrong!\nexpected: {tx_queue_expected}, got: {tx_queue_HB}")
22
+ print(f"\ntx_queue: {tx_queue_HB} expected: {tx_queue_expected},")
37
23
  else:
38
- test.add_reason(f"tx_queue: {tx_queue_HB}")
39
- print(f"\ntx_queue from HB : {tx_queue_HB}\n")
40
-
24
+ print(f"\ntx_queue from HB: {tx_queue_HB}\n")
25
+
41
26
  # check pacer increment
42
27
  pacer_increment_HB = [pkt.effective_pacer_increment for pkt in mgmt_type_list]
43
28
  average_pacer_increment_HB = statistics.mean(pacer_increment_HB)
44
29
  if not (pacer_increment_expected[0] <= average_pacer_increment_HB <= pacer_increment_expected[1]):
45
- test.add_reason(f"pacer_increment:{average_pacer_increment_HB}")
46
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}")
47
34
  else:
48
- test.add_reason(f"pacer_increment: {average_pacer_increment_HB}")
49
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}")
50
38
  return test
51
39
 
52
- def metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_pixels_expected):
40
+
41
+ def metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_pixels_expected):
53
42
  if df.empty:
54
- print(f" df is empty, therefore will not check repetitions, brg latency and num of tags")
43
+ print("Df is empty, therefore will not check repetitions, brg latency and num of tags")
55
44
  test.rc = TEST_FAILED
56
- test.add_reason(f"df is empty, therefore will not check repetitions, brg latency and num of tags")
45
+ test.add_reason("Df is empty, therefore skip all checks")
57
46
  else:
58
47
  print(f"result of pacer interval: {pacer_interval}\n")
59
48
  # check repetition value
60
49
  payload_counts_per_tag = df.groupby(TAG_ID)[PAYLOAD].value_counts()
61
50
  average_payload_count = round(payload_counts_per_tag.mean(), 2)
62
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}")
63
53
  if check:
64
54
  test.rc = TEST_FAILED
65
- test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected},")
66
- print(f"Repetition value is wrong! \nexpected:{repetition_value_expected}\ngot: {average_payload_count}")
67
- else:
68
- test.add_reason(f"Repetition:{average_payload_count}, expected: {repetition_value_expected},")
69
- 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}")
70
56
  else:
71
- test.add_reason(f"Repetition value: {average_payload_count}")
72
57
  print(f"Repetition value is correct! got: {average_payload_count}")
73
-
58
+ if check:
59
+ test.add_reason(f"Repetition value: {average_payload_count}")
60
+
74
61
  # check num of tags, with tolerance of 5%
75
- num_of_tags = len(df[TAG_ID].unique())
76
- if not num_of_pixels_expected*0.95 <= num_of_tags <= num_of_pixels_expected*1.05:
77
- test.add_reason(f"num of tags: {num_of_tags}")
78
- print(f"\n num of tags is not as expected\nexpected: {num_of_pixels_expected}, got: {num_of_tags}")
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}")
79
67
  else:
80
- test.add_reason(f"num of tags: {num_of_tags}")
81
68
  print(f"\nnum of tags from df: {num_of_tags}\n")
82
-
83
- #check brg_latency
84
- if check:
85
- brg_latency_avg = round(df[BRG_LATENCY].mean(),2)
86
- if not (brg_latency_expected[0] <= brg_latency_avg <= brg_latency_expected[1]):
87
- test.add_reason(f"brg_latency:{brg_latency_avg}")
88
- print(f"Average brg_latency: {brg_latency_avg}")
89
- else:
90
- test.add_reason(f"brg_latency: {brg_latency_avg}")
91
- 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}")
92
74
  else:
93
- brg_latency_avg = round(df[BRG_LATENCY].mean(),2)
94
75
  print(f"Average brg_latency: {brg_latency_avg}")
95
- 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
96
101
 
97
- def combination_func(test, datapath_module, pacer_interval, num_of_sim_tags, repetition_value_expected, tx_queue_expected, pacer_increment_expected, brg_latency_expected):
98
- test = configure_pacer_n_times(test, 2, pacer_interval, datapath_module)
99
102
  time.sleep(30)
100
- # first df
103
+ # first df
101
104
  df = cert_common.data_scan(test, scan_time=30, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
102
105
  cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
103
106
  test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
104
- hbs = [p[MGMT_PKT].pkt for p in hbs]
105
- print(f"result of first df\n")
107
+ hbs = [p[MGMT_PKT].pkt for p in hbs]
108
+ print("result of first df\n")
106
109
  check = False
110
+ test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
107
111
  test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
108
112
  time.sleep(30)
109
- # second df
113
+ # second df
110
114
  df = cert_common.data_scan(test, scan_time=60, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
111
115
  cert_common.display_data(df, nfpkt=True, tbc=True, name_prefix=f"stress_{pacer_interval}_", dir=test.dir)
112
116
  test, hbs = cert_common.scan_for_mgmt_pkts(test, [eval_pkt(f'Brg2GwHbV{test.active_brg.api_version}')])
113
- hbs = [p[MGMT_PKT].pkt for p in hbs]
114
- print(f"result of second df\n")
117
+ hbs = [p[MGMT_PKT].pkt for p in hbs]
118
+ print("result of second df\n")
115
119
  check = True
120
+ test = metric_checking_HB(test, check, hbs, tx_queue_expected, pacer_increment_expected)
116
121
  test = metric_checking_df(test, check, pacer_interval, df, repetition_value_expected, brg_latency_expected, num_of_sim_tags)
117
- test = metric_checking_HB(test, hbs, tx_queue_expected, pacer_increment_expected)
118
122
  return test
119
123
 
120
- def rep3(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
121
- pacer_interval = 20
122
- test = combination_func(test, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags, repetition_value_expected=[2,3], tx_queue_expected=[20,40], pacer_increment_expected=[0,2], brg_latency_expected=[0,10])
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])
123
131
  time.sleep(5)
124
132
  return test
125
133
 
126
- def rep2(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
127
- pacer_interval = 15
128
- test = combination_func(test, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags, repetition_value_expected=[1.5,2.5], tx_queue_expected=[20,40], pacer_increment_expected=[0,2], brg_latency_expected=[10,200])
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])
129
141
  time.sleep(5)
130
142
  return test
131
143
 
132
- def rep1(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
133
- pacer_interval = 9
134
- test = combination_func(test, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags, repetition_value_expected=[1,2], tx_queue_expected=[20,40], pacer_increment_expected=[0,2], brg_latency_expected=[200,300])
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])
135
151
  time.sleep(5)
136
152
  return test
137
153
 
138
- def rep1_adaptive_pacer(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
139
- pacer_interval = 1
140
- test = combination_func(test, datapath_module, pacer_interval=pacer_interval, num_of_sim_tags=num_of_sim_tags, repetition_value_expected=[1,2], tx_queue_expected=[20,40], pacer_increment_expected=[2,20], brg_latency_expected=[300,1000])
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])
141
162
  time.sleep(5)
142
163
  return test
143
164
 
144
- def pixels_burst(test, datapath_module, num_of_sim_tags, pixel_sim_thread):
145
- #NOTE: I had to change the pattern because there isn't option to increase the the pixels number in the same thread it will cause error "index out of bound"
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 ,"rep1": rep1, "rep1_adaptive_pacer":rep1_adaptive_pacer, "pixels_burst":pixels_burst}
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, num_of_pixels=num_of_pixels, duplicates=1, delay=0, pkt_types=[0],pixels_type=GEN3)
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, pixel_sim_thread)
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, revert_gws=True, modules=[datapath_module])
204
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[datapath_module])
@@ -1,30 +1,22 @@
1
1
  {
2
- "name": "stress test",
3
- "module": "DataPath",
4
- "purpose": [
5
- "verify the functionality of the bridge under stress conditions",
6
- "verify that the algorithms 'adaptive repetition' and 'adaptive pacer' are working correctly",
7
- "verify an edge case where the repetition stable and we got a lot of packets in short time"
8
- ],
9
- "documentation": [
10
- "https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Relaying-data",
11
- "add more links here - about adaptive repetition, adaptive pacer"
12
- ],
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"],
13
7
  "initialCondition": "Bridge configured to defaults",
14
- "procedure": [
15
- "Test prolog",
16
- "define simulation with 200 packets with 0 delay(0.02 sec) ",
17
- "rep 3 - config pacer interval 15, then check repetition value = 3, tx_queue = 0-20, pacer increment = 0, brg latency = 0, num of tags = all tags ",
18
- "rep 2 - config pacer interval 9, then check repetition value = 2, tx_queue = 20-40, pacer increment = 0, brg latency = 0-200, num of tags = all tags",
19
- "rep 1 - config pacer interval 6, then check repetition value = 1, tx_queue = 40-60, pacer increment = 0, brg latency = 200-300, num of tags = all tags",
20
- "rep 1 adaptive pacer - config pacer interval 1 , then check repetition value = 1, tx_queue > 60, pacer increment = 3 , brg latency > 300 , num of tags = all tags",
21
- "pixels burst - config pacer interval 15, then add more 200 packets with 0 delay(0.02 sec), then check repetition value = 1 and not 2",
22
- "Test epilog"
23
- ],
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"],
24
16
  "expectedOutcome": "all metrics values will be as expected then the bridge is working correctly and the algorithms are working correctly",
25
17
  "mandatory": 1,
26
18
  "multiBridgeTest": 0,
27
19
  "gwOnlyTest": 0,
28
- "allSupportedValues": ["rep3", "rep2", "rep1", "rep1_adaptive_pacer", "pixels_burst"]
29
-
20
+ "internalBridge": 0,
21
+ "allSupportedValues": ["rep3", "rep2", "rep1", "rep1_adaptive_pacer"]
30
22
  }