wiliot-certificate 4.5.0a2__py3-none-any.whl → 4.5.0a3__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 (26) hide show
  1. certificate/cert_common.py +2 -2
  2. certificate/cert_config.py +3 -3
  3. certificate/certificate_eth_test_list.txt +3 -2
  4. certificate/certificate_sanity_test_list.txt +3 -2
  5. certificate/certificate_test_list.txt +3 -3
  6. certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +1 -4
  7. certificate/tests/datapath/event_ble5_test/event_ble5_test.py +6 -4
  8. certificate/tests/datapath/event_test/event_test.py +4 -3
  9. certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
  10. certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +5 -5
  11. certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +5 -5
  12. certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +10 -8
  13. certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +1 -2
  14. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +8 -9
  15. certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +110 -270
  16. certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +4 -9
  17. common/web/templates/generator.html +141 -79
  18. common/web/web_utils.py +78 -56
  19. gui_certificate/server.py +111 -19
  20. gui_certificate/templates/cert_run.html +43 -6
  21. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/METADATA +4 -9
  22. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/RECORD +26 -26
  23. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/WHEEL +0 -0
  24. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/entry_points.txt +0 -0
  25. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/licenses/LICENSE +0 -0
  26. {wiliot_certificate-4.5.0a2.dist-info → wiliot_certificate-4.5.0a3.dist-info}/top_level.txt +0 -0
@@ -5,327 +5,167 @@ 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
-
27
8
  # Test MACROS #
28
9
  NUM_OF_SCANNING_CYCLE = 5
29
- DEFAULT_SCAN_TIME = 30
30
10
  SCAN_DELAY_TIME = 3
31
- BLE5_MAX_DURATION_SEC = ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE // 1000 + 1
32
11
 
33
12
 
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
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
39
18
 
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]
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]
48
25
  if test.rc == TEST_FAILED:
49
- test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
26
+ test.add_reason(f"DUT BRG {dut.id_str}: didn't receive signal indicator transmitter configuration!")
50
27
  return test
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]
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]
56
33
  if test.rc == TEST_FAILED:
57
- test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
34
+ test.add_reason(f"DUT BRG {dut.id_str}: didn't receive extended advertising and rx channel configuration!")
58
35
  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
80
36
 
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]
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]
89
41
  if test.rc == TEST_FAILED:
90
- test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
42
+ test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive signal indicator receiver configuration!")
91
43
  return test
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]
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]
98
47
  if test.rc == TEST_FAILED:
99
- test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
48
+ test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive rx channel configuration!")
100
49
  return test
101
- utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {cycle},"
102
- f"repetition = {rep}", "BOLD")
103
- # phase analysis #
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
50
 
108
- if cert_common.sig_ind_pkts_fail_analysis(tx_brg_, rx_brg_, NUM_OF_SCANNING_CYCLE, received_signal_ind_pkts):
51
+ # 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):
109
56
  test.rc = TEST_FAILED
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, "
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, "
113
60
  f"expected {expected_signal_ind_pkts} packets")
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!")
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])
138
63
  return test
139
- utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
140
64
 
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")
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)
151
68
 
152
69
  return test
153
70
 
154
71
 
155
- def test_brg0_rxtx_brg1_rxtx(test):
72
+ def test_ext_adv_rx10(test):
156
73
 
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
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
162
77
 
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!")
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!")
174
86
  return test
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!")
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!")
182
95
  return test
183
- utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle={tx_cycle}, repetition={tx_rep}", "BOLD")
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
184
98
 
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!")
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!")
193
105
  return test
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!")
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!")
204
111
  return test
205
- utPrint(f"BRG {rx_brg_.id_str} configured to be transmitter - cycle={rx_cycle}, repetition={rx_rep}")
206
112
 
207
113
  # phase analysis #
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):
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):
226
118
  test.rc = TEST_FAILED
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, "
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, "
230
122
  f"expected {expected_signal_ind_pkts} packets")
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!")
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])
250
125
  return test
251
126
 
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_)
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)
262
130
 
263
131
  return test
264
132
 
265
133
 
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}
134
+ SIGNAL_INDICATOR_TEST_MAP = {"ext_adv_rx37": test_ext_adv_rx37, "ext_adv_rx10": test_ext_adv_rx10}
269
135
 
270
136
 
271
137
  def run(test):
272
138
  # Test prolog
273
139
  test = cert_common.test_prolog(test)
274
140
 
275
- for rx_channel in [ag.RX_CHANNEL_10_500K, ag.RX_CHANNEL_37]:
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)
276
144
 
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]
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)
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)
292
152
 
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)
153
+ if test.rc == TEST_FAILED:
298
154
  test.set_phase_rc(param.name, test.rc)
299
155
  test.add_phase_reason(param.name, test.reason)
300
- if test.rc == TEST_FAILED and test.exit_on_param_failure:
156
+ if test.exit_on_param_failure:
301
157
  break
302
- else:
303
- test.reset_result()
158
+ else:
159
+ test.reset_result()
304
160
 
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()
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.rc == TEST_FAILED:
165
+ test.add_reason("Failed to revert dut to defaults")
166
+ else:
167
+ test = cert_config.config_brg_defaults(test, modules=[tester.datapath, tester.sensors], target=TESTER)[0]
168
+ if test.rc == TEST_FAILED:
169
+ test.add_reason("Failed to revert tester to defaults")
327
170
 
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)
171
+ return cert_common.test_epilog(test, revert_brgs=False)
@@ -413,19 +413,14 @@ EXT_SENSOR_TEST_MAP = {"tag_data_only": test_tag_data_only,
413
413
 
414
414
 
415
415
  def run(test):
416
- datapath_module = test.active_brg.datapath
417
- ext_sensors_module = test.active_brg.sensors
416
+
418
417
  test = cert_common.test_prolog(test)
419
418
  # check for problems in prolog
420
419
  if test.rc == TEST_FAILED:
421
420
  test = cert_common.test_epilog(test)
422
421
  return test
423
422
 
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)
423
+ dut = cert_config.get_brg_by_target(test, DUT)
429
424
 
430
425
  # create csv file for the test
431
426
  in_pkts = create_csv_file_in(test)
@@ -439,7 +434,7 @@ def run(test):
439
434
 
440
435
  for param in test.params:
441
436
  phase_run_print(param.name)
442
- test = EXT_SENSOR_TEST_MAP[param.value](test, param.name, ext_sensors_module)
437
+ test = EXT_SENSOR_TEST_MAP[param.value](test, param.name, dut.sensors)
443
438
  field_functionality_pass_fail_print(test, param.name)
444
439
  test.set_phase_rc(param.name, test.rc)
445
440
  test.add_phase_reason(param.name, test.reason)
@@ -452,4 +447,4 @@ def run(test):
452
447
  if test.data == DATA_SIMULATION:
453
448
  ble_sim_thread.stop()
454
449
 
455
- return cert_common.test_epilog(test, revert_brgs=True, modules=[ext_sensors_module, datapath_module])
450
+ return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.sensors, dut.datapath])