wiliot-certificate 4.5.0a1__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.
- certificate/cert_common.py +14 -15
- certificate/cert_config.py +3 -3
- certificate/cert_defines.py +1 -0
- certificate/cert_gw_sim.py +3 -0
- certificate/cert_results.py +8 -0
- certificate/cert_utils.py +3 -0
- certificate/certificate_eth_test_list.txt +5 -3
- certificate/certificate_sanity_test_list.txt +3 -2
- certificate/certificate_test_list.txt +4 -3
- certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +1 -1
- certificate/tests/cloud_connectivity/acl_test/acl_test.json +1 -1
- certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +1 -1
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +14 -0
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +85 -0
- certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +1 -4
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +1 -1
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +10 -9
- certificate/tests/cloud_connectivity/stress_test/stress_test.json +1 -1
- certificate/tests/cloud_connectivity/stress_test/stress_test.py +10 -10
- certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +1 -0
- certificate/tests/datapath/event_ble5_test/event_ble5_test.py +6 -4
- certificate/tests/datapath/event_test/event_test.py +4 -3
- certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +1 -1
- certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
- certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.py +5 -5
- certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +5 -5
- certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +10 -8
- certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -1
- certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +1 -2
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +8 -9
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +110 -270
- certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +4 -9
- common/api_if/api_validation.py +2 -2
- common/web/templates/generator.html +141 -79
- common/web/web_utils.py +78 -56
- gui_certificate/server.py +111 -19
- gui_certificate/templates/cert_run.html +43 -6
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/METADATA +35 -36
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/RECORD +43 -41
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/WHEEL +0 -0
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-4.5.0a1.dist-info → wiliot_certificate-4.5.0a3.dist-info}/top_level.txt +0 -0
|
@@ -12,15 +12,16 @@ PKT_FILTER_TEST_PACER_INTERVAL = 4
|
|
|
12
12
|
def run(test):
|
|
13
13
|
|
|
14
14
|
fields = [BRG_PKT_FILTER, BRG_RX_CHANNEL, BRG_PACER_INTERVAL, BRG_PATTERN]
|
|
15
|
-
|
|
15
|
+
dut = cert_config.get_brg_by_target(test, DUT)
|
|
16
16
|
|
|
17
17
|
test = cert_common.test_prolog(test)
|
|
18
18
|
if test.rc == TEST_FAILED:
|
|
19
19
|
return cert_common.test_epilog(test)
|
|
20
20
|
|
|
21
|
-
test = cert_config.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
test = cert_config.brg_configure(test, fields=fields,
|
|
22
|
+
values=[PKT_FILTER_TEMP_AND_ADVANCED_PKTS, RX_CHANNEL_10_500K,
|
|
23
|
+
PKT_FILTER_TEST_PACER_INTERVAL, DATAPATH_PATTERN_EXTENDED_ADV],
|
|
24
|
+
module=dut.datapath, ble5=test.dut_is_bridge())[0]
|
|
24
25
|
if test.rc == TEST_FAILED:
|
|
25
26
|
return cert_common.test_epilog(test)
|
|
26
27
|
|
|
@@ -41,9 +42,10 @@ def run(test):
|
|
|
41
42
|
|
|
42
43
|
# Configure the BRG to DATAPATH_PATTERN_EXTENDED_ADV_CH_10 if the GW listens to channel 10
|
|
43
44
|
if param.value == RX_CHANNEL_10_500K:
|
|
44
|
-
test = cert_config.
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
test = cert_config.brg_configure(test, fields=fields,
|
|
46
|
+
values=[PKT_FILTER_TEMP_AND_ADVANCED_PKTS, RX_CHANNEL_10_500K,
|
|
47
|
+
PKT_FILTER_TEST_PACER_INTERVAL, DATAPATH_PATTERN_EXTENDED_ADV_CH_10],
|
|
48
|
+
module=dut.datapath, ble5=test.dut_is_bridge())[0]
|
|
47
49
|
if test.rc == TEST_FAILED:
|
|
48
50
|
if test.exit_on_param_failure:
|
|
49
51
|
break # break the whole for loop and keep the test as failed
|
|
@@ -80,4 +82,4 @@ def run(test):
|
|
|
80
82
|
# Revert tester's rx channel
|
|
81
83
|
test = cert_config.brg_configure(test, module=test.tester.internal_brg.datapath, target=TESTER)[0]
|
|
82
84
|
|
|
83
|
-
return cert_common.test_epilog(test, revert_brgs=True, modules=[
|
|
85
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.datapath], ble5=test.dut_is_bridge())
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "RSSI Threshold",
|
|
3
3
|
"module": "Datapath",
|
|
4
4
|
"purpose": "Test RSSI threshold configuration and functionality in the bridge",
|
|
5
|
-
"documentation": "
|
|
5
|
+
"documentation": "",
|
|
6
6
|
"initialCondition": "Bridge configured to defaults",
|
|
7
7
|
"procedure": ["Test prolog",
|
|
8
8
|
"RSSI Threshold configuration",
|
|
@@ -28,7 +28,6 @@ import certificate.cert_config as cert_config
|
|
|
28
28
|
NUM_OF_SCANNING_CYCLE = 5
|
|
29
29
|
DEFAULT_SCAN_TIME = 30
|
|
30
30
|
SCAN_DELAY_TIME = 3
|
|
31
|
-
BLE5_MAX_DURATION_SEC = ag.BLE5_PARAM_PRIMARY_CHANNEL_SCAN_CYCLE // 1000 + 1
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
def test_rssi_threshold(test):
|
|
@@ -366,7 +365,7 @@ def run(test):
|
|
|
366
365
|
else:
|
|
367
366
|
test.reset_result()
|
|
368
367
|
|
|
369
|
-
# Revert DUT to defaults here and not in epilog
|
|
368
|
+
# Revert DUT and TESTER to defaults here and not in epilog
|
|
370
369
|
test = cert_config.config_brg_defaults(test, modules=[dut.datapath], ble5=test.dut_is_bridge(), wait=test.dut_is_combo())[0]
|
|
371
370
|
if test.rc == TEST_FAILED:
|
|
372
371
|
test.add_reason("Failed to revert brg0 datapath to defaults")
|
certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Signal Indicator Extended Advertising",
|
|
3
3
|
"module": "Energizer 2.4GHz",
|
|
4
|
-
"purpose": "
|
|
4
|
+
"purpose": "Verify Signal Indicator functionality when using bridge with extended advertising pattern",
|
|
5
5
|
"documentation": "https://community.wiliot.com/customers/s/article/Bridge-to-Bridge-Signal-Indicator",
|
|
6
6
|
"initialCondition": "Bridge configured to defaults",
|
|
7
|
-
"procedure": [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"Test epilog"],
|
|
7
|
+
"procedure": [
|
|
8
|
+
"Test prolog - Initialize test environment and configure bridges to defaults",
|
|
9
|
+
"ext_adv_rx37 - Configure DUT as Transmitter with extended advertising pattern and RX channel 37, and TESTER as Receiver and Analyze received signal indicator packets count, RX/TX antenna, output power, and RSSI values",
|
|
10
|
+
"ext_adv_rx10 - Configure DUT as Transmitter with extended advertising pattern and RX channel 10, and TESTER as Receiver and Analyze received signal indicator packets count, RX/TX antenna, output power, and RSSI values",
|
|
11
|
+
"Test epilog - Finalize test results and log outcomes"
|
|
12
|
+
],
|
|
14
13
|
"expectedOutcome": "All phases passed successfully!",
|
|
15
14
|
"mandatory": 0,
|
|
16
15
|
"multiBridgeTest": 1,
|
|
17
16
|
"gwOnlyTest": 0,
|
|
18
17
|
"dataSimOnlyTest": 0,
|
|
19
|
-
"allSupportedValues": ["
|
|
18
|
+
"allSupportedValues": ["ext_adv_rx37", "ext_adv_rx10"]
|
|
20
19
|
}
|
|
@@ -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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
# configuring
|
|
42
|
-
utPrint(f"Configuring BRG {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 {
|
|
26
|
+
test.add_reason(f"DUT BRG {dut.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
50
27
|
return test
|
|
51
|
-
# configuring
|
|
52
|
-
utPrint(f"Configuring BRG {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
values=[
|
|
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 {
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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 {
|
|
42
|
+
test.add_reason(f"TESTER BRG {tester.id_str}: didn't receive signal indicator receiver configuration!")
|
|
91
43
|
return test
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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 {
|
|
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
|
-
|
|
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(
|
|
111
|
-
test.add_reason(f"
|
|
112
|
-
f"signal indicator packets\nreceived {len(
|
|
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(
|
|
115
|
-
print([[p[TIMESTAMP], p[UNIFIED_SENSOR_PKT].pkt.signal_indicator_payload.rx_antenna] for p in
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
|
72
|
+
def test_ext_adv_rx10(test):
|
|
156
73
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
values=[
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
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
|
|
186
|
-
utPrint(f"Configuring BRG {
|
|
187
|
-
test = cert_config.brg_configure(test=test, module=
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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 {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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(
|
|
228
|
-
test.add_reason(f"
|
|
229
|
-
f"signal indicator 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(
|
|
232
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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 = {"
|
|
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
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
test =
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
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.
|
|
156
|
+
if test.exit_on_param_failure:
|
|
301
157
|
break
|
|
302
|
-
|
|
303
|
-
|
|
158
|
+
else:
|
|
159
|
+
test.reset_result()
|
|
304
160
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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=[
|
|
450
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[dut.sensors, dut.datapath])
|
common/api_if/api_validation.py
CHANGED
|
@@ -23,7 +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.
|
|
26
|
+
test.add_phase(api_validation_phase)
|
|
27
27
|
return test
|
|
28
28
|
else:
|
|
29
29
|
def validate_message(message: dict, msg_type=MESSAGE_TYPES.DATA.value) -> tuple[bool, str]:
|
|
@@ -81,5 +81,5 @@ def api_validation(test):
|
|
|
81
81
|
api_validation_phase.rc = TEST_FAILED
|
|
82
82
|
api_validation_phase.reason = "API (JSON strcture) is invalid"
|
|
83
83
|
field_functionality_pass_fail_print(api_validation_phase, API_VALIDATION)
|
|
84
|
-
test.
|
|
84
|
+
test.add_phase(api_validation_phase)
|
|
85
85
|
return test
|