wiliot-certificate 4.5.0a3__py3-none-any.whl → 4.5.0a5__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 (53) hide show
  1. certificate/cert_common.py +33 -16
  2. certificate/cert_config.py +3 -3
  3. certificate/cert_data_sim.py +12 -9
  4. certificate/cert_defines.py +6 -0
  5. certificate/cert_gw_sim.py +26 -7
  6. certificate/cert_mqtt.py +5 -4
  7. certificate/cert_results.py +42 -32
  8. certificate/cert_utils.py +9 -10
  9. certificate/certificate.py +7 -5
  10. certificate/certificate_cli.py +10 -13
  11. certificate/tests/cloud_connectivity/acl_test/acl_test.py +13 -15
  12. certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +1 -1
  13. certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +2 -2
  14. certificate/tests/cloud_connectivity/connection_test/connection_test.py +4 -13
  15. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +1 -2
  16. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +12 -6
  17. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +1 -1
  18. certificate/tests/cloud_connectivity/stress_test/stress_test.py +12 -7
  19. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +1 -2
  20. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +26 -20
  21. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +1 -1
  22. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +1 -9
  23. certificate/tests/datapath/event_test/event_test.json +1 -1
  24. certificate/tests/datapath/event_test/event_test.py +1 -7
  25. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  26. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +3 -1
  27. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +2 -0
  28. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +1 -1
  29. common/api_if/api_validation.py +6 -0
  30. gui_certificate/server.py +151 -58
  31. gui_certificate/templates/cert_run.html +86 -93
  32. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/METADATA +5 -15
  33. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/RECORD +37 -53
  34. certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +0 -211
  35. certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +0 -894
  36. certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +0 -184
  37. certificate/ag/wlt_types_ag_jsons/calibration.json +0 -490
  38. certificate/ag/wlt_types_ag_jsons/custom.json +0 -614
  39. certificate/ag/wlt_types_ag_jsons/datapath.json +0 -900
  40. certificate/ag/wlt_types_ag_jsons/energy2400.json +0 -670
  41. certificate/ag/wlt_types_ag_jsons/energySub1g.json +0 -691
  42. certificate/ag/wlt_types_ag_jsons/externalSensor.json +0 -727
  43. certificate/ag/wlt_types_ag_jsons/interface.json +0 -1095
  44. certificate/ag/wlt_types_ag_jsons/powerManagement.json +0 -1439
  45. certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +0 -105
  46. certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +0 -77
  47. certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +0 -126
  48. certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +0 -175
  49. certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +0 -65
  50. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/WHEEL +0 -0
  51. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/entry_points.txt +0 -0
  52. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/licenses/LICENSE +0 -0
  53. {wiliot_certificate-4.5.0a3.dist-info → wiliot_certificate-4.5.0a5.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,7 @@ import certificate.cert_data_sim as cert_data_sim
8
8
  from certificate.ag.wlt_types_ag import *
9
9
 
10
10
  SCAN_TIMEOUT = 30
11
-
11
+ NUM_OF_BRGS = 4
12
12
  # DEFINES
13
13
  test_indicator = cert_data_sim.PIXEL_SIM_INDICATOR
14
14
 
@@ -20,11 +20,11 @@ def run(test):
20
20
  return cert_common.test_epilog(test)
21
21
 
22
22
  # Generate management and data packets
23
- bridge_ids = []
24
- pixels_pkts, bridge_ids = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=20, num_of_brgs=4,
25
- pkt_type=PIXELS_PKT, indicator=test_indicator)
23
+ bridge_ids = [cert_common.hex2alias_id_get(get_random_hex_str(12)) for _ in range(NUM_OF_BRGS)]
24
+ pixels_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=20, num_of_brgs=NUM_OF_BRGS, brgs_list=bridge_ids,
25
+ pkt_type=PIXELS_PKT, indicator=test_indicator)
26
26
 
27
- mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=4, brgs_list=bridge_ids,
27
+ mgmt_pkts, _ = cert_data_sim.brg_pkt_gen(num_of_pkts_per_brg=10, num_of_brgs=NUM_OF_BRGS, brgs_list=bridge_ids,
28
28
  pkt_type=MGMT_PKT, indicator=test_indicator)
29
29
  # Use first 3 bridges for ACL, 4th bridge is not in ACL
30
30
  acl_bridge_ids = bridge_ids[:3]
@@ -41,7 +41,7 @@ def run(test):
41
41
  cfg = cert_config.get_default_gw_dict(test)
42
42
  cfg[ACL][ACL_BRIDGE_IDS] = acl_bridge_ids
43
43
  cfg[ACL][ACL_MODE] = param.value
44
- test, ret = cert_config.gw_configure(test, cfg=cfg, wait=True)
44
+ test, _ = cert_config.gw_configure(test, cfg=cfg, wait=True)
45
45
  print_update_wait(1)
46
46
 
47
47
  test.get_mqttc_by_target(DUT).flush_pkts()
@@ -51,8 +51,8 @@ def run(test):
51
51
  # Analyze pass/fail
52
52
  # Get all received packets with the test indicator and filter packets by bridge IDs in ACL list
53
53
  received_pkts = cert_mqtt.get_unified_data_pkts(test, only_active_brg=False, indicator=test_indicator)
54
- acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in acl_bridge_ids]
55
- non_acl_bridge_pkts = [pkt for pkt in received_pkts if pkt[ALIAS_BRIDGE_ID] in non_acl_bridge_id]
54
+ acl_bridge_pkts = [pkt for pkt in received_pkts if any([id in pkt[PAYLOAD] for id in acl_bridge_ids])]
55
+ non_acl_bridge_pkts = [pkt for pkt in received_pkts if non_acl_bridge_id in pkt[PAYLOAD]]
56
56
 
57
57
  # In deny mode - we want to make sure bridges in ACL list are filtered
58
58
  if param.value == ACL_DENY:
@@ -71,20 +71,18 @@ def run(test):
71
71
  test.add_reason(f"Phase failed! Bridge {non_acl_bridge_id} was not on the allow list "
72
72
  f"and {len(non_acl_bridge_pkts)} packets were found from it")
73
73
  # Check that we received packets from all expected bridges
74
- received_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
75
- if received_bridge_ids != set(acl_bridge_ids):
74
+ received_alias_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in acl_bridge_pkts])
75
+ if len(received_alias_bridge_ids) != len(acl_bridge_ids):
76
76
  test.rc = TEST_FAILED
77
77
  test.add_reason("Phase failed! Didn't receive packets from all bridges that were on the allow list")
78
78
 
79
79
  # Check that management packets are received from all bridges (ACL doesn't filter mgmt packets)
80
80
  all_mgmt_pkts = cert_mqtt.get_all_mgmt_pkts(test.get_mqttc_by_target(DUT), indicator=test_indicator)
81
- mgmt_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
81
+ mgmt_alias_bridge_ids = set([pkt[ALIAS_BRIDGE_ID] for pkt in all_mgmt_pkts])
82
82
 
83
- if not set(bridge_ids).issubset(mgmt_bridge_ids):
83
+ if len(mgmt_alias_bridge_ids) != NUM_OF_BRGS:
84
84
  test.rc = TEST_FAILED
85
- missing_bridges = set(bridge_ids) - mgmt_bridge_ids
86
- test.add_reason(f"Phase failed! Expected management packets from all bridges, "
87
- f"whether they are on the ACL or not, but missing from BRG {missing_bridges}")
85
+ test.add_reason("Phase failed! Didn't receive management packets from all bridges")
88
86
 
89
87
  field_functionality_pass_fail_print(test, "ACL", value=param.value)
90
88
  test.set_phase_rc(param.name, test.rc)
@@ -9,7 +9,7 @@
9
9
  "Analyze if bridge was upgraded and action status message was uploaded",
10
10
  "Test epilog"],
11
11
  "expectedOutcome": "Tester brg advertises ModuleIF packet with the new version and DUT Gateway publish an actionStatus message indicating success and within timeout",
12
- "mandatory": 1,
12
+ "mandatory": 0,
13
13
  "multiBridgeTest": 0,
14
14
  "gwOnlyTest": 1,
15
15
  "internalBridge": 1,
@@ -3,7 +3,6 @@ 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
7
6
  import certificate.cert_mqtt as cert_mqtt
8
7
  import certificate.cert_config as cert_config
9
8
  import certificate.cert_gw_sim as cert_gw_sim
@@ -18,7 +17,7 @@ from collections import defaultdict
18
17
  # DEFINES
19
18
  CHANNELS = [37, 38, 39] # channel to check in DUT
20
19
  DEFAULT_WAIT_TIME = 5 # How much extra time to wait after the transmition is over
21
- SCAN_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6) # Unique identifier for the pkt sent
20
+ SCAN_TEST_INDICATOR = get_random_hex_str(6) # Unique identifier for the pkt sent
22
21
  ADV_DURATION = 20 # How long to transmit to the DUT
23
22
  # cmd_ble_sm defines
24
23
  BLE_SIM_RADIO_1MBPS = 1
@@ -84,6 +83,7 @@ def analyze_listening_timeline(test, all_pkts_received_from_tester, num_of_sent_
84
83
  channel_cards = []
85
84
 
86
85
  # 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)
@@ -25,19 +25,10 @@ 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
- )
36
28
  dut_mqttc.flush_pkts()
37
- input(
38
- f"{warning_prefix}Please plug GW back to power. "
39
- f"Press enter when plugged{warning_suffix}"
40
- )
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}"))
41
32
  else:
42
33
  # If this test runs as part of a pipeline, act like the reboot test and don't demand a manual disconnect & connect
43
34
  utPrint(f"Publishing reboot action to {dut_mqttc.update_topic}. Awaiting reconnect.. (timeout is {TIMEOUT_IN_MINUTES} minutes)")
@@ -55,7 +46,7 @@ def run(test):
55
46
  print_update_wait(5)
56
47
 
57
48
  # generate logs
58
- cert_mqtt.generate_log_file(test, "reboot")
49
+ cert_mqtt.generate_log_file(test, "connection")
59
50
 
60
51
  # Analyze results
61
52
  if gw_type is None:
@@ -3,14 +3,13 @@ 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
7
6
  import certificate.cert_mqtt as cert_mqtt
8
7
  import certificate.cert_data_sim as cert_data_sim
9
8
  import pandas as pd
10
9
 
11
10
 
12
11
  # DEFINES
13
- UPLINK_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
12
+ UPLINK_TEST_INDICATOR = get_random_hex_str(6)
14
13
  NUM_OF_BRGS = 3
15
14
 
16
15
 
@@ -12,7 +12,7 @@ import math
12
12
 
13
13
 
14
14
  # DEFINES
15
- STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
15
+ STRESS_TEST_INDICATOR = get_random_hex_str(6)
16
16
 
17
17
  DUPLICATES = 1
18
18
  ADVA_ASCII_LEN = 12
@@ -76,16 +76,19 @@ 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
-
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
80
86
  test, received_pps = cert_common.stress_analysis(
81
87
  test, pps, generated_payloads,
82
88
  [(p[ALIAS_BRIDGE_ID] + p[AGGREGATED_PAYLOAD]) for p in phase_pkts_received])
83
89
  results.extend([pps, received_pps])
84
90
  cert_mqtt.generate_log_file(test, str(pps))
85
91
 
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)
89
92
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
90
93
  break # break the whole for loop and keep the test as failed
91
94
  test.reset_result() # reset result and continue to next param
@@ -94,6 +97,9 @@ def run(test):
94
97
  cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
95
98
 
96
99
  # Generate stress test graphs
97
- cert_common.generate_graph_stress_test(test, results, data_pkts_received)
100
+ if len(data_pkts_received) > 0:
101
+ cert_common.generate_graph_stress_test(test, results, data_pkts_received)
102
+ else:
103
+ utPrint("No data packets received - skipping graph generation", "RED")
98
104
 
99
105
  return cert_common.test_epilog(test)
@@ -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(test.dut, test.tester, html=True, pdf=True, failures=failures,
80
+ cert_results.generate_results_files(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,7 +12,7 @@ import math
12
12
 
13
13
 
14
14
  # DEFINES
15
- STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
15
+ STRESS_TEST_INDICATOR = get_random_hex_str(6)
16
16
 
17
17
  DUPLICATES = 1
18
18
  ADVA_ASCII_LEN = 12
@@ -74,16 +74,19 @@ 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
-
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
78
84
  test, received_pps = cert_common.stress_analysis(
79
85
  test, pps, generated_payloads,
80
86
  [(p[ALIAS_BRIDGE_ID] + p[PAYLOAD]) for p in phase_pkts_received])
81
87
  results.extend([pps, received_pps])
82
88
  cert_mqtt.generate_log_file(test, str(pps))
83
89
 
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)
87
90
  if test.rc == TEST_FAILED and test.exit_on_param_failure:
88
91
  break # break the whole for loop and keep the test as failed
89
92
  test.reset_result() # reset result and continue to next param
@@ -91,7 +94,9 @@ def run(test):
91
94
  test_pkts_received.extend(test.get_mqttc_by_target(DUT)._userdata[PKTS].data)
92
95
  cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
93
96
 
94
- # Generate stress test graphs
95
- cert_common.generate_graph_stress_test(test, results, data_pkts_received)
97
+ if len(data_pkts_received) > 0:
98
+ cert_common.generate_graph_stress_test(test, results, data_pkts_received)
99
+ else:
100
+ utPrint("No data packets received - skipping graph generation", "RED")
96
101
 
97
102
  return cert_common.test_epilog(test)
@@ -4,14 +4,13 @@ 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
8
7
  import certificate.cert_mqtt as cert_mqtt
9
8
  import certificate.cert_config as cert_config
10
9
  import certificate.cert_data_sim as cert_data_sim
11
10
  from certificate.cert_gw_sim import GW_CERT_TESTER
12
11
 
13
12
  # DEFINES
14
- EXT_ADV_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
13
+ EXT_ADV_TEST_INDICATOR = get_random_hex_str(6)
15
14
  EXPECTED_REPEAT_COUNT = 7
16
15
 
17
16
 
@@ -4,7 +4,6 @@ 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
8
7
  import certificate.cert_mqtt as cert_mqtt
9
8
  import certificate.cert_data_sim as cert_data_sim
10
9
  import pandas as pd
@@ -13,24 +12,27 @@ import pandas as pd
13
12
  # DEFINES
14
13
 
15
14
  API_VALIDATION = "API Validation"
16
- UPLINK_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
15
+ UPLINK_TEST_INDICATOR = get_random_hex_str(6)
17
16
  NUM_OF_BRGS = 3
18
17
 
19
18
 
20
19
  # HELPER FUNCTIONS
21
- def uplink_analysis(test, pkts, received_pkts, pkt_type):
20
+ def uplink_analysis(test, sent_pkts, received_pkts, pkt_type):
22
21
  if len(received_pkts) == 0:
23
22
  test.set_phase_rc(pkt_type, TEST_FAILED)
24
23
  test.add_phase_reason(pkt_type, "No packets were received!")
25
- return test, 0
24
+ return test
26
25
 
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)
26
+ # Verify packets were received from NUM_OF_BRGS bridges
27
+ received_brgs = len(set([p[ALIAS_BRIDGE_ID] for p in received_pkts]))
28
+ if 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 {received_brgs} bridges instead of {NUM_OF_BRGS} bridges!")
31
+ return test
32
32
 
33
+ _sent_pkts = [p.get_pkt()[12:] for p in sent_pkts]
33
34
  sent_df = pd.DataFrame(_sent_pkts, columns=[PACKETS])
35
+ received_pkts = [p[PAYLOAD] for p in received_pkts]
34
36
  received_df = pd.DataFrame(received_pkts, columns=[PACKETS])
35
37
 
36
38
  merged_df = pd.merge(sent_df, received_df, on=PACKETS, how='inner')
@@ -47,16 +49,17 @@ def uplink_analysis(test, pkts, received_pkts, pkt_type):
47
49
  if pkts_sent_count == 0:
48
50
  test.set_phase_rc(pkt_type, TEST_FAILED)
49
51
  test.add_phase_reason(pkt_type, "No packets were sent!")
50
- return test, 0
52
+ return test
51
53
 
52
54
  percentage_received = round(pkts_received_count * 100 / pkts_sent_count)
53
55
 
54
56
  # PASS/FAIL logic
55
57
  if percentage_received < 80:
56
- test.rc = TEST_FAILED
57
- test.reason = f"Insufficient amount of {pkt_type} packets were scanned & uploaded by the gateway"
58
+ test.set_phase_rc(pkt_type, TEST_FAILED)
59
+ test.add_phase_reason(pkt_type, f'{percentage_received}% of {pkt_type} packets received')
58
60
  else:
59
- test.reason = f'{percentage_received}% of {pkt_type} packets received'
61
+ test.set_phase_rc(pkt_type, TEST_PASSED)
62
+ test.add_phase_reason(pkt_type, f'{percentage_received}% of {pkt_type} packets received')
60
63
 
61
64
  return test
62
65
 
@@ -134,22 +137,25 @@ def run(test):
134
137
  all_data_messages_in_test.extend(dut_mqttc._userdata[PKTS].data)
135
138
  all_data_pkts.extend(cert_mqtt.get_all_data_pkts(dut_mqttc))
136
139
  recieved_pkts = cert_mqtt.get_all_data_pkts(dut_mqttc, indicator=UPLINK_TEST_INDICATOR)
140
+ valid, reason = cert_common.validate_received_packets(recieved_pkts)
141
+ if valid is False:
142
+ test.set_phase_rc(param.name, TEST_FAILED)
143
+ test.add_phase_reason(param.name, reason)
144
+ utPrint(f"Phase {param.name} failed validation: {reason}", "RED")
145
+ continue
137
146
 
138
- test = uplink_analysis(test, pkts, [p[ALIAS_BRIDGE_ID] + p[PAYLOAD] for p in recieved_pkts], param.name)
147
+ test = uplink_analysis(test, pkts, recieved_pkts, param.name)
139
148
 
140
149
  cert_mqtt.generate_log_file(test, param.name)
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:
150
+ field_functionality_pass_fail_print(test.get_phase_by_name(param.name), 'pkt_type', value=param.name)
151
+ if test.get_phase_by_name(param.name).rc == TEST_FAILED:
145
152
  if test.exit_on_param_failure:
146
153
  break # break the whole for loop and keep the test as failed
147
154
  test.reset_result() # reset result and continue to next param
148
155
 
149
156
  # Other Validations
150
157
  # Api Validation
151
- if not test.dut.protobuf:
152
- test = api_validation(test)
158
+ test = api_validation(test)
153
159
  test = cert_common.wiliot_pkts_validation(test, all_data_messages_in_test, all_data_pkts)
154
160
 
155
161
  # Geolocation phase
@@ -12,5 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 1,
15
- "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
15
+ "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
16
16
  }
@@ -7,17 +7,9 @@ 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
11
10
  RSSI_MOVEMENT_THRESHOLD = 15
12
11
 
13
12
 
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
-
21
13
  def test_new_tag_event_minutes(test, phase, datapath_module):
22
14
  values = [ag.EVENT_TIME_UNIT_MINUTES, TEST_EVENT_WINDOW_MIN_CFG, ag.RX_CHANNEL_10_500K, ag.EVENT_TRIGGER_NEW_TAG, 0]
23
15
  return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_EVENT_SCAN_TIME,
@@ -54,7 +46,7 @@ def test_rssi_event(test, phase, datapath_module):
54
46
 
55
47
 
56
48
  EVENT_TEST_MAP = {"rssi_event": test_rssi_event, "new_tag_event_seconds": test_new_tag_event_seconds,
57
- "new_tag_event_minutes": test_new_tag_event_minutes, "new_tag_event_hours": test_new_tag_event_hours,
49
+ "new_tag_event_minutes": test_new_tag_event_minutes,
58
50
  "temp_event": test_temp_event, "tx_rate_event": test_tx_rate_event}
59
51
 
60
52
 
@@ -12,5 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 1,
15
- "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
15
+ "allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
16
16
  }
@@ -7,15 +7,9 @@ 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
11
10
  RSSI_MOVEMENT_THRESHOLD = 15
12
11
 
13
12
 
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
-
19
13
  def test_new_tag_event_minutes(test, phase, datapath_module):
20
14
  values = [ag.EVENT_TIME_UNIT_MINUTES, TEST_EVENT_WINDOW_MIN_CFG, ag.RX_CHANNEL_37, ag.EVENT_TRIGGER_NEW_TAG, 0]
21
15
  return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_EVENT_SCAN_TIME, ag.EVENT_TIME_UNIT_MINUTES)
@@ -45,7 +39,7 @@ def test_rssi_event(test, phase, datapath_module):
45
39
 
46
40
 
47
41
  EVENT_TEST_MAP = {"rssi_event": test_rssi_event, "new_tag_event_seconds": test_new_tag_event_seconds,
48
- "new_tag_event_minutes": test_new_tag_event_minutes, "new_tag_event_hours": test_new_tag_event_hours,
42
+ "new_tag_event_minutes": test_new_tag_event_minutes,
49
43
  "temp_event": test_temp_event, "tx_rate_event": test_tx_rate_event}
50
44
 
51
45
 
@@ -31,7 +31,7 @@ def cal_scan_time(test, delay, pacer_interval):
31
31
 
32
32
  def scan_and_compare(test, pacer_interval, delay, expected_TBC_value):
33
33
 
34
- pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3, delay=delay, pkt_types=[0], pixels_type=GEN3)
34
+ pixel_sim_thread = cert_data_sim.DataSimThread(test=test, num_of_pixels=1, duplicates=3, delay=delay, pkt_types=[0], pixels_type=GEN2)
35
35
  pixel_sim_thread.start()
36
36
  test, scan_time = cal_scan_time(test, delay, pacer_interval)
37
37
  df = cert_common.data_scan(test, scan_time=scan_time, brg_data=(not test.internal_brg), gw_data=test.internal_brg)
@@ -284,7 +284,7 @@ def test_rx_tx(test):
284
284
  print(rec_sig_ind_pkts) # TODO: logging print(debug)
285
285
 
286
286
  # Analyzing tester performance as receiver
287
- utPrint(f"Analyzing DUT {tester.id_str} performance as a Transmitter\n", "BOLD")
287
+ utPrint(f"Analyzing DUT {dut.id_str} performance as a Transmitter\n", "BOLD")
288
288
  rec_sig_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tester, tx_brg=dut)
289
289
  if cert_common.sig_ind_pkts_fail_analysis(tx_brg=dut, rx_brg=tester, cycles=NUM_OF_SCANNING_CYCLE, received_pkts=rec_sig_ind_pkts):
290
290
  test.rc = TEST_FAILED
@@ -323,6 +323,8 @@ def run(test):
323
323
  return cert_common.test_epilog(test, revert_brgs=True,
324
324
  modules=[dut.datapath],
325
325
  ble5=test.dut_is_bridge())
326
+ if test.dut_is_bridge():
327
+ wait_time_n_print(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
326
328
  # Configure TESTER to scan ble5 channel during all the test
327
329
  test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL],
328
330
  values=[ag.RX_CHANNEL_10_500K],
@@ -161,6 +161,8 @@ def run(test):
161
161
  # Revert DUT and TESTER to defaults here and not in epilog
162
162
  test = cert_config.config_brg_defaults(test, modules=[dut.datapath, dut.energy2400],
163
163
  ble5=test.dut_is_bridge(), wait=test.dut_is_combo())[0]
164
+ if test.dut_is_bridge():
165
+ wait_time_n_print(2 * BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to 2 * BLE5_MAX_DURATION_SEC
164
166
  if test.rc == TEST_FAILED:
165
167
  test.add_reason("Failed to revert dut to defaults")
166
168
  else:
@@ -288,7 +288,7 @@ def test_rx_tx(test):
288
288
  print(rec_sig_ind_pkts) # TODO: logging print(debug)
289
289
 
290
290
  # Analyzing tester performance as receiver
291
- utPrint(f"Analyzing DUT {tester.id_str} performance as a Transmitter\n", "BOLD")
291
+ utPrint(f"Analyzing DUT {dut.id_str} performance as a Transmitter\n", "BOLD")
292
292
  rec_sig_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tester, tx_brg=dut)
293
293
  if cert_common.sig_ind_pkts_fail_analysis(tx_brg=dut, rx_brg=tester, cycles=NUM_OF_SCANNING_CYCLE, received_pkts=rec_sig_ind_pkts):
294
294
  test.rc = TEST_FAILED
@@ -25,6 +25,12 @@ def api_validation(test):
25
25
  api_validation_phase.reason = "API validation is skipped for protobuf messages"
26
26
  test.add_phase(api_validation_phase)
27
27
  return test
28
+ elif not test.dut.gw_api_version:
29
+ utPrint("API validation is skipped because no API version was specified", "WARNING")
30
+ api_validation_phase.rc = TEST_FAILED
31
+ api_validation_phase.reason = "API validation is skipped because no API version was specified"
32
+ test.add_phase(api_validation_phase)
33
+ return test
28
34
  else:
29
35
  def validate_message(message: dict, msg_type=MESSAGE_TYPES.DATA.value) -> tuple[bool, str]:
30
36
  json_path = pkg_resources.resource_filename(__name__, f"{test.dut.gw_api_version}/{msg_type}.json")