wiliot-certificate 4.5.0__py3-none-any.whl → 4.5.0a2__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 (125) hide show
  1. certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +211 -0
  2. certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +894 -0
  3. certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +184 -0
  4. certificate/ag/wlt_types_ag_jsons/calibration.json +490 -0
  5. certificate/ag/wlt_types_ag_jsons/custom.json +614 -0
  6. certificate/ag/wlt_types_ag_jsons/datapath.json +900 -0
  7. certificate/ag/wlt_types_ag_jsons/energy2400.json +670 -0
  8. certificate/ag/wlt_types_ag_jsons/energySub1g.json +691 -0
  9. certificate/ag/wlt_types_ag_jsons/externalSensor.json +727 -0
  10. certificate/ag/wlt_types_ag_jsons/interface.json +1095 -0
  11. certificate/ag/wlt_types_ag_jsons/powerManagement.json +1439 -0
  12. certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
  13. certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
  14. certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +126 -0
  15. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
  16. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
  17. certificate/cert_common.py +35 -65
  18. certificate/cert_config.py +18 -43
  19. certificate/cert_data_sim.py +9 -12
  20. certificate/cert_defines.py +0 -8
  21. certificate/cert_gw_sim.py +7 -32
  22. certificate/cert_mqtt.py +5 -15
  23. certificate/cert_prints.py +0 -1
  24. certificate/cert_results.py +37 -48
  25. certificate/cert_utils.py +15 -24
  26. certificate/certificate.py +5 -12
  27. certificate/certificate_cli.py +13 -10
  28. certificate/certificate_eth_test_list.txt +3 -4
  29. certificate/certificate_sanity_test_list.txt +2 -3
  30. certificate/certificate_test_list.txt +4 -4
  31. certificate/tests/calibration/interval_test/interval_test.json +0 -1
  32. certificate/tests/calibration/output_power_test/output_power_test.json +0 -1
  33. certificate/tests/calibration/pattern_test/pattern_test.json +0 -1
  34. certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +0 -1
  35. certificate/tests/cloud_connectivity/acl_test/acl_test.json +0 -1
  36. certificate/tests/cloud_connectivity/acl_test/acl_test.py +15 -13
  37. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +1 -2
  38. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +6 -8
  39. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +0 -1
  40. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +3 -3
  41. certificate/tests/cloud_connectivity/connection_test/connection_test.json +0 -1
  42. certificate/tests/cloud_connectivity/connection_test/connection_test.py +13 -6
  43. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +0 -1
  44. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +11 -6
  45. certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +0 -1
  46. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +4 -1
  47. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +0 -1
  48. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +9 -14
  49. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +0 -1
  50. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +0 -2
  51. certificate/tests/cloud_connectivity/registration_test/registration_test.json +0 -1
  52. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +1 -1
  53. certificate/tests/cloud_connectivity/stress_test/stress_test.json +0 -1
  54. certificate/tests/cloud_connectivity/stress_test/stress_test.py +11 -15
  55. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +0 -1
  56. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +2 -1
  57. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +0 -1
  58. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +20 -27
  59. certificate/tests/datapath/aging_test/aging_test.json +0 -1
  60. certificate/tests/datapath/aging_test/aging_test.py +3 -7
  61. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +2 -3
  62. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +13 -7
  63. certificate/tests/datapath/event_test/event_test.json +2 -3
  64. certificate/tests/datapath/event_test/event_test.py +10 -5
  65. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -2
  66. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +5 -9
  67. certificate/tests/datapath/output_power_test/output_power_test.json +0 -1
  68. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +0 -1
  69. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
  70. certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +0 -1
  71. certificate/tests/datapath/pattern_test/pattern_test.json +0 -1
  72. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +0 -1
  73. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +5 -5
  74. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +0 -1
  75. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +5 -5
  76. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +0 -1
  77. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +8 -10
  78. certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +0 -1
  79. certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +0 -1
  80. certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +0 -1
  81. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +0 -1
  82. certificate/tests/datapath/rx_channel_test/rx_channel_test.json +0 -1
  83. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +0 -1
  84. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  85. certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +0 -1
  86. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +0 -1
  87. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +0 -3
  88. certificate/tests/datapath/stress_test/stress_test.json +0 -1
  89. certificate/tests/datapath/stress_test/stress_test.py +0 -3
  90. certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +0 -1
  91. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +0 -1
  92. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +0 -1
  93. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +0 -1
  94. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +0 -1
  95. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +0 -1
  96. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +0 -1
  97. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +0 -1
  98. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +0 -1
  99. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +14 -18
  100. certificate/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +0 -1
  101. certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +0 -1
  102. certificate/tests/energy2400/output_power_test/output_power_test.json +0 -1
  103. certificate/tests/energy2400/pattern_test/pattern_test.json +0 -1
  104. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -1
  105. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +3 -4
  106. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +9 -9
  107. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +271 -113
  108. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -1
  109. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +1 -1
  110. certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +0 -1
  111. certificate/tests/energy_sub1g/pattern_test/pattern_test.json +0 -1
  112. certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +0 -1
  113. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +0 -1
  114. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +9 -4
  115. common/api_if/api_validation.py +0 -6
  116. common/web/templates/generator.html +79 -141
  117. common/web/web_utils.py +56 -78
  118. gui_certificate/server.py +78 -283
  119. gui_certificate/templates/cert_run.html +113 -179
  120. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/METADATA +22 -7
  121. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/RECORD +125 -109
  122. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/WHEEL +0 -0
  123. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/entry_points.txt +0 -0
  124. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/licenses/LICENSE +0 -0
  125. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a2.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,7 @@ from certificate.cert_defines import *
3
3
  from certificate.wlt_types import *
4
4
  from certificate.ag.wlt_types_ag import OUTPUT_POWER_2_4_MAX
5
5
  import certificate.cert_common as cert_common
6
+ import certificate.cert_utils as cert_utils
6
7
  import certificate.cert_mqtt as cert_mqtt
7
8
  import certificate.cert_config as cert_config
8
9
  import certificate.cert_gw_sim as cert_gw_sim
@@ -17,7 +18,7 @@ from collections import defaultdict
17
18
  # DEFINES
18
19
  CHANNELS = [37, 38, 39] # channel to check in DUT
19
20
  DEFAULT_WAIT_TIME = 5 # How much extra time to wait after the transmition is over
20
- SCAN_TEST_INDICATOR = get_random_hex_str(6) # Unique identifier for the pkt sent
21
+ SCAN_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6) # Unique identifier for the pkt sent
21
22
  ADV_DURATION = 20 # How long to transmit to the DUT
22
23
  # cmd_ble_sm defines
23
24
  BLE_SIM_RADIO_1MBPS = 1
@@ -83,7 +84,6 @@ def analyze_listening_timeline(test, all_pkts_received_from_tester, num_of_sent_
83
84
  channel_cards = []
84
85
 
85
86
  # Parse data into {ts, channel pairs} - X and Y axis
86
- all_pkts_received_from_tester = sorted(all_pkts_received_from_tester, key=lambda pkt: float(pkt.get(TIMESTAMP)))
87
87
  for idx, pkt in enumerate(all_pkts_received_from_tester):
88
88
  payload = pkt.get(PAYLOAD)
89
89
  channel = int(payload[-10:-8], 16)
@@ -188,7 +188,7 @@ def run(test):
188
188
  payload = cert_common.generate_adv_payload(SCAN_TEST_INDICATOR, unique_pkt=True)
189
189
 
190
190
  # Transmitting packets on all channels
191
- utPrint(f"Transmitting in parallel on all 3 main channels for {ADV_DURATION} seconds", "WARNING")
191
+ utPrint(f"Transmitting in parallel on all 3 main cahnnels for {ADV_DURATION} seconds", "WARNING")
192
192
  num_of_sent_pkts = ADV_DURATION * PPS
193
193
  strat_trans_time_ms = time.time() * 1000
194
194
 
@@ -12,7 +12,6 @@
12
12
  "mandatory": 1,
13
13
  "multiBridgeTest": 0,
14
14
  "gwOnlyTest": 1,
15
- "SupportedFromApiVersion": 203,
16
15
  "allSupportedValues": []
17
16
 
18
17
  }
@@ -25,10 +25,19 @@ def run(test):
25
25
  if not cert_common.pipeline_running():
26
26
  warning_prefix = COLORS["WARNING"]
27
27
  warning_suffix = COLORS["ENDC"]
28
+ input(
29
+ (
30
+ f"{warning_prefix}The GW is expected to publish a configuration "
31
+ "JSON/Protobuf message through the status topic upon connecting "
32
+ "to mqtt:\nPlease unplug GW from power. Press enter when unplugged"
33
+ f"{warning_suffix}"
34
+ )
35
+ )
28
36
  dut_mqttc.flush_pkts()
29
- input((f'{warning_prefix}TESTING CONNECTION RECOVERY AFTER POWER CYCLE OF THE GATEWAY\n'
30
- "Please unplug and then plug GW back into power. Press enter when finished"
31
- f"{warning_suffix}"))
37
+ input(
38
+ f"{warning_prefix}Please plug GW back to power. "
39
+ f"Press enter when plugged{warning_suffix}"
40
+ )
32
41
  else:
33
42
  # If this test runs as part of a pipeline, act like the reboot test and don't demand a manual disconnect & connect
34
43
  utPrint(f"Publishing reboot action to {dut_mqttc.update_topic}. Awaiting reconnect.. (timeout is {TIMEOUT_IN_MINUTES} minutes)")
@@ -41,14 +50,12 @@ def run(test):
41
50
  timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
42
51
  while datetime.datetime.now() < timeout:
43
52
  gw_type, msg = cert_common.get_gw_type(dut_mqttc)
44
- gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
45
53
  if gw_type is not None:
46
54
  break
47
55
  print_update_wait(5)
48
- test.dut.gw_api_version = gw_api_version
49
56
 
50
57
  # generate logs
51
- cert_mqtt.generate_log_file(test, "connection")
58
+ cert_mqtt.generate_log_file(test, "reboot")
52
59
 
53
60
  # Analyze results
54
61
  if gw_type is None:
@@ -10,6 +10,5 @@
10
10
  "multiBridgeTest": 0,
11
11
  "gwOnlyTest": 1,
12
12
  "dataSimOnlyTest": 1,
13
- "SupportedFromApiVersion": 203,
14
13
  "allSupportedValues": []
15
14
  }
@@ -3,26 +3,31 @@ from certificate.cert_prints import *
3
3
  from certificate.cert_defines import *
4
4
  from certificate.wlt_types import *
5
5
  import certificate.cert_common as cert_common
6
+ import certificate.cert_utils as cert_utils
6
7
  import certificate.cert_mqtt as cert_mqtt
7
8
  import certificate.cert_data_sim as cert_data_sim
8
9
  import pandas as pd
9
10
 
10
11
 
11
12
  # DEFINES
12
- UPLINK_TEST_INDICATOR = get_random_hex_str(6)
13
+ UPLINK_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
13
14
  NUM_OF_BRGS = 3
14
15
 
15
16
 
16
17
  # HELPER FUNCTIONS
17
- def duplication_analysis(test, sent_pkts, received_pkts):
18
+ def duplication_analysis(test, pkts, received_pkts):
18
19
  if len(received_pkts) == 0:
19
20
  test.rc = TEST_FAILED
20
21
  test.reason = "No packets were received!"
21
22
  return test
22
23
 
23
- _sent_pkts = [p.get_pkt()[12:] for p in sent_pkts]
24
+ _sent_pkts = []
25
+ for pkt in pkts:
26
+ pkt_str = pkt.get_pkt()
27
+ adva_endianness_change = cert_common.change_endianness(pkt_str[:12]) + pkt_str[12:] # Switch to big endian adva
28
+ _sent_pkts.append(adva_endianness_change)
29
+
24
30
  sent_df = pd.DataFrame(_sent_pkts, columns=[PACKETS])
25
- received_pkts = [p[PAYLOAD] for p in received_pkts]
26
31
  received_df = pd.DataFrame(received_pkts, columns=[PACKETS])
27
32
 
28
33
  merged_df = pd.merge(sent_df, received_df, on=PACKETS, how='inner')
@@ -70,11 +75,11 @@ def run(test):
70
75
  pixel_sim_thread = cert_data_sim.GenericSimThread(test=test, pkts=pkts, send_single_cycle=True)
71
76
  pixel_sim_thread.start()
72
77
 
73
- mqtt_scan_wait(test, 12 + test.dut.upload_wait_time)
78
+ mqtt_scan_wait(test, 10 + test.dut.upload_wait_time)
74
79
  cert_mqtt.dump_pkts(test, log="deduplication_test")
75
80
  recieved_pkts = cert_mqtt.get_all_data_pkts(dut_mqttc, indicator=UPLINK_TEST_INDICATOR)
76
81
  pixel_sim_thread.stop()
77
82
 
78
- test = duplication_analysis(test, pkts, recieved_pkts)
83
+ test = duplication_analysis(test, pkts, [p[ALIAS_BRIDGE_ID] + p[PAYLOAD] for p in recieved_pkts])
79
84
 
80
85
  return cert_common.test_epilog(test)
@@ -15,7 +15,6 @@
15
15
  "multiBridgeTest": 0,
16
16
  "gwOnlyTest": 1,
17
17
  "dataSimOnlyTest": 0,
18
- "SupportedFromApiVersion": 203,
19
18
  "allSupportedValues": []
20
19
 
21
20
  }
@@ -121,7 +121,10 @@ def report_and_results(test, sniffed_pkts):
121
121
  test.reason = 'No packets collected.'
122
122
  return
123
123
 
124
- x_value = ('tx_max_duration', 'TX Max Duration')
124
+ if test.active_brg.board_type == ag.BOARD_TYPE_FANSTEL_WIFI_V0:
125
+ x_value = ('tx_max_retries', 'TX Max Retries')
126
+ else:
127
+ x_value = ('tx_max_duration', 'TX Max Duration')
125
128
 
126
129
  # Create scatter with OLS trendline per channel
127
130
  fig = px.scatter(
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 1,
14
14
  "dataSimOnlyTest": 1,
15
- "SupportedFromApiVersion": 206,
16
15
  "allSupportedValues": []
17
16
  }
@@ -12,7 +12,7 @@ import math
12
12
 
13
13
 
14
14
  # DEFINES
15
- STRESS_TEST_INDICATOR = get_random_hex_str(6)
15
+ STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
16
16
 
17
17
  DUPLICATES = 1
18
18
  ADVA_ASCII_LEN = 12
@@ -76,18 +76,16 @@ def run(test):
76
76
 
77
77
  cert_mqtt.dump_pkts(test, log=str(pps))
78
78
  phase_pkts_received = cert_mqtt.get_all_aggregated_data_pkts(test.get_mqttc_by_target(DUT), indicator=STRESS_TEST_INDICATOR)
79
- valid, reason = cert_common.validate_received_packets(phase_pkts_received)
80
- test.add_phase(cert_utils.Phase(pps))
81
- if valid is False:
82
- test.set_phase_rc(str(pps), TEST_FAILED)
83
- test.add_phase_reason(str(pps), reason)
84
- utPrint(f"Phase {pps} failed validation: {reason}", "RED")
85
- continue
86
- phase_pkts_received = [p[AGGREGATED_PAYLOAD] for p in phase_pkts_received]
87
- test, received_pps = cert_common.stress_analysis(test, pps, generated_payloads, phase_pkts_received)
79
+
80
+ test, received_pps = cert_common.stress_analysis(
81
+ test, pps, generated_payloads,
82
+ [(p[ALIAS_BRIDGE_ID] + p[AGGREGATED_PAYLOAD]) for p in phase_pkts_received])
88
83
  results.extend([pps, received_pps])
89
84
  cert_mqtt.generate_log_file(test, str(pps))
90
85
 
86
+ test.add_phase(cert_utils.Phase(pps))
87
+ test.set_phase_rc(str(pps), test.rc)
88
+ test.add_phase_reason(str(pps), test.reason)
91
89
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
92
90
  break # break the whole for loop and keep the test as failed
93
91
  test.reset_result() # reset result and continue to next param
@@ -96,9 +94,6 @@ def run(test):
96
94
  cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
97
95
 
98
96
  # Generate stress test graphs
99
- if len(data_pkts_received) > 0:
100
- cert_common.generate_graph_stress_test(test, results, data_pkts_received)
101
- else:
102
- utPrint("No data packets received - skipping graph generation", "RED")
97
+ cert_common.generate_graph_stress_test(test, results, data_pkts_received)
103
98
 
104
99
  return cert_common.test_epilog(test)
@@ -12,7 +12,6 @@
12
12
  "mandatory": 0,
13
13
  "multiBridgeTest": 0,
14
14
  "gwOnlyTest": 1,
15
- "SupportedFromApiVersion": 203,
16
15
  "allSupportedValues": []
17
16
 
18
17
  }
@@ -33,11 +33,9 @@ def run(test):
33
33
  timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
34
34
  while datetime.datetime.now() < timeout:
35
35
  gw_type, msg = cert_common.get_gw_type(dut_mqttc)
36
- gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
37
36
  if gw_type is not None:
38
37
  break
39
38
  print_update_wait(5)
40
- test.dut.gw_api_version = gw_api_version
41
39
 
42
40
  # generate logs
43
41
  cert_mqtt.generate_log_file(test, "reboot")
@@ -15,6 +15,5 @@
15
15
  "multiBridgeTest": 0,
16
16
  "gwOnlyTest": 1,
17
17
  "internalBridge": 0,
18
- "SupportedFromApiVersion": 203,
19
18
  "allSupportedValues": ["registry", "online", "refresh"]
20
19
  }
@@ -77,7 +77,7 @@ def main():
77
77
  cert_common.wait_time_n_print(2)
78
78
 
79
79
  # Print results
80
- cert_results.generate_results_files(html=True, pdf=True, failures=failures,
80
+ cert_results.generate_results_files(test.dut, test.tester, html=True, pdf=True, failures=failures,
81
81
  skipped=skipped, start_time=start_time, tests=tests)
82
82
  if not pipeline_running():
83
83
  webbrowser.open('file://' + os.path.realpath(os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_PDF)))
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 1,
14
14
  "dataSimOnlyTest": 1,
15
- "SupportedFromApiVersion": 203,
16
15
  "allSupportedValues": []
17
16
  }
@@ -12,7 +12,7 @@ import math
12
12
 
13
13
 
14
14
  # DEFINES
15
- STRESS_TEST_INDICATOR = get_random_hex_str(6)
15
+ STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
16
16
 
17
17
  DUPLICATES = 1
18
18
  ADVA_ASCII_LEN = 12
@@ -50,7 +50,7 @@ def run(test):
50
50
  return cert_common.test_epilog(test)
51
51
 
52
52
  cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER)
53
- ppses = [20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 222, 250, 285, 333, 500]
53
+ ppses = [20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 222, 250, 285, 333]
54
54
  test_pkts_received = []
55
55
  data_pkts_received = []
56
56
  results = []
@@ -74,18 +74,16 @@ def run(test):
74
74
 
75
75
  cert_mqtt.dump_pkts(test, log=str(pps))
76
76
  phase_pkts_received = cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(DUT), indicator=STRESS_TEST_INDICATOR)
77
- test.add_phase(cert_utils.Phase(pps))
78
- valid, reason = cert_common.validate_received_packets(phase_pkts_received)
79
- if valid is False:
80
- test.set_phase_rc(str(pps), TEST_FAILED)
81
- test.add_phase_reason(str(pps), reason)
82
- utPrint(f"Phase {pps} failed validation: {reason}", "RED")
83
- continue
84
- phase_pkts_received = [p[PAYLOAD] for p in phase_pkts_received]
85
- test, received_pps = cert_common.stress_analysis(test, pps, generated_payloads, phase_pkts_received)
77
+
78
+ test, received_pps = cert_common.stress_analysis(
79
+ test, pps, generated_payloads,
80
+ [(p[ALIAS_BRIDGE_ID] + p[PAYLOAD]) for p in phase_pkts_received])
86
81
  results.extend([pps, received_pps])
87
82
  cert_mqtt.generate_log_file(test, str(pps))
88
83
 
84
+ test.add_phase(cert_utils.Phase(pps))
85
+ test.set_phase_rc(str(pps), test.rc)
86
+ test.add_phase_reason(str(pps), test.reason)
89
87
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
90
88
  break # break the whole for loop and keep the test as failed
91
89
  test.reset_result() # reset result and continue to next param
@@ -93,9 +91,7 @@ def run(test):
93
91
  test_pkts_received.extend(test.get_mqttc_by_target(DUT)._userdata[PKTS].data)
94
92
  cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
95
93
 
96
- if len(data_pkts_received) > 0:
97
- cert_common.generate_graph_stress_test(test, results, data_pkts_received)
98
- else:
99
- utPrint("No data packets received - skipping graph generation", "RED")
94
+ # Generate stress test graphs
95
+ cert_common.generate_graph_stress_test(test, results, data_pkts_received)
100
96
 
101
97
  return cert_common.test_epilog(test)
@@ -20,6 +20,5 @@
20
20
  "multiBridgeTest": 0,
21
21
  "gwOnlyTest": 1,
22
22
  "dataSimOnlyTest": 1,
23
- "SupportedFromApiVersion": 206,
24
23
  "allSupportedValues": []
25
24
  }
@@ -4,13 +4,14 @@ from certificate.cert_prints import *
4
4
  from certificate.cert_defines import *
5
5
  from certificate.wlt_types import *
6
6
  import certificate.cert_common as cert_common
7
+ import certificate.cert_utils as cert_utils
7
8
  import certificate.cert_mqtt as cert_mqtt
8
9
  import certificate.cert_config as cert_config
9
10
  import certificate.cert_data_sim as cert_data_sim
10
11
  from certificate.cert_gw_sim import GW_CERT_TESTER
11
12
 
12
13
  # DEFINES
13
- EXT_ADV_TEST_INDICATOR = get_random_hex_str(6)
14
+ EXT_ADV_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
14
15
  EXPECTED_REPEAT_COUNT = 7
15
16
 
16
17
 
@@ -15,6 +15,5 @@
15
15
  "multiBridgeTest": 0,
16
16
  "gwOnlyTest": 1,
17
17
  "dataSimOnlyTest": 1,
18
- "SupportedFromApiVersion": 203,
19
18
  "allSupportedValues": ["mgmt_pkt", "pixels_pkt", "sensor_pkt", "geolocation"]
20
19
  }
@@ -4,6 +4,7 @@ from certificate.cert_defines import *
4
4
  from certificate.wlt_types import *
5
5
  from common.api_if.api_validation import api_validation
6
6
  import certificate.cert_common as cert_common
7
+ import certificate.cert_utils as cert_utils
7
8
  import certificate.cert_mqtt as cert_mqtt
8
9
  import certificate.cert_data_sim as cert_data_sim
9
10
  import pandas as pd
@@ -12,28 +13,24 @@ import pandas as pd
12
13
  # DEFINES
13
14
 
14
15
  API_VALIDATION = "API Validation"
15
- UPLINK_TEST_INDICATOR = get_random_hex_str(6)
16
+ UPLINK_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
16
17
  NUM_OF_BRGS = 3
17
18
 
18
19
 
19
20
  # HELPER FUNCTIONS
20
- def uplink_analysis(test, sent_pkts, received_pkts, pkt_type):
21
+ def uplink_analysis(test, pkts, received_pkts, pkt_type):
21
22
  if len(received_pkts) == 0:
22
23
  test.set_phase_rc(pkt_type, TEST_FAILED)
23
24
  test.add_phase_reason(pkt_type, "No packets were received!")
24
- return test
25
+ return test, 0
25
26
 
26
- # Verify packets were received from NUM_OF_BRGS bridges
27
- received_brgs = set([p[ALIAS_BRIDGE_ID] for p in received_pkts])
28
- if len(received_brgs) != NUM_OF_BRGS:
29
- test.set_phase_rc(pkt_type, TEST_FAILED)
30
- test.add_phase_reason(pkt_type, f"Received packets from {len(received_brgs)} bridges instead of {NUM_OF_BRGS} bridges!")
31
- utPrint(f"Received packets from {received_brgs} bridges instead of {NUM_OF_BRGS} bridges!", "RED")
32
- return test
27
+ _sent_pkts = []
28
+ for pkt in pkts:
29
+ pkt_str = pkt.get_pkt()
30
+ adva_endianness_change = cert_common.change_endianness(pkt_str[:12]) + pkt_str[12:] # Switch to big endian adva
31
+ _sent_pkts.append(adva_endianness_change)
33
32
 
34
- _sent_pkts = [p.get_pkt()[12:] for p in sent_pkts]
35
33
  sent_df = pd.DataFrame(_sent_pkts, columns=[PACKETS])
36
- received_pkts = [p[PAYLOAD] for p in received_pkts]
37
34
  received_df = pd.DataFrame(received_pkts, columns=[PACKETS])
38
35
 
39
36
  merged_df = pd.merge(sent_df, received_df, on=PACKETS, how='inner')
@@ -50,17 +47,16 @@ def uplink_analysis(test, sent_pkts, received_pkts, pkt_type):
50
47
  if pkts_sent_count == 0:
51
48
  test.set_phase_rc(pkt_type, TEST_FAILED)
52
49
  test.add_phase_reason(pkt_type, "No packets were sent!")
53
- return test
50
+ return test, 0
54
51
 
55
52
  percentage_received = round(pkts_received_count * 100 / pkts_sent_count)
56
53
 
57
54
  # PASS/FAIL logic
58
55
  if percentage_received < 80:
59
- test.set_phase_rc(pkt_type, TEST_FAILED)
60
- test.add_phase_reason(pkt_type, f'{percentage_received}% of {pkt_type} packets received')
56
+ test.rc = TEST_FAILED
57
+ test.reason = f"Insufficient amount of {pkt_type} packets were scanned & uploaded by the gateway"
61
58
  else:
62
- test.set_phase_rc(pkt_type, TEST_PASSED)
63
- test.add_phase_reason(pkt_type, f'{percentage_received}% of {pkt_type} packets received')
59
+ test.reason = f'{percentage_received}% of {pkt_type} packets received'
64
60
 
65
61
  return test
66
62
 
@@ -138,25 +134,22 @@ def run(test):
138
134
  all_data_messages_in_test.extend(dut_mqttc._userdata[PKTS].data)
139
135
  all_data_pkts.extend(cert_mqtt.get_all_data_pkts(dut_mqttc))
140
136
  recieved_pkts = cert_mqtt.get_all_data_pkts(dut_mqttc, indicator=UPLINK_TEST_INDICATOR)
141
- valid, reason = cert_common.validate_received_packets(recieved_pkts)
142
- if valid is False:
143
- test.set_phase_rc(param.name, TEST_FAILED)
144
- test.add_phase_reason(param.name, reason)
145
- utPrint(f"Phase {param.name} failed validation: {reason}", "RED")
146
- continue
147
137
 
148
- test = uplink_analysis(test, pkts, recieved_pkts, param.name)
138
+ test = uplink_analysis(test, pkts, [p[ALIAS_BRIDGE_ID] + p[PAYLOAD] for p in recieved_pkts], param.name)
149
139
 
150
140
  cert_mqtt.generate_log_file(test, param.name)
151
- field_functionality_pass_fail_print(test.get_phase_by_name(param.name), 'pkt_type', value=param.name)
152
- if test.get_phase_by_name(param.name).rc == TEST_FAILED:
141
+ field_functionality_pass_fail_print(test, 'pkt_type', value=param.name)
142
+ test.set_phase_rc(param.name, test.rc)
143
+ test.add_phase_reason(param.name, test.reason)
144
+ if test.rc == TEST_FAILED:
153
145
  if test.exit_on_param_failure:
154
146
  break # break the whole for loop and keep the test as failed
155
147
  test.reset_result() # reset result and continue to next param
156
148
 
157
149
  # Other Validations
158
150
  # Api Validation
159
- test = api_validation(test)
151
+ if not test.dut.protobuf:
152
+ test = api_validation(test)
160
153
  test = cert_common.wiliot_pkts_validation(test, all_data_messages_in_test, all_data_pkts)
161
154
 
162
155
  # Geolocation phase
@@ -14,7 +14,6 @@
14
14
  "multiBridgeTest": 0,
15
15
  "gwOnlyTest": 0,
16
16
  "dataSimOnlyTest": 1,
17
- "SupportedFromApiVersion": 12,
18
17
  "allSupportedValues": ["low_pacer", "high_pacer"]
19
18
 
20
19
  }
@@ -105,15 +105,11 @@ def aging_analysis(test, datapath_module, pacer_interval, num_of_sim_tags):
105
105
  if test.rc == TEST_FAILED:
106
106
  return test
107
107
  utPrint(f"\nEnd of aging time pixels count: {second_floor_tags_ctr}\n", "BLUE")
108
- if test.sterile_run and second_floor_tags_ctr != 0:
108
+ if ((test.sterile_run and second_floor_tags_ctr != 0) or
109
+ (not test.sterile_run and second_floor_tags_ctr > TAGS_CTR_OVER_THRESHOLD * first_floor_tags_ctr)):
109
110
  test.rc = TEST_FAILED
110
111
  test.add_reason("Pixel count is higher than expected. Looks like aging time is too long.\n"
111
- f"Number of pixels after aging time: {second_floor_tags_ctr}")
112
- elif not test.sterile_run and (second_floor_tags_ctr > TAGS_CTR_OVER_THRESHOLD * first_floor_tags_ctr):
113
- test.rc = TEST_FAILED
114
- test.add_reason("Pixel count is higher than expected. Looks like aging time is too long.\n"
115
- f"Number of pixels after aging time: {second_floor_tags_ctr},"
116
- f" before tags simulation was: {second_peak_tags_ctr}\n")
112
+ f"tags_ctr value: {second_peak_tags_ctr}\nFloor number of pixels: {second_floor_tags_ctr}")
117
113
  return test
118
114
 
119
115
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Event Test BLE 5",
3
3
  "module": "Datapath",
4
- "purpose": "Test dynamic pacing for tags that had location events on BLE5 packets",
4
+ "purpose": "Test pacing disable (later dynamic pacing)",
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",
7
7
  "procedure": ["Test prolog",
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 1,
15
- "SupportedFromApiVersion": 13,
16
- "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
15
+ "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
17
16
  }
@@ -7,9 +7,17 @@ import certificate.cert_config as cert_config
7
7
 
8
8
  NEW_TAG_EVENT_SCAN_TIME = 100 # in seconds
9
9
  TAG_EVENT_SCAN_TIME = 60 # in seconds
10
+ NEW_TAG_HOURS_EVENT_SCAN_TIME = 62 * 60 # 62 minutes
10
11
  RSSI_MOVEMENT_THRESHOLD = 15
11
12
 
12
13
 
14
+ def test_new_tag_event_hours(test, phase, datapath_module):
15
+ values = [ag.EVENT_TIME_UNIT_HOURS, TEST_EVENT_WINDOW_HR_CFG, ag.RX_CHANNEL_10_500K, ag.EVENT_TRIGGER_NEW_TAG, 0]
16
+ return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_HOURS_EVENT_SCAN_TIME,
17
+ ag.EVENT_TIME_UNIT_HOURS, ble5_test=True,
18
+ pkt_filter_cfg=ag.PKT_FILTER_TEMP_AND_ADVANCED_PKTS)
19
+
20
+
13
21
  def test_new_tag_event_minutes(test, phase, datapath_module):
14
22
  values = [ag.EVENT_TIME_UNIT_MINUTES, TEST_EVENT_WINDOW_MIN_CFG, ag.RX_CHANNEL_10_500K, ag.EVENT_TRIGGER_NEW_TAG, 0]
15
23
  return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_EVENT_SCAN_TIME,
@@ -46,7 +54,7 @@ def test_rssi_event(test, phase, datapath_module):
46
54
 
47
55
 
48
56
  EVENT_TEST_MAP = {"rssi_event": test_rssi_event, "new_tag_event_seconds": test_new_tag_event_seconds,
49
- "new_tag_event_minutes": test_new_tag_event_minutes,
57
+ "new_tag_event_minutes": test_new_tag_event_minutes, "new_tag_event_hours": test_new_tag_event_hours,
50
58
  "temp_event": test_temp_event, "tx_rate_event": test_tx_rate_event}
51
59
 
52
60
 
@@ -55,11 +63,10 @@ def run(test):
55
63
  test = cert_common.test_prolog(test)
56
64
  if test.rc == TEST_FAILED:
57
65
  return cert_common.test_epilog(test)
58
- dut = cert_config.get_brg_by_target(test, DUT)
59
66
 
60
67
  for param in test.params:
61
68
  phase_run_print(param.name)
62
- test = EVENT_TEST_MAP[param.value](test, param.name, dut.datapath)
69
+ test = EVENT_TEST_MAP[param.value](test, param.name, test.active_brg.datapath)
63
70
  cert_mqtt.generate_log_file(test, param.name)
64
71
  field_functionality_pass_fail_print(test, param.name)
65
72
  test.set_phase_rc(param.name, test.rc)
@@ -72,11 +79,10 @@ def run(test):
72
79
  continue
73
80
 
74
81
  # Reset to defaults after every phase (don't fail the phase on that)
75
- test = cert_config.config_brg_defaults(test, modules=[dut.datapath], ble5=test.dut_is_bridge())[0]
82
+ test = cert_config.config_brg_defaults(test, modules=[test.active_brg.datapath], ble5=True)[0]
83
+ print_update_wait(2 * BLE5_MAX_DURATION_SEC)
76
84
  if test.rc == TEST_FAILED:
77
85
  test.add_reason("Failed to restore brg to defaults")
78
- if test.dut_is_bridge():
79
- wait_time_n_print(BLE5_MAX_DURATION_SEC)
80
86
 
81
87
  if test.rc == TEST_FAILED:
82
88
  test.set_phase_rc(param.name, test.rc)
@@ -86,4 +92,4 @@ def run(test):
86
92
  else:
87
93
  test.reset_result()
88
94
 
89
- return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.datapath], ble5=test.dut_is_bridge())
95
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[test.active_brg.datapath], ble5=True)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Event Test",
3
3
  "module": "Datapath",
4
- "purpose": "Test dynamic pacing for tags that had location events",
4
+ "purpose": "Test pacing disable for tags that had location events",
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",
7
7
  "procedure": ["Test prolog",
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 1,
15
- "SupportedFromApiVersion": 13,
16
- "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
15
+ "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
17
16
  }
@@ -7,9 +7,15 @@ import certificate.cert_config as cert_config
7
7
 
8
8
  NEW_TAG_EVENT_SCAN_TIME = 100 # in seconds
9
9
  TAG_EVENT_SCAN_TIME = 60 # in seconds
10
+ NEW_TAG_HOURS_EVENT_SCAN_TIME = 62 * 60 # 62 minutes
10
11
  RSSI_MOVEMENT_THRESHOLD = 15
11
12
 
12
13
 
14
+ def test_new_tag_event_hours(test, phase, datapath_module):
15
+ values = [ag.EVENT_TIME_UNIT_HOURS, TEST_EVENT_WINDOW_HR_CFG, ag.RX_CHANNEL_37, ag.EVENT_TRIGGER_NEW_TAG, 0]
16
+ return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_HOURS_EVENT_SCAN_TIME, ag.EVENT_TIME_UNIT_HOURS)
17
+
18
+
13
19
  def test_new_tag_event_minutes(test, phase, datapath_module):
14
20
  values = [ag.EVENT_TIME_UNIT_MINUTES, TEST_EVENT_WINDOW_MIN_CFG, ag.RX_CHANNEL_37, ag.EVENT_TRIGGER_NEW_TAG, 0]
15
21
  return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_EVENT_SCAN_TIME, ag.EVENT_TIME_UNIT_MINUTES)
@@ -39,7 +45,7 @@ def test_rssi_event(test, phase, datapath_module):
39
45
 
40
46
 
41
47
  EVENT_TEST_MAP = {"rssi_event": test_rssi_event, "new_tag_event_seconds": test_new_tag_event_seconds,
42
- "new_tag_event_minutes": test_new_tag_event_minutes,
48
+ "new_tag_event_minutes": test_new_tag_event_minutes, "new_tag_event_hours": test_new_tag_event_hours,
43
49
  "temp_event": test_temp_event, "tx_rate_event": test_tx_rate_event}
44
50
 
45
51
 
@@ -48,11 +54,10 @@ def run(test):
48
54
  test = cert_common.test_prolog(test)
49
55
  if test.rc == TEST_FAILED:
50
56
  return cert_common.test_epilog(test)
51
- dut = cert_config.get_brg_by_target(test, DUT)
52
57
 
53
58
  for param in test.params:
54
59
  phase_run_print(param.name)
55
- test = EVENT_TEST_MAP[param.value](test, param.name, dut.datapath)
60
+ test = EVENT_TEST_MAP[param.value](test, param.name, test.active_brg.datapath)
56
61
  cert_mqtt.generate_log_file(test, param.name)
57
62
  field_functionality_pass_fail_print(test, param.name)
58
63
  test.set_phase_rc(param.name, test.rc)
@@ -65,7 +70,7 @@ def run(test):
65
70
  continue
66
71
 
67
72
  # Reset to defaults after every phase (don't fail the phase on that)
68
- test = cert_config.config_brg_defaults(test, modules=[dut.datapath])[0]
73
+ test = cert_config.config_brg_defaults(test, modules=[test.active_brg.datapath])[0]
69
74
  if test.rc == TEST_FAILED:
70
75
  test.add_reason("Failed to restore brg to defaults")
71
76
 
@@ -77,4 +82,4 @@ def run(test):
77
82
  else:
78
83
  test.reset_result()
79
84
 
80
- return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.datapath])
85
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[test.active_brg.datapath])
@@ -14,6 +14,5 @@
14
14
  "multiBridgeTest": 0,
15
15
  "gwOnlyTest": 0,
16
16
  "dataSimOnlyTest": 1,
17
- "SupportedFromApiVersion": 12,
18
- "allSupportedValues": ["dynamic_parameters", 1000]
17
+ "allSupportedValues": [500, 1000, 2500, 5000]
19
18
  }