wiliot-certificate 4.5.0__py3-none-any.whl → 4.5.0a1__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 +46 -75
  18. certificate/cert_config.py +18 -43
  19. certificate/cert_data_sim.py +9 -12
  20. certificate/cert_defines.py +0 -9
  21. certificate/cert_gw_sim.py +7 -35
  22. certificate/cert_mqtt.py +5 -15
  23. certificate/cert_prints.py +0 -1
  24. certificate/cert_results.py +37 -56
  25. certificate/cert_utils.py +15 -27
  26. certificate/certificate.py +5 -12
  27. certificate/certificate_cli.py +13 -10
  28. certificate/certificate_eth_test_list.txt +4 -6
  29. certificate/certificate_sanity_test_list.txt +2 -3
  30. certificate/certificate_test_list.txt +4 -5
  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 +1 -2
  35. certificate/tests/cloud_connectivity/acl_test/acl_test.json +1 -2
  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 +1 -2
  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/downlink_test/downlink_test.json +0 -1
  44. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +4 -1
  45. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +1 -2
  46. certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +14 -20
  47. certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +0 -1
  48. certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +0 -2
  49. certificate/tests/cloud_connectivity/registration_test/registration_test.json +0 -1
  50. certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +1 -1
  51. certificate/tests/cloud_connectivity/stress_test/stress_test.json +1 -2
  52. certificate/tests/cloud_connectivity/stress_test/stress_test.py +16 -20
  53. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +0 -1
  54. certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +2 -1
  55. certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +0 -1
  56. certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +20 -28
  57. certificate/tests/datapath/aging_test/aging_test.json +0 -1
  58. certificate/tests/datapath/aging_test/aging_test.py +3 -7
  59. certificate/tests/datapath/event_ble5_test/event_ble5_test.json +2 -3
  60. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +13 -7
  61. certificate/tests/datapath/event_test/event_test.json +2 -3
  62. certificate/tests/datapath/event_test/event_test.py +10 -5
  63. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -3
  64. certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +5 -9
  65. certificate/tests/datapath/output_power_test/output_power_test.json +0 -1
  66. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +0 -1
  67. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
  68. certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +0 -1
  69. certificate/tests/datapath/pattern_test/pattern_test.json +0 -1
  70. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +0 -1
  71. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +5 -5
  72. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +0 -1
  73. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +5 -5
  74. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.json +0 -1
  75. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +8 -10
  76. certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +0 -1
  77. certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +0 -1
  78. certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -2
  79. certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +0 -1
  80. certificate/tests/datapath/rx_channel_test/rx_channel_test.json +0 -1
  81. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +0 -1
  82. certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
  83. certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +0 -1
  84. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +0 -1
  85. certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +0 -3
  86. certificate/tests/datapath/stress_test/stress_test.json +0 -1
  87. certificate/tests/datapath/stress_test/stress_test.py +0 -3
  88. certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +0 -1
  89. certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +0 -1
  90. certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +0 -1
  91. certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +0 -1
  92. certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +0 -1
  93. certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +0 -1
  94. certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +0 -1
  95. certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +0 -1
  96. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +0 -1
  97. certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +14 -18
  98. certificate/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +0 -1
  99. certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +0 -1
  100. certificate/tests/energy2400/output_power_test/output_power_test.json +0 -1
  101. certificate/tests/energy2400/pattern_test/pattern_test.json +0 -1
  102. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -1
  103. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +3 -4
  104. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +9 -9
  105. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +271 -113
  106. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -1
  107. certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +1 -1
  108. certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +0 -1
  109. certificate/tests/energy_sub1g/pattern_test/pattern_test.json +0 -1
  110. certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +0 -1
  111. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +0 -1
  112. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +9 -4
  113. common/api_if/api_validation.py +2 -8
  114. common/web/templates/generator.html +79 -141
  115. common/web/web_utils.py +56 -78
  116. gui_certificate/server.py +78 -283
  117. gui_certificate/templates/cert_run.html +113 -179
  118. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/METADATA +38 -27
  119. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/RECORD +123 -109
  120. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +0 -15
  121. certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +0 -80
  122. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/WHEEL +0 -0
  123. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/entry_points.txt +0 -0
  124. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/licenses/LICENSE +0 -0
  125. {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/top_level.txt +0 -0
@@ -5,169 +5,327 @@ import certificate.cert_mqtt as cert_mqtt
5
5
  import certificate.cert_common as cert_common
6
6
  import certificate.cert_config as cert_config
7
7
 
8
+ # Test Description:
9
+ # This test is to verify the functionality of both signal indicator tx (tx_brg) and rx (rx_brg) at BRG level.
10
+ # We will configure several signal indicator params during the test, and check the functionality of the signal indicator logic
11
+ # for each of them.
12
+ # It is important to execute the test with several setups: 2 Fanstel BRG's, 2 Minew BRG's and 1 Fanstel and 1 Minew BRG.
13
+ # At first, we will configure several tx signal indicator params and check for ack's, to verify all indicated params were
14
+ # received at the cloud.
15
+ # Then, we will examine the signal indicator end-2-end logic with both transmitter and receiver:
16
+ # phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx, and we expect to see
17
+ # signal indicator packets only from the tx BRG, and according to the tx params (to check the repetition and cycle params).
18
+ # phase 2 - Same as phase 1, but with different tx params configured.
19
+ # phase 3 - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets. This phase is to verify the
20
+ # brg module logic is working properly, and no tag packet is accidentally being treated as signal indicator packet.
21
+ # phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect
22
+ # to see signal indicator packets from both BRG's, according to the tx params.
23
+ # phase 5 - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicatopr packets.
24
+ # that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
25
+
26
+
8
27
  # Test MACROS #
9
28
  NUM_OF_SCANNING_CYCLE = 5
29
+ DEFAULT_SCAN_TIME = 30
10
30
  SCAN_DELAY_TIME = 3
31
+ BLE5_MAX_DURATION_SEC = ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE // 1000 + 1
11
32
 
12
33
 
13
- def test_ext_adv_rx37(test):
14
-
15
- dut = cert_config.get_brg_by_target(test, DUT)
16
- tester = cert_config.get_brg_by_target(test, TESTER)
17
- cycle, rep = 8, 4
34
+ def test_rssi_threshold(test):
35
+ cycle, rep = 5, 4
36
+ rx_brg_ = test.brg1 # when internal_brg test this is the internal_brg
37
+ tx_brg_ = cert_config.get_brg_by_target(test, DUT)
38
+ rssi_threshold = -25
18
39
 
19
- # Configuring DUT #
20
- # configuring transmitter #
21
- utPrint(f"Configuring DUT BRG {dut.id_str} as Signal Indicator Transmitter (cycle={cycle}, repetition={rep})", "BLUE")
22
- test = cert_config.brg_configure(test=test, module=dut.energy2400,
23
- fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
24
- values=[cycle, rep])[0]
40
+ utPrint(f"TX BRG with RX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
41
+ # configuring receiver #
42
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver with RSSI Threshold of {rssi_threshold}", "BOLD")
43
+ is_ble5 = not test.internal_brg
44
+ test = cert_config.brg_configure(test=test, module=rx_brg_.sensors,
45
+ fields=[BRG_SENSOR0, BRG_RSSI_THRESHOLD],
46
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold],
47
+ ble5=is_ble5, wait=True, target=BRG1)[0]
25
48
  if test.rc == TEST_FAILED:
26
- test.add_reason(f"DUT BRG {dut.id_str}: didn't receive signal indicator transmitter configuration!")
49
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
27
50
  return test
28
- # configuring extended advertising and rx channel #
29
- utPrint(f"Configuring DUT BRG {dut.id_str} with extended advertising and rx channel 37", "BLUE")
30
- test = cert_config.brg_configure(test=test, module=dut.datapath,
31
- fields=[BRG_RX_CHANNEL, BRG_PATTERN],
32
- values=[ag.RX_CHANNEL_37, ag.DATAPATH_PATTERN_EXTENDED_ADV])[0]
51
+ # configuring transmitter #
52
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
53
+ wait = not test.internal_brg
54
+ test = cert_config.brg_configure(test=test, module=tx_brg_.energy2400, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
55
+ values=[cycle, rep], ble5=True, wait=wait)[0]
33
56
  if test.rc == TEST_FAILED:
34
- test.add_reason(f"DUT BRG {dut.id_str}: didn't receive extended advertising and rx channel configuration!")
57
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
35
58
  return test
59
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {cycle},"
60
+ f"repetition = {rep}", "BOLD")
61
+ # phase analysis #
62
+ print_update_wait(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
63
+ cert_mqtt.mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME, "rssi_threshold")
64
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
65
+ for p in received_signal_ind_pkts:
66
+ print(f"rssi value: {p[UNIFIED_SENSOR_PKT].pkt.rssi}")
67
+ rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[UNIFIED_SENSOR_PKT].pkt.rssi >= -1 * rssi_threshold]
68
+ if rssi_threshold_viloation_pkts:
69
+ test.rc = TEST_FAILED
70
+ test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed"
71
+ f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
72
+ return test
73
+
74
+
75
+ def test_brg0_tx_brg1_rx(test):
76
+
77
+ tx_brg_ = cert_config.get_brg_by_target(test, DUT)
78
+ rx_brg_ = test.brg1 # when internal_brg test this is the internal_brg
79
+ cycle, rep = 8, 4
36
80
 
37
- # configuring TESTER #
38
- utPrint(f"Configuring TESTER BRG {tester.id_str} as Signal Indicator Receiver", "BLUE")
39
- test = cert_config.brg_configure(test=test, module=tester.sensors, fields=[BRG_SENSOR0],
40
- values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], target=TESTER)[0]
81
+ utPrint(f"TX BRG with RX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
82
+ # configuring receiver #
83
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
84
+ is_ble5 = not test.internal_brg
85
+ test = cert_config.brg_configure(test=test, module=rx_brg_.sensors,
86
+ fields=[BRG_SENSOR0],
87
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR],
88
+ ble5=is_ble5, wait=True, target=BRG1)[0]
41
89
  if test.rc == TEST_FAILED:
42
- test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive signal indicator receiver configuration!")
90
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
43
91
  return test
44
- utPrint(f"Configuring TESTER BRG {tester.id_str} with rx channel 37", "BLUE")
45
- test = cert_config.brg_configure(test=test, module=tester.datapath, fields=[BRG_RX_CHANNEL],
46
- values=[ag.RX_CHANNEL_37], target=TESTER)[0]
92
+ # configuring transmitter #
93
+ wait = not test.internal_brg
94
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
95
+ test = cert_config.brg_configure(test=test, module=tx_brg_.energy2400,
96
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
97
+ values=[cycle, rep], ble5=True, wait=wait)[0]
47
98
  if test.rc == TEST_FAILED:
48
- test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive rx channel configuration!")
99
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
49
100
  return test
50
-
101
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {cycle},"
102
+ f"repetition = {rep}", "BOLD")
51
103
  # phase analysis #
52
- cert_mqtt.mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME,
53
- f"tx_{cycle}_{rep}")
54
- rec_sig_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tester, tx_brg=dut)
55
- 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):
104
+ print_update_wait(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
105
+ cert_mqtt.mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME, f"brg0_rx_brg1_tx_{cycle}_{rep}")
106
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
107
+
108
+ if cert_common.sig_ind_pkts_fail_analysis(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE, received_signal_ind_pkts):
56
109
  test.rc = TEST_FAILED
57
- expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts2(tester, dut, NUM_OF_SCANNING_CYCLE)
58
- test.add_reason(f"tx phase failed - BRG {dut.id_str} received wrong number of "
59
- f"signal indicator packets\nreceived {len(rec_sig_ind_pkts)} packets, "
110
+ expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts2(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE)
111
+ test.add_reason(f"brg0_rx_brg1_tx phase failed - BRG {rx_brg_.id_str} received wrong number of "
112
+ f"signal indicator packets\nreceived {len(received_signal_ind_pkts)} packets, "
60
113
  f"expected {expected_signal_ind_pkts} packets")
61
- print(rec_sig_ind_pkts) # TODO: logging print(debug)
62
- print([[p[TIMESTAMP], p[UNIFIED_SENSOR_PKT].pkt.signal_indicator_payload.rx_antenna] for p in rec_sig_ind_pkts])
114
+ print(received_signal_ind_pkts) # TODO: logging print(debug)
115
+ print([[p[TIMESTAMP], p[UNIFIED_SENSOR_PKT].pkt.signal_indicator_payload.rx_antenna] for p in received_signal_ind_pkts])
116
+
117
+ test = cert_common.rx_tx_antenna_check(test, received_signal_ind_pkts, tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE)
118
+ test = cert_common.output_power_check(test, received_signal_ind_pkts, tx_brg_)
119
+ test = cert_common.rssi_check(test, received_signal_ind_pkts)
120
+
121
+ return test
122
+
123
+
124
+ def test_brg0_none_brg1_rx(test):
125
+ cycle, rep = ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE, ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP
126
+ tx_brg_ = cert_config.get_brg_by_target(test, DUT)
127
+ rx_brg_ = test.brg1 # when internal_brg test this is the internal_brg
128
+ utPrint(f"RX BRG without TX- cycle = {cycle}, repetition = {rep}\n", "BLUE")
129
+ # configuring receiver #
130
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
131
+ is_ble5 = not test.internal_brg
132
+ test = cert_config.brg_configure(test=test, module=rx_brg_.sensors,
133
+ fields=[BRG_SENSOR0],
134
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR],
135
+ ble5=is_ble5, wait=True, target=BRG1)[0]
136
+ if test.rc == TEST_FAILED:
137
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
63
138
  return test
139
+ utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
64
140
 
65
- test = cert_common.rx_tx_antenna_check(test, rec_sig_ind_pkts, dut, tester, NUM_OF_SCANNING_CYCLE)
66
- test = cert_common.output_power_check(test, rec_sig_ind_pkts, dut)
67
- test = cert_common.rssi_check(test, rec_sig_ind_pkts)
141
+ # phase analysis #
142
+ print_update_wait(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
143
+ cert_mqtt.mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, "brg0_none_brg1_rx")
144
+ expected_signal_ind_pkts = [0]
145
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
146
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
147
+ test.rc = TEST_FAILED
148
+ test.add_reason(f"brg0_rx_brg1_tx phase failed - BRG {rx_brg_.id_str} received wrong number of "
149
+ f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
150
+ f"expected {expected_signal_ind_pkts} packets")
68
151
 
69
152
  return test
70
153
 
71
154
 
72
- def test_ext_adv_rx10(test):
155
+ def test_brg0_rxtx_brg1_rxtx(test):
73
156
 
74
- dut = cert_config.get_brg_by_target(test, DUT)
75
- tester = cert_config.get_brg_by_target(test, TESTER)
76
- cycle, rep = 8, 4
157
+ if test.internal_brg:
158
+ # Can't scan on ble5 with internal brg because config won't be received
159
+ test.add_reason("skip for internal BRG")
160
+ test.rc = TEST_SKIPPED
161
+ return test
77
162
 
78
- # Configuring DUT #
79
- # configuring transmitter #
80
- utPrint(f"Configuring DUT BRG {dut.id_str} as Signal Indicator Transmitter (cycle={cycle}, repetition={rep})", "BLUE")
81
- test = cert_config.brg_configure(test=test, module=dut.energy2400,
82
- fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
83
- values=[cycle, rep])[0]
84
- if test.rc == TEST_FAILED:
85
- test.add_reason(f"DUT BRG {dut.id_str}: didn't receive signal indicator transmitter configuration!")
163
+ tx_cycle, tx_rep = 5, 4
164
+ rx_cycle, rx_rep = 5, 4
165
+ tx_brg_ = cert_config.get_brg_by_target(test, DUT)
166
+ rx_brg_ = test.brg1
167
+ utPrint("Both BRG's are transmitter and receivers, with different values\n", "BLUE")
168
+ # configuring first brg (tx_brg_) as receiver
169
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
170
+ test = cert_config.brg_configure(test=test, module=tx_brg_.sensors, fields=[BRG_SENSOR0],
171
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], ble5=True)[0]
172
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
173
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
86
174
  return test
87
- # configuring extended advertising and rx channel #
88
- utPrint(f"Configuring DUT BRG {dut.id_str} with extended advertising and rx channel 10", "BLUE")
89
- test = cert_config.brg_configure(test=test, module=dut.datapath,
90
- fields=[BRG_RX_CHANNEL, BRG_PATTERN],
91
- values=[ag.RX_CHANNEL_10_500K, ag.DATAPATH_PATTERN_EXTENDED_ADV],
92
- ble5=test.dut_is_bridge(), wait=test.dut_is_combo())[0]
93
- if test.rc == TEST_FAILED:
94
- test.add_reason(f"DUT BRG {dut.id_str}: didn't receive extended advertising and rx channel configuration!")
175
+ utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
176
+ # configuring first brg (tx_brg_) as transmitter
177
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
178
+ test = cert_config.brg_configure(test=test, module=tx_brg_.energy2400, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
179
+ values=[tx_cycle, tx_rep], ble5=True)[0]
180
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
181
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
95
182
  return test
96
- if test.dut_is_bridge():
97
- wait_time_n_print(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
183
+ utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle={tx_cycle}, repetition={tx_rep}", "BOLD")
98
184
 
99
- # configuring TESTER #
100
- utPrint(f"Configuring TESTER BRG {tester.id_str} as Signal Indicator Receiver", "BLUE")
101
- test = cert_config.brg_configure(test=test, module=tester.sensors, fields=[BRG_SENSOR0],
102
- values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], target=TESTER)[0]
103
- if test.rc == TEST_FAILED:
104
- test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive signal indicator receiver configuration!")
185
+ # configuring second brg (rx_brg_) as receiver
186
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
187
+ test = cert_config.brg_configure(test=test, module=rx_brg_.sensors,
188
+ fields=[BRG_SENSOR0],
189
+ values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR],
190
+ ble5=True, target=BRG1)[0]
191
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
192
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
105
193
  return test
106
- utPrint(f"Configuring TESTER BRG {tester.id_str} with rx channel 10", "BLUE")
107
- test = cert_config.brg_configure(test=test, module=tester.datapath, fields=[BRG_RX_CHANNEL],
108
- values=[ag.RX_CHANNEL_10_500K], target=TESTER)[0]
109
- if test.rc == TEST_FAILED:
110
- test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive rx channel configuration!")
194
+ utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
195
+
196
+ # configuring second brg (rx_brg_) as transmitter (already configured as rx)
197
+ utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
198
+ test = cert_config.brg_configure(test=test, module=rx_brg_.energy2400,
199
+ fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
200
+ values=[rx_cycle, rx_rep],
201
+ ble5=True, target=BRG1)[0]
202
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
203
+ test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
111
204
  return test
205
+ utPrint(f"BRG {rx_brg_.id_str} configured to be transmitter - cycle={rx_cycle}, repetition={rx_rep}")
112
206
 
113
207
  # phase analysis #
114
- cert_mqtt.mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME,
115
- f"tx_{cycle}_{rep}")
116
- rec_sig_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tester, tx_brg=dut)
117
- 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):
208
+ print_update_wait(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
209
+ cert_mqtt.mqtt_scan_n_create_log_file(test, NUM_OF_SCANNING_CYCLE * max(tx_cycle, rx_cycle) + SCAN_DELAY_TIME, "brg0_rxtx_brg1_rxtx")
210
+
211
+ # Analyzing tx_brg_ performance as receiver
212
+ utPrint(f"Analyzing tx_brg {tx_brg_.id_str} performance as a Receiver\n", "BOLD")
213
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
214
+ if cert_common.sig_ind_pkts_fail_analysis(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE, received_signal_ind_pkts):
215
+ test.rc = TEST_FAILED
216
+ expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts2(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE)
217
+ test.add_reason(f"brg0_rxtx_brg1_rxtx phase failed - BRG {tx_brg_.id_str} received wrong number of "
218
+ f"signal indicator packets\nreceived {len(received_signal_ind_pkts)} packets, "
219
+ f"expected {expected_signal_ind_pkts} packets")
220
+ print(received_signal_ind_pkts) # TODO: logging print(debug)
221
+
222
+ # Analyzing rx_brg_ performance as receiver
223
+ utPrint(f"Analyzing rx_brg {rx_brg_.id_str} performance as a Receiver\n", "BOLD")
224
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
225
+ if cert_common.sig_ind_pkts_fail_analysis(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE, received_signal_ind_pkts):
118
226
  test.rc = TEST_FAILED
119
- expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts2(tester, dut, NUM_OF_SCANNING_CYCLE)
120
- test.add_reason(f"tx phase failed - BRG {dut.id_str} received wrong number of "
121
- f"signal indicator packets\nreceived {len(rec_sig_ind_pkts)} packets, "
227
+ expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts2(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE)
228
+ test.add_reason(f"brg0_rxtx_brg1_rxtx phase failed - BRG {rx_brg_.id_str} received wrong number of "
229
+ f"signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
122
230
  f"expected {expected_signal_ind_pkts} packets")
123
- print(rec_sig_ind_pkts) # TODO: logging print(debug)
124
- print([[p[TIMESTAMP], p[UNIFIED_SENSOR_PKT].pkt.signal_indicator_payload.rx_antenna] for p in rec_sig_ind_pkts])
231
+ print(received_signal_ind_pkts) # TODO: logging print(debug)
232
+ # NOTE: We skipped the antenna and output power checks for this phase
233
+ return test
234
+
235
+
236
+ def test_brg0_tx_brg1_none(test):
237
+ # Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
238
+ # The receiver isn't receiving any signal indicator packets.
239
+ cycle, rep = 4, 3
240
+ tx_brg_ = cert_config.get_brg_by_target(test, DUT)
241
+ rx_brg_ = test.brg1 # when internal_brg test this is the internal_brg
242
+ utPrint(f"TX BRG without RX - cycle = {cycle}, repetition = {rep}\n", "BLUE")
243
+ # configuring transmitter #
244
+ utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
245
+ wait = not test.internal_brg
246
+ test = cert_config.brg_configure(test=test, module=tx_brg_.energy2400, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
247
+ values=[cycle, rep], ble5=True, wait=wait)[0]
248
+ if test.rc == TEST_FAILED:
249
+ test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
125
250
  return test
126
251
 
127
- test = cert_common.rx_tx_antenna_check(test, rec_sig_ind_pkts, dut, tester, NUM_OF_SCANNING_CYCLE)
128
- test = cert_common.output_power_check(test, rec_sig_ind_pkts, dut)
129
- test = cert_common.rssi_check(test, rec_sig_ind_pkts)
252
+ # phase analysis #
253
+ print_update_wait(BLE5_MAX_DURATION_SEC) # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC
254
+ cert_mqtt.mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * cycle) + SCAN_DELAY_TIME, "brg0_tx_brg1_none")
255
+ expected_signal_ind_pkts = [0]
256
+ received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
257
+ if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
258
+ test.rc = TEST_FAILED
259
+ test.add_reason(f"brg0_tx_brg1_none phase failed - received signal indicator packet from BRG"
260
+ f"{rx_brg_.id_str}")
261
+ test = cert_common.output_power_check(test, received_signal_ind_pkts, tx_brg_)
130
262
 
131
263
  return test
132
264
 
133
265
 
134
- SIGNAL_INDICATOR_TEST_MAP = {"ext_adv_rx37": test_ext_adv_rx37, "ext_adv_rx10": test_ext_adv_rx10}
266
+ SIGNAL_INDICATOR_TEST_MAP = {"rssi_threshold": test_rssi_threshold, "brg0_tx_brg1_rx": test_brg0_tx_brg1_rx,
267
+ "brg0_none_brg1_rx": test_brg0_none_brg1_rx, "brg0_rxtx_brg1_rxtx": test_brg0_rxtx_brg1_rxtx,
268
+ "brg0_tx_brg1_none": test_brg0_tx_brg1_none}
135
269
 
136
270
 
137
271
  def run(test):
138
272
  # Test prolog
139
273
  test = cert_common.test_prolog(test)
140
274
 
141
- # Configure to rx channel and extended advertising pattern
142
- dut = cert_config.get_brg_by_target(test, DUT)
143
- tester = cert_config.get_brg_by_target(test, TESTER)
144
-
145
- for param in test.params:
146
- phase_run_print(param.name)
147
- test = SIGNAL_INDICATOR_TEST_MAP[param.value](test)
148
- cert_mqtt.generate_log_file(test, param.name)
149
- field_functionality_pass_fail_print(test, param.name)
150
- test.set_phase_rc(param.name, test.rc)
151
- test.add_phase_reason(param.name, test.reason)
275
+ for rx_channel in [ag.RX_CHANNEL_10_500K, ag.RX_CHANNEL_37]:
152
276
 
277
+ # Configure to rx channel and extended advertising pattern
278
+ brg_dut = cert_config.get_brg_by_target(test, DUT)
279
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL, BRG_PATTERN],
280
+ values=[rx_channel, ag.DATAPATH_PATTERN_EXTENDED_ADV],
281
+ module=brg_dut.datapath, ble5=True)[0]
282
+ if test.rc == TEST_FAILED:
283
+ return cert_common.test_epilog(test, revert_brgs=True,
284
+ modules=[brg_dut.datapath], ble5=True)
285
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL, BRG_PATTERN],
286
+ values=[rx_channel, ag.DATAPATH_PATTERN_EXTENDED_ADV],
287
+ module=test.brg1.datapath, target=BRG1)[0]
153
288
  if test.rc == TEST_FAILED:
289
+ return cert_common.test_epilog(test, revert_brgs=True,
290
+ modules=[brg_dut.datapath],
291
+ brg1_modules=[test.brg1.datapath], ble5=True)
292
+
293
+ for param in test.params:
294
+ phase_run_print(param.name)
295
+ test = SIGNAL_INDICATOR_TEST_MAP[param.value](test)
296
+ cert_mqtt.generate_log_file(test, param.name)
297
+ field_functionality_pass_fail_print(test, param.name)
154
298
  test.set_phase_rc(param.name, test.rc)
155
299
  test.add_phase_reason(param.name, test.reason)
156
- if test.exit_on_param_failure:
300
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
157
301
  break
158
- else:
159
- test.reset_result()
160
-
161
- # Revert DUT and TESTER to defaults here and not in epilog
162
- test = cert_config.config_brg_defaults(test, modules=[dut.datapath, dut.energy2400],
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
166
- if test.rc == TEST_FAILED:
167
- test.add_reason("Failed to revert dut to defaults")
168
- else:
169
- test = cert_config.config_brg_defaults(test, modules=[tester.datapath, tester.sensors], target=TESTER)[0]
170
- if test.rc == TEST_FAILED:
171
- test.add_reason("Failed to revert tester to defaults")
302
+ else:
303
+ test.reset_result()
304
+
305
+ # Reset to defaults after every phase (don't fail the phase on that)
306
+ brg_dut = cert_config.get_brg_by_target(test, DUT)
307
+ test = cert_config.config_brg_defaults(test,
308
+ modules=[brg_dut.energy2400, brg_dut.sensors],
309
+ ble5=True, wait=False)[0]
310
+ # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC, we configured 2 modules here
311
+ print_update_wait(2 * BLE5_MAX_DURATION_SEC)
312
+ if test.rc == TEST_FAILED:
313
+ test.add_reason("Failed to restore brg0 to defaults")
314
+ else:
315
+ test = cert_config.config_brg_defaults(test, modules=[test.brg1.energy2400, test.brg1.sensors], ble5=True, target=BRG1)[0]
316
+ # BLE5 configuration can take up to BLE5_MAX_DURATION_SEC, we configured 2 modules here
317
+ print_update_wait(2 * BLE5_MAX_DURATION_SEC)
318
+ if test.rc == TEST_FAILED:
319
+ test.add_reason("Failed to restore brg0 to defaults")
320
+ if test.rc == TEST_FAILED:
321
+ test.set_phase_rc(param.name, test.rc)
322
+ test.add_phase_reason(param.name, test.reason)
323
+ if test.exit_on_param_failure:
324
+ break
325
+ else:
326
+ test.reset_result()
172
327
 
173
- return cert_common.test_epilog(test, revert_brgs=False)
328
+ brg_dut = cert_config.get_brg_by_target(test, DUT)
329
+ return cert_common.test_epilog(test, revert_brgs=True,
330
+ modules=[brg_dut.datapath],
331
+ brg1_modules=[test.brg1.datapath], ble5=True)
@@ -19,6 +19,5 @@
19
19
  "multiBridgeTest": 1,
20
20
  "gwOnlyTest": 0,
21
21
  "dataSimOnlyTest": 0,
22
- "SupportedFromApiVersion": 13,
23
22
  "allSupportedValues": ["rssi_threshold", "rx", "tx_eu_pattern", "disable_tx", "disable_rx", "rx_tx"]
24
23
  }
@@ -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 {dut.id_str} performance as a Transmitter\n", "BOLD")
291
+ utPrint(f"Analyzing DUT {tester.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
@@ -12,6 +12,5 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 0,
15
- "SupportedFromApiVersion": 12,
16
15
  "allSupportedValues": [15, 20, 40, 0]
17
16
  }
@@ -12,7 +12,6 @@
12
12
  "multiBridgeTest": 0,
13
13
  "gwOnlyTest": 0,
14
14
  "dataSimOnlyTest": 0,
15
- "SupportedFromApiVersion": 12,
16
15
  "allSupportedValues": ["SUB1G_ENERGY_PATTERN_NO_ENERGIZING", "SUB1G_ENERGY_PATTERN_SINGLE_TONE_915000",
17
16
  "SUB1G_ENERGY_PATTERN_FCC_HOPPING", "SUB1G_ENERGY_PATTERN_JAPAN_1W",
18
17
  "SUB1G_ENERGY_PATTERN_JAPAN_350MW", "SUB1G_ENERGY_PATTERN_KOREA",
@@ -14,6 +14,5 @@
14
14
  "multiBridgeTest": 0,
15
15
  "gwOnlyTest": 0,
16
16
  "dataSimOnlyTest": 0,
17
- "SupportedFromApiVersion": 12,
18
17
  "allSupportedValues": []
19
18
  }
@@ -17,6 +17,5 @@
17
17
  "multiBridgeTest": 0,
18
18
  "gwOnlyTest": 0,
19
19
  "dataSimOnlyTest": 1,
20
- "SupportedFromApiVersion": 13,
21
20
  "allSupportedValues": ["tag_data_only", "rssi_threshold", "snsr2_unified", "snsr0_no_scrmbl", "snsr1_scrmbl", "snsr0_no_scrmbl_snsr1_scrmbl_snsr2_scrmbl", "snsr0_no_scrmbl_snsr1_scrmbl_snsr2_unified"]
22
21
  }
@@ -413,14 +413,19 @@ EXT_SENSOR_TEST_MAP = {"tag_data_only": test_tag_data_only,
413
413
 
414
414
 
415
415
  def run(test):
416
-
416
+ datapath_module = test.active_brg.datapath
417
+ ext_sensors_module = test.active_brg.sensors
417
418
  test = cert_common.test_prolog(test)
418
419
  # check for problems in prolog
419
420
  if test.rc == TEST_FAILED:
420
421
  test = cert_common.test_epilog(test)
421
422
  return test
422
423
 
423
- dut = cert_config.get_brg_by_target(test, DUT)
424
+ # Adaptation of GW configuration for internal BRG test
425
+ if test.internal_brg:
426
+ test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_37], module=datapath_module, wait=True)[0]
427
+ if test.rc == TEST_FAILED and test.exit_on_param_failure:
428
+ return cert_common.test_epilog(test, revert_gws=True)
424
429
 
425
430
  # create csv file for the test
426
431
  in_pkts = create_csv_file_in(test)
@@ -434,7 +439,7 @@ def run(test):
434
439
 
435
440
  for param in test.params:
436
441
  phase_run_print(param.name)
437
- test = EXT_SENSOR_TEST_MAP[param.value](test, param.name, dut.sensors)
442
+ test = EXT_SENSOR_TEST_MAP[param.value](test, param.name, ext_sensors_module)
438
443
  field_functionality_pass_fail_print(test, param.name)
439
444
  test.set_phase_rc(param.name, test.rc)
440
445
  test.add_phase_reason(param.name, test.reason)
@@ -447,4 +452,4 @@ def run(test):
447
452
  if test.data == DATA_SIMULATION:
448
453
  ble_sim_thread.stop()
449
454
 
450
- return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.sensors, dut.datapath])
455
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[ext_sensors_module, datapath_module])
@@ -23,13 +23,7 @@ def api_validation(test):
23
23
  utPrint("API validation is skipped for protobuf messages", "WARNING")
24
24
  api_validation_phase.rc = TEST_SKIPPED
25
25
  api_validation_phase.reason = "API validation is skipped for protobuf messages"
26
- test.add_phase(api_validation_phase)
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)
26
+ test.phases[-1:-1] = [api_validation_phase]
33
27
  return test
34
28
  else:
35
29
  def validate_message(message: dict, msg_type=MESSAGE_TYPES.DATA.value) -> tuple[bool, str]:
@@ -87,5 +81,5 @@ def api_validation(test):
87
81
  api_validation_phase.rc = TEST_FAILED
88
82
  api_validation_phase.reason = "API (JSON strcture) is invalid"
89
83
  field_functionality_pass_fail_print(api_validation_phase, API_VALIDATION)
90
- test.add_phase(api_validation_phase)
84
+ test.phases[-1:-1] = [api_validation_phase]
91
85
  return test