wiliot-certificate 1.5.0a1__py3-none-any.whl → 1.5.2a1__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.
- brg_certificate/ag/energous_v0_defines.py +17 -17
- brg_certificate/ag/energous_v1_defines.py +17 -17
- brg_certificate/ag/energous_v2_defines.py +17 -17
- brg_certificate/ag/energous_v3_defines.py +17 -17
- brg_certificate/ag/energous_v4_defines.py +17 -17
- brg_certificate/ag/fanstel_lan_v0_defines.py +17 -17
- brg_certificate/ag/fanstel_lte_v0_defines.py +17 -17
- brg_certificate/ag/fanstel_wifi_v0_defines.py +17 -17
- brg_certificate/ag/minew_lte_v0_defines.py +17 -17
- brg_certificate/ag/wlt_cmd_if.html +3 -2
- brg_certificate/ag/wlt_types.html +0 -1
- brg_certificate/ag/wlt_types_ag.py +151 -152
- brg_certificate/brg_certificate.py +38 -7
- brg_certificate/brg_certificate_cli.py +19 -3
- brg_certificate/cert_common.py +92 -55
- brg_certificate/cert_config.py +6 -4
- brg_certificate/cert_data_sim.py +47 -7
- brg_certificate/cert_defines.py +20 -6
- brg_certificate/cert_gw_sim.py +10 -6
- brg_certificate/cert_mqtt.py +9 -6
- brg_certificate/cert_prints.py +14 -1
- brg_certificate/cert_protobuf.py +7 -7
- brg_certificate/cert_results.py +131 -84
- brg_certificate/cert_utils.py +13 -7
- brg_certificate/certificate_bcc_sanity_test_list.txt +40 -0
- brg_certificate/certificate_bcc_test_list.txt +50 -0
- brg_certificate/certificate_sanity_test_list.txt +12 -5
- brg_certificate/certificate_test_list.txt +16 -6
- brg_certificate/tests/calibration/interval_test/interval_test.json +4 -3
- brg_certificate/tests/calibration/output_power_test/output_power_test.json +8 -5
- brg_certificate/tests/calibration/pattern_test/pattern_test.json +7 -4
- brg_certificate/tests/calibration/pattern_test/pattern_test.py +25 -26
- brg_certificate/tests/datapath/aging_test/aging_test.json +19 -0
- brg_certificate/tests/datapath/aging_test/aging_test.py +142 -0
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +10 -5
- brg_certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +12 -11
- brg_certificate/tests/datapath/output_power_test/output_power_test.json +7 -4
- brg_certificate/tests/datapath/output_power_test/output_power_test.py +2 -1
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +8 -5
- brg_certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +6 -3
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.json +7 -4
- brg_certificate/tests/datapath/pacer_interval_tags_count_test/pacer_interval_tags_count_test.py +6 -3
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +7 -4
- brg_certificate/tests/datapath/pacer_interval_test/pacer_interval_test.py +4 -2
- brg_certificate/tests/datapath/pattern_test/pattern_test.json +8 -5
- brg_certificate/tests/datapath/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.json +11 -5
- brg_certificate/tests/datapath/pkt_filter_ble5_test/pkt_filter_ble5_test.py +12 -5
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +10 -4
- brg_certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.py +11 -6
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +10 -4
- brg_certificate/tests/datapath/pkt_filter_test/pkt_filter_test.py +11 -7
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +8 -4
- brg_certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.py +7 -5
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.json +7 -4
- brg_certificate/tests/datapath/rx_channel_test/rx_channel_test.py +7 -3
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +4 -5
- brg_certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +107 -73
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +4 -5
- brg_certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.py +128 -118
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +15 -23
- brg_certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +104 -103
- brg_certificate/tests/datapath/stress_test/stress_test.json +15 -23
- brg_certificate/tests/datapath/stress_test/stress_test.py +104 -110
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.json +8 -4
- brg_certificate/tests/datapath/tx_repetition_algo_test/tx_repetition_algo_test.py +7 -2
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +8 -4
- brg_certificate/tests/datapath/tx_repetition_test/tx_repetition_test.py +8 -6
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.json +4 -3
- brg_certificate/tests/edge_mgmt/actions_test/actions_test.py +2 -38
- brg_certificate/tests/edge_mgmt/brg2brg_ota_ble5_test/brg2brg_ota_ble5_test.json +15 -8
- brg_certificate/tests/edge_mgmt/brg2brg_ota_test/brg2brg_ota_test.json +14 -8
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.json +11 -7
- brg_certificate/tests/edge_mgmt/leds_test/leds_test.py +25 -12
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.json +11 -7
- brg_certificate/tests/edge_mgmt/ota_test/ota_test.py +48 -3
- brg_certificate/tests/edge_mgmt/{stat_test/stat_test.json → periodic_msgs_test/periodic_msgs_test.json} +5 -4
- brg_certificate/tests/edge_mgmt/{stat_test/stat_test.py → periodic_msgs_test/periodic_msgs_test.py} +4 -4
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +8 -5
- brg_certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy2400/output_power_test/output_power_test.json +9 -6
- brg_certificate/tests/energy2400/output_power_test/output_power_test.py +2 -1
- brg_certificate/tests/energy2400/pattern_test/pattern_test.json +8 -5
- brg_certificate/tests/energy2400/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.json +20 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_250k_test/signal_indicator_ble5_10_250k_test.py +343 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.json +20 -0
- brg_certificate/tests/energy2400/signal_indicator_ble5_10_500k_test/signal_indicator_ble5_10_500k_test.py +343 -0
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.json +14 -7
- brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py +45 -57
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +14 -7
- brg_certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +198 -125
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +7 -4
- brg_certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.py +2 -1
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.json +13 -6
- brg_certificate/tests/energy_sub1g/pattern_test/pattern_test.py +2 -1
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.json +14 -7
- brg_certificate/tests/energy_sub1g/signal_indicator_functionality_test/signal_indicator_functionality_test.py +117 -124
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.json +7 -4
- brg_certificate/tests/energy_sub1g/signal_indicator_test/signal_indicator_test.py +2 -1
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +18 -0
- brg_certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.py +84 -0
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +21 -0
- brg_certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +306 -0
- brg_certificate/wltPb_pb2.py +15 -15
- brg_certificate/wltPb_pb2.pyi +8 -2
- brg_certificate/wlt_types.py +2 -1
- gw_certificate/cert_results.py +11 -4
- gw_certificate/gw_certificate.py +0 -2
- gw_certificate/gw_certificate_cli.py +3 -3
- gw_certificate/interface/uart_if.py +1 -1
- gw_certificate/tests/actions.py +7 -1
- gw_certificate/tests/registration.py +2 -1
- gw_certificate/tests/uplink.py +26 -35
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/METADATA +46 -42
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/RECORD +120 -112
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/WHEEL +1 -1
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.json +0 -13
- brg_certificate/tests/datapath/adaptive_pacer_algo_test/adaptive_pacer_algo_test.py +0 -76
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -13
- brg_certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +0 -398
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info/licenses}/LICENSE +0 -0
- {wiliot_certificate-1.5.0a1.dist-info → wiliot_certificate-1.5.2a1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
from brg_certificate.cert_prints import *
|
|
2
|
+
from brg_certificate.cert_defines import *
|
|
3
|
+
from brg_certificate.wlt_types import *
|
|
4
|
+
import brg_certificate.cert_common as cert_common
|
|
5
|
+
import brg_certificate.cert_config as cert_config
|
|
6
|
+
|
|
7
|
+
# Test Description:
|
|
8
|
+
# This test is to verify the functionality of both signal indicator tx (tx_brg) and rx (rx_brg) at BRG level.
|
|
9
|
+
# rssi_threshold = phase 0 , check the if rssi value is between 0 to -25.
|
|
10
|
+
# brg0_rx_brg1_tx = phase 1+2
|
|
11
|
+
# phase 1 - One BRG will be configured as signal indicator tx, and the other as signal indicator rx,
|
|
12
|
+
# and we expect to see signal indicator packets only from the rx BRG according to the tx params (repetition and cycle params).
|
|
13
|
+
# phase 2 - Same as phase 1, but with different tx params configured.
|
|
14
|
+
# brg0_none_brg1_rx = phase 3 - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets.
|
|
15
|
+
# This phase is to verify the brg module logic is working properly,
|
|
16
|
+
# and no tag packet is accidentally being treated as signal indicator packet.
|
|
17
|
+
# brg0_rxtx_brg1_rxtx = phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
|
|
18
|
+
# we expect to see signal indicator packets from both BRG's, according to the tx params.
|
|
19
|
+
# brg0_tx_brg1_none = phase 5 - One BRG will be configured as signal indicator tx,
|
|
20
|
+
# but no rx, so we don't expect to receive signal indicator packets.
|
|
21
|
+
# that way we can assure the logic within the receiver is not confused by the signal indicator uuid as external sensor.
|
|
22
|
+
|
|
23
|
+
# Test MACROS #
|
|
24
|
+
NUM_OF_TX_CYCLES = 2
|
|
25
|
+
DEFAULT_SCAN_TIME = 60
|
|
26
|
+
SCAN_DELAY_TIME = 5
|
|
27
|
+
BLE4_LISTEN_PERIOD = 15
|
|
28
|
+
BLE4_BROADCAST_DURATION = BLE4_LISTEN_PERIOD + 1
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Test functions #
|
|
32
|
+
def terminate_test(test, phase, revert_rx_brg=False, revert_tx_brg=False, modules=[]):
|
|
33
|
+
# Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
|
|
34
|
+
utPrint(f"Terminating test (phase={phase})!!!!!!!!\n", "BLUE")
|
|
35
|
+
if revert_rx_brg:
|
|
36
|
+
restore_modules = [modules[1]] if (test.internal_brg or phase != 4) else modules
|
|
37
|
+
restore_modules.append(eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}'))
|
|
38
|
+
utPrint(f"reverting rx_brg {test.brg1.id_str} to defaults\n", "BOLD")
|
|
39
|
+
test, response = cert_config.config_brg1_defaults(test, modules=restore_modules, ble5=True)
|
|
40
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
41
|
+
test.rc = TEST_FAILED
|
|
42
|
+
test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
|
|
43
|
+
f"{restore_modules} to default configuration!")
|
|
44
|
+
|
|
45
|
+
if revert_tx_brg:
|
|
46
|
+
restore_modules = [modules[0]] if (test.internal_brg or phase != 4) else modules
|
|
47
|
+
restore_modules.append(eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}'))
|
|
48
|
+
utPrint(f"reverting tx_brg {test.brg0.id_str} to defaults\n", "BOLD")
|
|
49
|
+
test, response = cert_config.config_brg_defaults(test, modules=restore_modules, ble5=True)
|
|
50
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
51
|
+
test.rc = TEST_FAILED
|
|
52
|
+
test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
|
|
53
|
+
f"{restore_modules} to default configuration!")
|
|
54
|
+
return cert_common.test_epilog(test)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def brg0_tx_brg1_none(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
|
|
58
|
+
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
59
|
+
|
|
60
|
+
# Phase 5 - Tx BRG without rx. just waiting for packets to be sent from the transmitter and verify
|
|
61
|
+
# The receiver isn't receiving any signal indicator packets.
|
|
62
|
+
phase = "brg0_tx_brg1_none"
|
|
63
|
+
tx_signal_ind_cycle = 15
|
|
64
|
+
tx_signal_ind_rep = 1
|
|
65
|
+
utPrint(f"TX BRG without RX - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
|
|
66
|
+
# restore default configuration for receiver #
|
|
67
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} to default", "BOLD")
|
|
68
|
+
restore_modules = [modules[1]] if (test.internal_brg) else modules
|
|
69
|
+
test = cert_config.config_brg1_defaults(test, modules=restore_modules, ble5=True)[0]
|
|
70
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
71
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
72
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't revert to default configuration!")
|
|
73
|
+
|
|
74
|
+
# configuring transmitter #
|
|
75
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
76
|
+
test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
77
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
|
|
78
|
+
if test.rc == TEST_FAILED:
|
|
79
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
80
|
+
|
|
81
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
82
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
83
|
+
f"repetition = {tx_signal_ind_rep}", "BOLD")
|
|
84
|
+
|
|
85
|
+
# phase analysis #
|
|
86
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
87
|
+
expected_signal_ind_pkts = [0]
|
|
88
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
89
|
+
if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
|
|
90
|
+
test.rc = TEST_FAILED
|
|
91
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG {rx_brg_.id_str}")
|
|
92
|
+
|
|
93
|
+
# Revert bridges to BLE4 before next loop
|
|
94
|
+
utPrint(f"reverting rx_brg {test.brg1.id_str} to defaults\n", "BOLD")
|
|
95
|
+
test, response = cert_config.config_brg1_defaults(test, modules=[datapath_module], ble5=True)
|
|
96
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
97
|
+
test.rc = TEST_FAILED
|
|
98
|
+
test.add_reason(f"BRG {test.brg1.id_str} didn't revert datapath_module to default configuration!")
|
|
99
|
+
|
|
100
|
+
utPrint(f"reverting tx_brg {test.brg0.id_str} to defaults\n", "BOLD")
|
|
101
|
+
test, response = cert_config.config_brg_defaults(test, modules=[datapath_module], ble5=True)
|
|
102
|
+
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
103
|
+
test.rc = TEST_FAILED
|
|
104
|
+
test.add_reason(f"BRG {test.brg0.id_str} didn't revert datapath module to default configuration!")
|
|
105
|
+
|
|
106
|
+
# Test epilog
|
|
107
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def brg0_rxtx_brg1_rxtx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
|
|
111
|
+
phase = "brg0_rxtx_brg1_rxtx"
|
|
112
|
+
|
|
113
|
+
if not test.internal_brg:
|
|
114
|
+
# Phase 4 - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one.
|
|
115
|
+
# expecting to see signal indicator packets from both BRG's, according to the tx params.
|
|
116
|
+
utPrint("Both BRG's are transmitter and receivers, with different values\n", "BLUE")
|
|
117
|
+
|
|
118
|
+
# configuring first BRG (tx_brg_) #
|
|
119
|
+
tx_brg_signal_indicator_cycle = 15
|
|
120
|
+
tx_brg_signal_indicator_rep = 3
|
|
121
|
+
# configuring first brg (tx_brg_) as receiver
|
|
122
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
123
|
+
cert_config.brg_configure_ble5(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
|
|
124
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], wait=False)
|
|
125
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
126
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
|
|
127
|
+
|
|
128
|
+
# configuring transmitter #
|
|
129
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
130
|
+
test = cert_config.brg_configure(test=test, module=energy2400_module,
|
|
131
|
+
fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
132
|
+
values=[tx_brg_signal_indicator_cycle, tx_brg_signal_indicator_rep])[0]
|
|
133
|
+
if test.rc == TEST_FAILED:
|
|
134
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
135
|
+
|
|
136
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
137
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_brg_signal_indicator_cycle},"
|
|
138
|
+
f"repetition = {tx_brg_signal_indicator_rep}", "BOLD")
|
|
139
|
+
|
|
140
|
+
# configuring second brg (rx_brg_) as receiver
|
|
141
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
142
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module,
|
|
143
|
+
fields=[BRG_SENSOR0], values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR], ble5=True)[0]
|
|
144
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
145
|
+
utPrint(f"BRG {rx_brg_.id_str} successfully configured as Signal Indicator Receiver\n", "BOLD")
|
|
146
|
+
|
|
147
|
+
# configuring second brg (rx_brg_) as transmitter
|
|
148
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
149
|
+
rx_brg_signal_indicator_cycle = 15
|
|
150
|
+
rx_brg_signal_indicator_rep = 4
|
|
151
|
+
test = cert_config.brg1_configure(test=test, module=energy2400_module,
|
|
152
|
+
fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
153
|
+
values=[rx_brg_signal_indicator_cycle, rx_brg_signal_indicator_rep], ble5=True)[0]
|
|
154
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
155
|
+
if test.rc == TEST_FAILED:
|
|
156
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
157
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {rx_brg_signal_indicator_cycle},"
|
|
158
|
+
f"repetition = {rx_brg_signal_indicator_rep}")
|
|
159
|
+
|
|
160
|
+
# phase analysis #
|
|
161
|
+
mqtt_scan_n_create_log_file(test,
|
|
162
|
+
NUM_OF_TX_CYCLES * max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) + SCAN_DELAY_TIME,
|
|
163
|
+
phase)
|
|
164
|
+
|
|
165
|
+
# Analyzing tx_brg_ performance as receiver
|
|
166
|
+
utPrint(f"Analyzing tx_brg {tx_brg_.id_str} performance as a Receiver\n", "BOLD")
|
|
167
|
+
rx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / rx_brg_signal_indicator_cycle
|
|
168
|
+
expected_signal_ind_pkts = [int(x * rx_brg_tx_cycles) for x in cert_common.exp_sig_ind_pkts(rx_brg_, tx_brg_, NUM_OF_TX_CYCLES)]
|
|
169
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=tx_brg_, tx_brg=rx_brg_)
|
|
170
|
+
txt = f"""Phase {phase} - BRG {tx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets,"
|
|
171
|
+
" expected {expected_signal_ind_pkts} packets"""
|
|
172
|
+
print(txt)
|
|
173
|
+
if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
|
|
174
|
+
test.rc = TEST_FAILED
|
|
175
|
+
test.add_reason(txt)
|
|
176
|
+
|
|
177
|
+
# Analyzing rx_brg_ performance as receiver
|
|
178
|
+
utPrint(f"Analyzing rx_brg {rx_brg_.id_str} performance as a Receiver\n", "BOLD")
|
|
179
|
+
tx_brg_tx_cycles = max(tx_brg_signal_indicator_cycle, rx_brg_signal_indicator_cycle) / tx_brg_signal_indicator_cycle
|
|
180
|
+
expected_signal_ind_pkts = [int(x * tx_brg_tx_cycles) for x in cert_common.exp_sig_ind_pkts(rx_brg_, tx_brg_)]
|
|
181
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
182
|
+
txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)}"
|
|
183
|
+
" packets, expected {expected_signal_ind_pkts} packets"""
|
|
184
|
+
print(txt)
|
|
185
|
+
if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
|
|
186
|
+
test.rc = TEST_FAILED
|
|
187
|
+
test.add_reason(txt)
|
|
188
|
+
else:
|
|
189
|
+
test.add_reason("skip for internal BRG")
|
|
190
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def brg0_none_brg1_rx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
|
|
194
|
+
phase = "brg0_none_brg1_rx"
|
|
195
|
+
# Phase 3 - Rx BRG without tx.Expecting no signal indicator packets to be received.
|
|
196
|
+
tx_signal_ind_cycle = ag.BRG_DEFAULT_SIGNAL_INDICATOR_CYCLE
|
|
197
|
+
tx_signal_ind_rep = ag.BRG_DEFAULT_SIGNAL_INDICATOR_REP
|
|
198
|
+
utPrint(f"RX BRG without TX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
|
|
199
|
+
|
|
200
|
+
# configuring transmitter #
|
|
201
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
202
|
+
test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
203
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
|
|
204
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
205
|
+
if test.rc == TEST_FAILED:
|
|
206
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
207
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to default!!! cycle = {tx_signal_ind_cycle},"f"repetition = {tx_signal_ind_rep}", "BOLD")
|
|
208
|
+
|
|
209
|
+
# phase analysis #
|
|
210
|
+
mqtt_scan_n_create_log_file(test, DEFAULT_SCAN_TIME, phase)
|
|
211
|
+
expected_signal_ind_pkts = [0]
|
|
212
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
213
|
+
if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
|
|
214
|
+
test.rc = TEST_FAILED
|
|
215
|
+
test.add_reason(f"Phase {phase} failed - received signal indicator packet from BRG"
|
|
216
|
+
f"{rx_brg_.id_str}")
|
|
217
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def brg0_rx_brg1_tx(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
|
|
221
|
+
phase = "brg0_rx_brg1_tx"
|
|
222
|
+
cycle_rep = [(30, 3), (60, 4)]
|
|
223
|
+
for tx_signal_ind_cycle, tx_signal_ind_rep in cycle_rep:
|
|
224
|
+
|
|
225
|
+
utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
|
|
226
|
+
# configuring receiver #
|
|
227
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
228
|
+
test = cert_config.brg_configure(test=test, module=energy2400_module,
|
|
229
|
+
fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
230
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep])[0]
|
|
231
|
+
if test.rc == TEST_FAILED:
|
|
232
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
233
|
+
|
|
234
|
+
# configuring transmitter #
|
|
235
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
236
|
+
test = cert_config.brg1_configure(test=test, module=energy2400_module,
|
|
237
|
+
fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
238
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
|
|
239
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
240
|
+
if test.rc == TEST_FAILED:
|
|
241
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
242
|
+
|
|
243
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle={tx_signal_ind_cycle}, repetition={tx_signal_ind_rep}", "BOLD")
|
|
244
|
+
|
|
245
|
+
# phase analysis
|
|
246
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
247
|
+
expected_signal_ind_pkts = cert_common.exp_sig_ind_pkts(tx_brg_, rx_brg_, NUM_OF_TX_CYCLES)
|
|
248
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
249
|
+
txt = f"""Phase {phase} - BRG {rx_brg_.id_str} signal indicator packets: received {len(received_signal_ind_pkts)} packets,"
|
|
250
|
+
expected {expected_signal_ind_pkts} packets"""
|
|
251
|
+
print(txt)
|
|
252
|
+
# TODO: change condition
|
|
253
|
+
if len(received_signal_ind_pkts) not in expected_signal_ind_pkts:
|
|
254
|
+
test.rc = TEST_FAILED
|
|
255
|
+
test.add_reason(txt)
|
|
256
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def rssi_threshold(test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules):
|
|
260
|
+
phase = "rssi_threshold"
|
|
261
|
+
# RSSI Threshold
|
|
262
|
+
rssi_threshold = -25
|
|
263
|
+
tx_signal_ind_cycle = 15
|
|
264
|
+
tx_signal_ind_rep = 3
|
|
265
|
+
utPrint(f"TX BRG with RX- cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "BLUE")
|
|
266
|
+
|
|
267
|
+
# configuring receiver #
|
|
268
|
+
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver with RSSI Threshold of {rssi_threshold}", "BOLD")
|
|
269
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0, BRG_RSSI_THRESHOLD],
|
|
270
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR, rssi_threshold], ble5=True)[0]
|
|
271
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
272
|
+
|
|
273
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
274
|
+
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
275
|
+
|
|
276
|
+
# configuring transmitter #
|
|
277
|
+
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator Transmitter", "BOLD")
|
|
278
|
+
test = cert_config.brg1_configure(test=test, module=energy2400_module, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
279
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep], ble5=True)[0]
|
|
280
|
+
print_update_wait(BLE4_BROADCAST_DURATION) # BLE5 configuration can take up to BLE4_BROADCAST_DURATION sec
|
|
281
|
+
if test.rc == TEST_FAILED:
|
|
282
|
+
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator transmitter configuration!")
|
|
283
|
+
|
|
284
|
+
utPrint(f"BRG {tx_brg_.id_str} configured to be transmitter - cycle = {tx_signal_ind_cycle},"
|
|
285
|
+
f"repetition = {tx_signal_ind_rep}", "BOLD")
|
|
286
|
+
# phase analysis #
|
|
287
|
+
mqtt_scan_n_create_log_file(test, (NUM_OF_TX_CYCLES * tx_signal_ind_cycle) + SCAN_DELAY_TIME, phase)
|
|
288
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
289
|
+
rssi_threshold_viloation_pkts = [p for p in received_signal_ind_pkts if p[RSSI] >= -1 * rssi_threshold]
|
|
290
|
+
if rssi_threshold_viloation_pkts:
|
|
291
|
+
test.rc = TEST_FAILED
|
|
292
|
+
test.add_reason(f"rssi_threshold phase failed - BRG {rx_brg_.id_str} echoed"
|
|
293
|
+
f" {len(rssi_threshold_viloation_pkts)} signal indicator packets\n with RSSI weaker than {rssi_threshold}")
|
|
294
|
+
field_functionality_pass_fail_print(test, 'phase', phase)
|
|
295
|
+
|
|
296
|
+
return terminate_test(test, phase=phase, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
SIGNAL_INDICATOR_TEST_MAP = {
|
|
300
|
+
"rssi_threshold": rssi_threshold, # phase 0
|
|
301
|
+
"brg0_rx_brg1_tx": brg0_rx_brg1_tx, # phase 1 + 2
|
|
302
|
+
"brg0_none_brg1_rx": brg0_none_brg1_rx, # phase 3
|
|
303
|
+
"brg0_rxtx_brg1_rxtx": brg0_rxtx_brg1_rxtx, # phase 4, skip for internal brg
|
|
304
|
+
"brg0_tx_brg1_none": brg0_tx_brg1_none} # phase 5
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def run(test):
|
|
308
|
+
|
|
309
|
+
# Test modules evaluation #
|
|
310
|
+
energy2400_module = eval_pkt(f'ModuleEnergy2400V{test.active_brg.api_version}')
|
|
311
|
+
ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
|
|
312
|
+
datapath_module = eval_pkt(f'ModuleDatapathV{test.active_brg.api_version}')
|
|
313
|
+
|
|
314
|
+
# Transmitter related defines #
|
|
315
|
+
tx_brg_ = test.brg0
|
|
316
|
+
tx_module = energy2400_module
|
|
317
|
+
|
|
318
|
+
# Receiver related defines #
|
|
319
|
+
rx_brg_ = test.brg1
|
|
320
|
+
|
|
321
|
+
# Modules list #
|
|
322
|
+
modules = [tx_module, ext_sensors_module]
|
|
323
|
+
|
|
324
|
+
# Test prolog
|
|
325
|
+
test = cert_common.test_prolog(test)
|
|
326
|
+
test = cert_config.brg_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_10_500K], module=datapath_module)[0]
|
|
327
|
+
test = cert_config.brg1_configure(test, fields=[BRG_RX_CHANNEL], values=[ag.RX_CHANNEL_10_500K], module=datapath_module)[0]
|
|
328
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
329
|
+
return terminate_test(test, phase=1, revert_rx_brg=True, revert_tx_brg=True, modules=modules)
|
|
330
|
+
for param in test.params:
|
|
331
|
+
functionality_run_print(param.name)
|
|
332
|
+
test = SIGNAL_INDICATOR_TEST_MAP[param.value](test, energy2400_module, ext_sensors_module, tx_brg_, rx_brg_, modules)
|
|
333
|
+
generate_log_file(test, param.name)
|
|
334
|
+
field_functionality_pass_fail_print(test, param.name)
|
|
335
|
+
test.set_phase_rc(param.name, test.rc)
|
|
336
|
+
test.add_phase_reason(param.name, test.reason)
|
|
337
|
+
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
338
|
+
break
|
|
339
|
+
else:
|
|
340
|
+
test.reset_result()
|
|
341
|
+
|
|
342
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[energy2400_module, ext_sensors_module],
|
|
343
|
+
brg1_modules=[energy2400_module, ext_sensors_module])
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"module": "
|
|
4
|
-
"purpose": "
|
|
5
|
-
"
|
|
6
|
-
"initialCondition": "
|
|
7
|
-
"procedure": ["Test prolog",
|
|
8
|
-
|
|
2
|
+
"name": "Signal Indicator 2.4 & Sub1g Sync",
|
|
3
|
+
"module": "Energizer 2.4GHz",
|
|
4
|
+
"purpose": "Verify the signal indicator tx sync mechanism when transmitting in both sub1g & 2.4 GHz bands.",
|
|
5
|
+
"documentation": "<TEST_DOCUMENTATION_LINK>",
|
|
6
|
+
"initialCondition": "1 GW and at least 1 BRG (tx brg) connected to the GW.",
|
|
7
|
+
"procedure": ["Test prolog",
|
|
8
|
+
"Configure rx BRG to receive signal indicator packets (can be BRG or internal BRG)",
|
|
9
|
+
"Configure tx BRG to transmit signal indicator 2.4 GHz packets",
|
|
10
|
+
"Configure tx BRG to transmit signal indicator sub1g packets with same repetitions & cycle time as 2.4 GHz",
|
|
11
|
+
"Scan packets for 3 cycles",
|
|
12
|
+
"Verify same number of packets received in both sub1g & 2.4 GHz bands",
|
|
13
|
+
"Test epilog"],
|
|
14
|
+
"expectedOutcome": "Sync mechanism should work correctly, with the same number of packets received in both sub1g & 2.4 GHz bands.",
|
|
9
15
|
"mandatory": 0,
|
|
10
16
|
"multiBridgeTest": 1,
|
|
11
17
|
"gwOnlyTest": 0,
|
|
18
|
+
"internalBridge": 1,
|
|
12
19
|
"allSupportedValues": []
|
|
13
20
|
}
|
brg_certificate/tests/energy2400/signal_indicator_sub1g_2_4_test/signal_indicator_sub1g_2_4_test.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import random
|
|
2
1
|
from brg_certificate.cert_prints import *
|
|
3
2
|
from brg_certificate.cert_defines import *
|
|
4
3
|
import brg_certificate.cert_common as cert_common
|
|
@@ -7,43 +6,26 @@ from brg_certificate.wlt_types import *
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
# Test MACROS #
|
|
10
|
-
DEFAULT_HDR = ag.Hdr(group_id=ag.GROUP_ID_GW2BRG)
|
|
11
9
|
NUM_OF_SCANNING_CYCLE = 3
|
|
12
10
|
DEFAULT_SCAN_TIME = 60
|
|
13
11
|
SCAN_DELAY_TIME = 5
|
|
14
|
-
BOARD_TYPES_2_POLARIZATION_ANT_LIST = [ag.BOARD_TYPE_MINEW_SINGLE_BAND_V0, ag.BOARD_TYPE_MINEW_DUAL_BAND_V0, ag.BOARD_TYPE_ENERGOUS_V2, ag.BOARD_TYPE_ERM_V0, ag.BOARD_TYPE_ERM_V1]
|
|
15
12
|
ANTENNA_TYPE_2_4 = 0
|
|
16
13
|
ANTENNA_TYPE_SUB1G = 1
|
|
17
|
-
ANTENNA_TYPE_IDX = 21
|
|
18
14
|
|
|
19
|
-
# Test functions #
|
|
20
|
-
def mqtt_scan_n_create_log_file(test, duration):
|
|
21
|
-
test.mqttc.flush_pkts()
|
|
22
|
-
mqtt_scan_wait(test, duration=duration)
|
|
23
|
-
generate_log_file(test, "15&4")
|
|
24
|
-
|
|
25
|
-
def get_all_signal_ind_pkt(test=None, rx_brg=None, tx_brg=None):
|
|
26
|
-
if rx_brg == test.brg1:
|
|
27
|
-
all_sensor_packets = cert_mqtt.get_all_brg1_ext_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
28
|
-
elif rx_brg == test.brg0:
|
|
29
|
-
all_sensor_packets = cert_mqtt.get_all_sensor_pkts(mqttc=test.mqttc, test=test)
|
|
30
|
-
signal_ind_pkts = []
|
|
31
|
-
for p in all_sensor_packets:
|
|
32
|
-
if p[SENSOR_UUID] == "{:06X}".format(ag.SENSOR_SERVICE_ID_SIGNAL_INDICATOR) and p[BRIDGE_ID] == rx_brg.id_str and (p[SENSOR_ID] == tx_brg.id_alias or p[SENSOR_ID] == tx_brg.id_str):
|
|
33
|
-
signal_ind_pkts.append(p)
|
|
34
|
-
return signal_ind_pkts
|
|
35
15
|
|
|
16
|
+
# Test functions #
|
|
36
17
|
def expected_signal_ind_pkts_calc(tx_brg, rx_brg, antenna_type):
|
|
37
|
-
if (antenna_type == ANTENNA_TYPE_2_4 and tx_brg.board_type in
|
|
18
|
+
if (antenna_type == ANTENNA_TYPE_2_4 and tx_brg.board_type in cert_common.dual_polarization_ant_boards_get()):
|
|
38
19
|
tx_brg_ant_polarization_num = 2
|
|
39
20
|
else:
|
|
40
21
|
tx_brg_ant_polarization_num = 1
|
|
41
|
-
if (antenna_type == ANTENNA_TYPE_2_4 and rx_brg.board_type in
|
|
22
|
+
if (antenna_type == ANTENNA_TYPE_2_4 and rx_brg.board_type in cert_common.dual_polarization_ant_boards_get()):
|
|
42
23
|
rx_brg_ant_polarization_num = 2
|
|
43
24
|
else:
|
|
44
25
|
rx_brg_ant_polarization_num = 1
|
|
45
26
|
return NUM_OF_SCANNING_CYCLE * tx_brg_ant_polarization_num * rx_brg_ant_polarization_num
|
|
46
27
|
|
|
28
|
+
|
|
47
29
|
def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[], tx_modules=[]):
|
|
48
30
|
# Temp solution for internal_brg test because test_epilog doesn't support both internal brg and test.brgs
|
|
49
31
|
utPrint("Terminating test!!!!!!!!\n", "BLUE")
|
|
@@ -54,7 +36,7 @@ def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[]
|
|
|
54
36
|
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
55
37
|
test.rc = TEST_FAILED
|
|
56
38
|
test.add_reason(f"BRG {test.brg1.id_str} didn't revert modules "
|
|
57
|
-
|
|
39
|
+
f"{restore_modules} to default configuration!")
|
|
58
40
|
|
|
59
41
|
if revert_tx_brg:
|
|
60
42
|
restore_modules = tx_modules
|
|
@@ -63,16 +45,17 @@ def terminate_test(test, revert_rx_brg=False, revert_tx_brg=False, rx_modules=[]
|
|
|
63
45
|
if response == NO_RESPONSE and test.exit_on_param_failure:
|
|
64
46
|
test.rc = TEST_FAILED
|
|
65
47
|
test.add_reason(f"BRG {test.brg0.id_str} didn't revert modules"
|
|
66
|
-
|
|
48
|
+
f"{restore_modules} to default configuration!")
|
|
67
49
|
return cert_common.test_epilog(test)
|
|
68
50
|
|
|
51
|
+
|
|
69
52
|
# Test execution #
|
|
70
53
|
def run(test):
|
|
71
54
|
|
|
72
55
|
# Test modules evaluation #
|
|
73
|
-
energy2400_module =
|
|
74
|
-
ext_sensors_module =
|
|
75
|
-
energy_sub1g_module =
|
|
56
|
+
energy2400_module = eval_pkt(f'ModuleEnergy2400V{test.active_brg.api_version}')
|
|
57
|
+
ext_sensors_module = eval_pkt(f'ModuleExtSensorsV{test.active_brg.api_version}')
|
|
58
|
+
energy_sub1g_module = eval_pkt(f'ModuleEnergySub1GV{test.active_brg.api_version}')
|
|
76
59
|
|
|
77
60
|
# Transmitter related defines #
|
|
78
61
|
tx_brg_ = test.brg0
|
|
@@ -86,68 +69,73 @@ def run(test):
|
|
|
86
69
|
return terminate_test(test)
|
|
87
70
|
|
|
88
71
|
tx_signal_ind_cycle, tx_signal_ind_rep = 15, 4
|
|
89
|
-
utPrint(f"TX BRG
|
|
72
|
+
utPrint(f"TX BRG in both sub1g & 2.4 - cycle = {tx_signal_ind_cycle}, repetition = {tx_signal_ind_rep}\n", "HEADER")
|
|
90
73
|
|
|
91
74
|
# configuring receiver #
|
|
92
75
|
utPrint(f"Configuring BRG {rx_brg_.id_str} as Signal Indicator Receiver", "BOLD")
|
|
93
|
-
test =
|
|
76
|
+
test = cert_config.brg1_configure(test=test, module=ext_sensors_module, fields=[BRG_SENSOR0],
|
|
77
|
+
values=[ag.EXTERNAL_SENSORS_SIGNAL_INDICATOR])[0]
|
|
94
78
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
95
79
|
test.add_reason(f"BRG {rx_brg_.id_str}: didn't receive signal indicator receiver configuration!")
|
|
96
80
|
return terminate_test(test, revert_rx_brg=True, rx_modules=[ext_sensors_module])
|
|
97
|
-
utPrint(f"BRG {rx_brg_.id_str}
|
|
81
|
+
utPrint(f"BRG {rx_brg_.id_str} successfully configured to be receiver", "GREEN")
|
|
98
82
|
|
|
99
83
|
# configuring transmitter 2_4 #
|
|
100
84
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator 2_4 Transmitter", "BOLD")
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
test = cert_config.brg_configure(test, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP],
|
|
86
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep], module=energy2400_module)[0]
|
|
103
87
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
104
88
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator 2_4 transmitter configuration!")
|
|
105
|
-
return terminate_test(test, revert_rx_brg=True,revert_tx_brg=True)
|
|
106
|
-
utPrint(f"BRG {tx_brg_.id_str}
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
return terminate_test(test, revert_rx_brg=True, revert_tx_brg=True)
|
|
90
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be 2_4 transmitter - cycle = {tx_signal_ind_cycle},"
|
|
91
|
+
f"repetition = {tx_signal_ind_rep}", "GREEN")
|
|
92
|
+
|
|
109
93
|
# configuring transmitter sub1g #
|
|
110
94
|
utPrint(f"Configuring BRG {tx_brg_.id_str} as Signal Indicator sub1g Transmitter", "BOLD")
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
test = cert_config.brg_configure(test, fields=[BRG_SIGNAL_INDICATOR_CYCLE, BRG_SIGNAL_INDICATOR_REP, BRG_DUTY_CYCLE],
|
|
96
|
+
values=[tx_signal_ind_cycle, tx_signal_ind_rep, 0],
|
|
97
|
+
module=energy_sub1g_module)[0]
|
|
113
98
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
114
99
|
test.add_reason(f"BRG {tx_brg_.id_str}: didn't receive signal indicator sub1g transmitter configuration!")
|
|
115
|
-
return terminate_test(test, revert_rx_brg=True,revert_tx_brg=True, rx_modules=[ext_sensors_module],
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
return terminate_test(test, revert_rx_brg=True, revert_tx_brg=True, rx_modules=[ext_sensors_module],
|
|
101
|
+
tx_modules=[energy2400_module, energy_sub1g_module])
|
|
102
|
+
utPrint(f"BRG {tx_brg_.id_str} successfully configured to be Sub1g transmitter - cycle = {tx_signal_ind_cycle},"
|
|
103
|
+
f"repetition = {tx_signal_ind_rep}, EP = {ag.SUB1G_ENERGY_PATTERN_ISRAEL}", "GREEN")
|
|
104
|
+
|
|
119
105
|
# analysis #
|
|
120
106
|
mqtt_scan_n_create_log_file(test, (NUM_OF_SCANNING_CYCLE * tx_signal_ind_cycle) + SCAN_DELAY_TIME)
|
|
121
|
-
received_signal_ind_pkts =
|
|
107
|
+
received_signal_ind_pkts = cert_common.get_all_sig_ind_pkts(test=test, rx_brg=rx_brg_, tx_brg=tx_brg_)
|
|
122
108
|
expected_signal_ind_2_4_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_, ANTENNA_TYPE_2_4)
|
|
123
109
|
expected_signal_ind_sub1g_pkts = expected_signal_ind_pkts_calc(tx_brg_, rx_brg_, ANTENNA_TYPE_SUB1G)
|
|
124
110
|
signal_indicator_2_4_packets = 0
|
|
125
111
|
signal_indicator_sub1g_packets = 0
|
|
126
112
|
for p in received_signal_ind_pkts:
|
|
127
|
-
if
|
|
113
|
+
if p[SENSOR_PKT].pkt.antenna_type == ANTENNA_TYPE_SUB1G and p[SENSOR_ID] == tx_brg_.id_str:
|
|
128
114
|
signal_indicator_sub1g_packets += 1
|
|
129
|
-
elif
|
|
115
|
+
elif p[SENSOR_PKT].pkt.antenna_type == ANTENNA_TYPE_2_4 and p[SENSOR_ID] == tx_brg_.id_alias:
|
|
130
116
|
signal_indicator_2_4_packets += 1
|
|
131
|
-
utPrint(f"Received {signal_indicator_2_4_packets} 2_4 signal indicator packets
|
|
117
|
+
utPrint(f"Received {signal_indicator_2_4_packets} 2_4 signal indicator packets"
|
|
118
|
+
f" and {signal_indicator_sub1g_packets} sub1g signal indicator packets", "BLUE")
|
|
132
119
|
|
|
133
120
|
# Test evaluation #
|
|
134
|
-
if len(received_signal_ind_pkts)
|
|
121
|
+
if len(received_signal_ind_pkts) != expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts:
|
|
135
122
|
test.rc = TEST_FAILED
|
|
136
123
|
test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
elif signal_indicator_2_4_packets
|
|
124
|
+
f"total signal indicator packets\n received {len(received_signal_ind_pkts)} packets, "
|
|
125
|
+
f"expected {expected_signal_ind_2_4_pkts + expected_signal_ind_sub1g_pkts} packets")
|
|
126
|
+
elif signal_indicator_2_4_packets != expected_signal_ind_2_4_pkts:
|
|
140
127
|
test.rc = TEST_FAILED
|
|
141
128
|
test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
elif signal_indicator_sub1g_packets
|
|
129
|
+
f"signal indicator 2.4 packets\n received {signal_indicator_2_4_packets} packets, "
|
|
130
|
+
f"expected {expected_signal_ind_2_4_pkts} packets")
|
|
131
|
+
elif signal_indicator_sub1g_packets != expected_signal_ind_sub1g_pkts:
|
|
145
132
|
test.rc = TEST_FAILED
|
|
146
133
|
test.add_reason(f"Test failed - BRG {rx_brg_.id_str} received wrong number of "
|
|
147
|
-
|
|
148
|
-
|
|
134
|
+
f"signal indicator sub1g packets\n received {signal_indicator_sub1g_packets} packets, "
|
|
135
|
+
f"expected {expected_signal_ind_sub1g_pkts} packets")
|
|
149
136
|
|
|
150
|
-
field_functionality_pass_fail_print(test,'Signal Indicator Functionality 2_4 & Sub1g')
|
|
137
|
+
field_functionality_pass_fail_print(test, 'Signal Indicator Functionality 2_4 & Sub1g')
|
|
151
138
|
|
|
152
139
|
# Test epilog
|
|
153
|
-
return terminate_test(test, revert_rx_brg=False,revert_tx_brg=True,
|
|
140
|
+
return terminate_test(test, revert_rx_brg=False, revert_tx_brg=True,
|
|
141
|
+
rx_modules=[ext_sensors_module], tx_modules=[energy2400_module, energy_sub1g_module])
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"module": "
|
|
4
|
-
"purpose": "
|
|
5
|
-
"
|
|
6
|
-
"initialCondition": "
|
|
7
|
-
"procedure": ["Test prolog",
|
|
8
|
-
"
|
|
2
|
+
"name": "Signal Indicator",
|
|
3
|
+
"module": "Energizer 2.4GHz",
|
|
4
|
+
"purpose": "Test functionality for supported Energizer 2.4GHz signal indicator cycle & repetitions sets of values",
|
|
5
|
+
"documentation": "https://community.wiliot.com/customers/s/article/Wiliot-Network-Energizing-2-4Ghz",
|
|
6
|
+
"initialCondition": "Bridge configured to defaults",
|
|
7
|
+
"procedure": ["Test prolog",
|
|
8
|
+
"rssi_threshold - check the if rssi value is between 0 to -25.",
|
|
9
|
+
"brg0_rx_brg1_tx - one brg is transmitter and the second is receiver, we expect to get the same values from the receiver, according to the tx params",
|
|
10
|
+
"brg0_none_brg1_rx - One rx BRG without any tx BRG. We don't expect to see any signal indicator packets.",
|
|
11
|
+
"brg0_rxtx_brg1_rxtx - Both BRG's will be configured to be transmitters and receivers, with different tx params for each one. we expect to see signal indicator packets from both BRG's, according to the tx params.",
|
|
12
|
+
"brg0_tx_brg1_none - One BRG will be configured as signal indicator tx, but no rx, so we don't expect to receive signal indicator packets.",
|
|
13
|
+
"Test epilog"],
|
|
14
|
+
"expectedOutcome": "All phases passes successfully",
|
|
9
15
|
"mandatory": 0,
|
|
10
16
|
"multiBridgeTest": 1,
|
|
11
17
|
"gwOnlyTest": 0,
|
|
18
|
+
"internalBridge": 1,
|
|
12
19
|
"allSupportedValues": ["rssi_threshold", "brg0_rx_brg1_tx", "brg0_none_brg1_rx", "brg0_rxtx_brg1_rxtx", "brg0_tx_brg1_none"]
|
|
13
20
|
}
|