wiliot-certificate 4.5.0__py3-none-any.whl → 4.5.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- certificate/ag/wlt_types_ag_jsons/brg2brg_ota.json +211 -0
- certificate/ag/wlt_types_ag_jsons/brg2gw_hb.json +894 -0
- certificate/ag/wlt_types_ag_jsons/brg2gw_hb_sleep.json +184 -0
- certificate/ag/wlt_types_ag_jsons/calibration.json +490 -0
- certificate/ag/wlt_types_ag_jsons/custom.json +614 -0
- certificate/ag/wlt_types_ag_jsons/datapath.json +900 -0
- certificate/ag/wlt_types_ag_jsons/energy2400.json +670 -0
- certificate/ag/wlt_types_ag_jsons/energySub1g.json +691 -0
- certificate/ag/wlt_types_ag_jsons/externalSensor.json +727 -0
- certificate/ag/wlt_types_ag_jsons/interface.json +1095 -0
- certificate/ag/wlt_types_ag_jsons/powerManagement.json +1439 -0
- certificate/ag/wlt_types_ag_jsons/side_info_sensor.json +105 -0
- certificate/ag/wlt_types_ag_jsons/signal_indicator_data.json +77 -0
- certificate/ag/wlt_types_ag_jsons/unified_echo_ext_pkt.json +126 -0
- certificate/ag/wlt_types_ag_jsons/unified_echo_pkt.json +175 -0
- certificate/ag/wlt_types_ag_jsons/unified_sensor_pkt.json +65 -0
- certificate/cert_common.py +46 -75
- certificate/cert_config.py +18 -43
- certificate/cert_data_sim.py +9 -12
- certificate/cert_defines.py +0 -9
- certificate/cert_gw_sim.py +7 -35
- certificate/cert_mqtt.py +5 -15
- certificate/cert_prints.py +0 -1
- certificate/cert_results.py +37 -56
- certificate/cert_utils.py +15 -27
- certificate/certificate.py +5 -12
- certificate/certificate_cli.py +13 -10
- certificate/certificate_eth_test_list.txt +4 -6
- certificate/certificate_sanity_test_list.txt +2 -3
- certificate/certificate_test_list.txt +4 -5
- certificate/tests/calibration/interval_test/interval_test.json +0 -1
- certificate/tests/calibration/output_power_test/output_power_test.json +0 -1
- certificate/tests/calibration/pattern_test/pattern_test.json +0 -1
- certificate/tests/cloud_connectivity/acl_ext_adv_test/acl_ext_adv_test.json +1 -2
- certificate/tests/cloud_connectivity/acl_test/acl_test.json +1 -2
- certificate/tests/cloud_connectivity/acl_test/acl_test.py +15 -13
- certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.json +1 -2
- certificate/tests/cloud_connectivity/brg_ota_test/brg_ota_test.py +6 -8
- certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json +1 -2
- certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py +3 -3
- certificate/tests/cloud_connectivity/connection_test/connection_test.json +0 -1
- certificate/tests/cloud_connectivity/connection_test/connection_test.py +13 -6
- certificate/tests/cloud_connectivity/downlink_test/downlink_test.json +0 -1
- certificate/tests/cloud_connectivity/downlink_test/downlink_test.py +4 -1
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.json +1 -2
- certificate/tests/cloud_connectivity/ext_adv_stress_test/ext_adv_stress_test.py +14 -20
- certificate/tests/cloud_connectivity/reboot_test/reboot_test.json +0 -1
- certificate/tests/cloud_connectivity/reboot_test/reboot_test.py +0 -2
- certificate/tests/cloud_connectivity/registration_test/registration_test.json +0 -1
- certificate/tests/cloud_connectivity/registration_test/registration_test_cli.py +1 -1
- certificate/tests/cloud_connectivity/stress_test/stress_test.json +1 -2
- certificate/tests/cloud_connectivity/stress_test/stress_test.py +16 -20
- certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.json +0 -1
- certificate/tests/cloud_connectivity/uplink_ext_adv_test/uplink_ext_adv_test.py +2 -1
- certificate/tests/cloud_connectivity/uplink_test/uplink_test.json +0 -1
- certificate/tests/cloud_connectivity/uplink_test/uplink_test.py +20 -28
- certificate/tests/datapath/aging_test/aging_test.json +0 -1
- certificate/tests/datapath/aging_test/aging_test.py +3 -7
- certificate/tests/datapath/event_ble5_test/event_ble5_test.json +2 -3
- certificate/tests/datapath/event_ble5_test/event_ble5_test.py +13 -7
- certificate/tests/datapath/event_test/event_test.json +2 -3
- certificate/tests/datapath/event_test/event_test.py +10 -5
- certificate/tests/datapath/num_of_tags_test/num_of_tags_test.json +2 -3
- certificate/tests/datapath/num_of_tags_test/num_of_tags_test.py +5 -9
- certificate/tests/datapath/output_power_test/output_power_test.json +0 -1
- certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.json +0 -1
- certificate/tests/datapath/pacer_interval_ble5_test/pacer_interval_ble5_test.py +4 -4
- certificate/tests/datapath/pacer_interval_test/pacer_interval_test.json +0 -1
- certificate/tests/datapath/pattern_test/pattern_test.json +0 -1
- certificate/tests/datapath/pkt_filter_ble5_chl21_test/pkt_filter_ble5_chl21_test.json +0 -1
- 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.json +0 -1
- 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.json +0 -1
- certificate/tests/datapath/pkt_filter_brg2gw_ext_adv_test/pkt_filter_brg2gw_ext_adv_test.py +8 -10
- certificate/tests/datapath/pkt_filter_gen3_test/pkt_filter_gen3_test.json +0 -1
- certificate/tests/datapath/pkt_filter_test/pkt_filter_test.json +0 -1
- certificate/tests/datapath/rssi_threshold_test/rssi_threshold_test.json +1 -2
- certificate/tests/datapath/rx_channel_hopping_test/rx_channel_hopping_test.json +0 -1
- certificate/tests/datapath/rx_channel_test/rx_channel_test.json +0 -1
- certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.json +0 -1
- certificate/tests/datapath/rx_rate_gen2_test/rx_rate_gen2_test.py +1 -1
- certificate/tests/datapath/rx_rate_gen3_test/rx_rate_gen3_test.json +0 -1
- certificate/tests/datapath/stress_gen3_test/stress_gen3_test.json +0 -1
- certificate/tests/datapath/stress_gen3_test/stress_gen3_test.py +0 -3
- certificate/tests/datapath/stress_test/stress_test.json +0 -1
- certificate/tests/datapath/stress_test/stress_test.py +0 -3
- certificate/tests/datapath/tx_repetition_test/tx_repetition_test.json +0 -1
- certificate/tests/edge_mgmt/action_blink_test/action_blink_test.json +0 -1
- certificate/tests/edge_mgmt/action_get_battery_sensor_test/action_get_battery_sensor_test.json +0 -1
- certificate/tests/edge_mgmt/action_get_module_test/action_get_module_test.json +0 -1
- certificate/tests/edge_mgmt/action_get_pof_data_test/action_get_pof_data_test.json +0 -1
- certificate/tests/edge_mgmt/action_gw_hb_test/action_gw_hb_test.json +0 -1
- certificate/tests/edge_mgmt/action_reboot_test/action_reboot_test.json +0 -1
- certificate/tests/edge_mgmt/action_restore_defaults_test/action_restore_defaults_test.json +0 -1
- certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.json +0 -1
- certificate/tests/edge_mgmt/action_send_hb_test/action_send_hb_test.py +14 -18
- certificate/tests/edge_mgmt/periodic_msgs_test/periodic_msgs_test.json +0 -1
- certificate/tests/energy2400/duty_cycle_test/duty_cycle_test.json +0 -1
- certificate/tests/energy2400/output_power_test/output_power_test.json +0 -1
- certificate/tests/energy2400/pattern_test/pattern_test.json +0 -1
- certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.json +0 -1
- certificate/tests/energy2400/signal_indicator_ble5_test/signal_indicator_ble5_test.py +3 -4
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.json +9 -9
- certificate/tests/energy2400/signal_indicator_ext_adv_test/signal_indicator_ext_adv_test.py +271 -113
- certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.json +0 -1
- certificate/tests/energy2400/signal_indicator_test/signal_indicator_test.py +1 -1
- certificate/tests/energy_sub1g/duty_cycle_test/duty_cycle_test.json +0 -1
- certificate/tests/energy_sub1g/pattern_test/pattern_test.json +0 -1
- certificate/tests/pwr_mgmt/pwr_mgmt_test/pwr_mgmt_test.json +0 -1
- certificate/tests/sensors/ext_sensor_test/ext_sensor_test.json +0 -1
- certificate/tests/sensors/ext_sensor_test/ext_sensor_test.py +9 -4
- common/api_if/api_validation.py +2 -8
- common/web/templates/generator.html +79 -141
- common/web/web_utils.py +56 -78
- gui_certificate/server.py +78 -283
- gui_certificate/templates/cert_run.html +113 -179
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/METADATA +38 -27
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/RECORD +123 -109
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.json +0 -15
- certificate/tests/cloud_connectivity/deduplication_test/deduplication_test.py +0 -80
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/WHEEL +0 -0
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/entry_points.txt +0 -0
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/licenses/LICENSE +0 -0
- {wiliot_certificate-4.5.0.dist-info → wiliot_certificate-4.5.0a1.dist-info}/top_level.txt +0 -0
|
@@ -3,13 +3,11 @@ from certificate.cert_prints import *
|
|
|
3
3
|
from certificate.cert_defines import *
|
|
4
4
|
from certificate.wlt_types import *
|
|
5
5
|
from certificate.cert_utils import TESTER_FW_VERSIONS
|
|
6
|
-
|
|
6
|
+
from certificate.cert_gw_sim import STOP_ADVERTISING, GW_SIM_RESET_TS
|
|
7
7
|
import certificate.cert_common as cert_common
|
|
8
8
|
import certificate.cert_config as cert_config
|
|
9
9
|
import certificate.cert_mqtt as cert_mqtt
|
|
10
10
|
|
|
11
|
-
BRG_OTA_HIGH_TIMEOUT = (60 * 10)
|
|
12
|
-
|
|
13
11
|
|
|
14
12
|
def run(test):
|
|
15
13
|
test = cert_common.test_prolog(test)
|
|
@@ -24,18 +22,18 @@ def run(test):
|
|
|
24
22
|
desired_ver = TESTER_FW_VERSIONS[0] if target_brg.version != TESTER_FW_VERSIONS[0] else TESTER_FW_VERSIONS[1]
|
|
25
23
|
|
|
26
24
|
# Initiate action
|
|
27
|
-
utPrint(f"Publishing OTA action to DUT: {test.dut.mqttc.update_topic}. Awaiting OTA.. (timeout is {
|
|
25
|
+
utPrint(f"Publishing OTA action to DUT: {test.dut.mqttc.update_topic}. Awaiting OTA.. (timeout is {VER_UPDATE_TIMEOUT} minutes)")
|
|
28
26
|
# Set active_brg to be the tester, for reboot_config_analysis within brg_ota
|
|
29
27
|
test.active_brg = target_brg
|
|
30
|
-
test = cert_config.brg_ota(test, ble_version=desired_ver, search_ack=True, target=TESTER, upgrader=DUT
|
|
28
|
+
test = cert_config.brg_ota(test, ble_version=desired_ver, search_ack=True, target=TESTER, upgrader=DUT)
|
|
31
29
|
|
|
32
30
|
# Stop advertising on tester in case it just rebooted after getting OTA. So it is ready for next tests
|
|
33
|
-
cert_config.gw_action(test,
|
|
31
|
+
cert_config.gw_action(test, STOP_ADVERTISING, target=TESTER)
|
|
34
32
|
|
|
35
33
|
cert_mqtt.generate_log_file(test, "brg_ota")
|
|
36
34
|
|
|
37
|
-
if test.rc == TEST_PASSED and
|
|
38
|
-
reboot_pkt_time = int((
|
|
35
|
+
if test.rc == TEST_PASSED and GW_SIM_RESET_TS is not None:
|
|
36
|
+
reboot_pkt_time = int((GW_SIM_RESET_TS - test.start_time).total_seconds())
|
|
39
37
|
test.reason = f"Reboot pkt received after {reboot_pkt_time} seconds"
|
|
40
38
|
|
|
41
39
|
return cert_common.test_epilog(test)
|
certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "Gateway Channel behavior",
|
|
3
3
|
"module": "Cloud Connectivity",
|
|
4
4
|
"purpose": "Test gateway's channel scanning time cycles on all main channels",
|
|
5
|
-
"documentation": "",
|
|
5
|
+
"documentation": "<TEST_DOCUMENTATION_LINK>",
|
|
6
6
|
"initialCondition": "Gateway configured with default settings",
|
|
7
7
|
"procedure": ["Test prolog",
|
|
8
8
|
"Send packets as close as possible to continuously on all 3 channels, with a unique channel identifier",
|
|
@@ -14,6 +14,5 @@
|
|
|
14
14
|
"gwOnlyTest": 1,
|
|
15
15
|
"dataSimOnlyTest": 1,
|
|
16
16
|
"internalBridge": 1,
|
|
17
|
-
"SupportedFromApiVersion": 203,
|
|
18
17
|
"allSupportedValues": []
|
|
19
18
|
}
|
certificate/tests/cloud_connectivity/channel_scan_behaviour_test/channel_scan_behaviour_test.py
CHANGED
|
@@ -3,6 +3,7 @@ from certificate.cert_defines import *
|
|
|
3
3
|
from certificate.wlt_types import *
|
|
4
4
|
from certificate.ag.wlt_types_ag import OUTPUT_POWER_2_4_MAX
|
|
5
5
|
import certificate.cert_common as cert_common
|
|
6
|
+
import certificate.cert_utils as cert_utils
|
|
6
7
|
import certificate.cert_mqtt as cert_mqtt
|
|
7
8
|
import certificate.cert_config as cert_config
|
|
8
9
|
import certificate.cert_gw_sim as cert_gw_sim
|
|
@@ -17,7 +18,7 @@ from collections import defaultdict
|
|
|
17
18
|
# DEFINES
|
|
18
19
|
CHANNELS = [37, 38, 39] # channel to check in DUT
|
|
19
20
|
DEFAULT_WAIT_TIME = 5 # How much extra time to wait after the transmition is over
|
|
20
|
-
SCAN_TEST_INDICATOR = get_random_hex_str(6) # Unique identifier for the pkt sent
|
|
21
|
+
SCAN_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6) # Unique identifier for the pkt sent
|
|
21
22
|
ADV_DURATION = 20 # How long to transmit to the DUT
|
|
22
23
|
# cmd_ble_sm defines
|
|
23
24
|
BLE_SIM_RADIO_1MBPS = 1
|
|
@@ -83,7 +84,6 @@ def analyze_listening_timeline(test, all_pkts_received_from_tester, num_of_sent_
|
|
|
83
84
|
channel_cards = []
|
|
84
85
|
|
|
85
86
|
# Parse data into {ts, channel pairs} - X and Y axis
|
|
86
|
-
all_pkts_received_from_tester = sorted(all_pkts_received_from_tester, key=lambda pkt: float(pkt.get(TIMESTAMP)))
|
|
87
87
|
for idx, pkt in enumerate(all_pkts_received_from_tester):
|
|
88
88
|
payload = pkt.get(PAYLOAD)
|
|
89
89
|
channel = int(payload[-10:-8], 16)
|
|
@@ -188,7 +188,7 @@ def run(test):
|
|
|
188
188
|
payload = cert_common.generate_adv_payload(SCAN_TEST_INDICATOR, unique_pkt=True)
|
|
189
189
|
|
|
190
190
|
# Transmitting packets on all channels
|
|
191
|
-
utPrint(f"Transmitting in parallel on all 3 main
|
|
191
|
+
utPrint(f"Transmitting in parallel on all 3 main cahnnels for {ADV_DURATION} seconds", "WARNING")
|
|
192
192
|
num_of_sent_pkts = ADV_DURATION * PPS
|
|
193
193
|
strat_trans_time_ms = time.time() * 1000
|
|
194
194
|
|
|
@@ -25,10 +25,19 @@ def run(test):
|
|
|
25
25
|
if not cert_common.pipeline_running():
|
|
26
26
|
warning_prefix = COLORS["WARNING"]
|
|
27
27
|
warning_suffix = COLORS["ENDC"]
|
|
28
|
+
input(
|
|
29
|
+
(
|
|
30
|
+
f"{warning_prefix}The GW is expected to publish a configuration "
|
|
31
|
+
"JSON/Protobuf message through the status topic upon connecting "
|
|
32
|
+
"to mqtt:\nPlease unplug GW from power. Press enter when unplugged"
|
|
33
|
+
f"{warning_suffix}"
|
|
34
|
+
)
|
|
35
|
+
)
|
|
28
36
|
dut_mqttc.flush_pkts()
|
|
29
|
-
input(
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
input(
|
|
38
|
+
f"{warning_prefix}Please plug GW back to power. "
|
|
39
|
+
f"Press enter when plugged{warning_suffix}"
|
|
40
|
+
)
|
|
32
41
|
else:
|
|
33
42
|
# If this test runs as part of a pipeline, act like the reboot test and don't demand a manual disconnect & connect
|
|
34
43
|
utPrint(f"Publishing reboot action to {dut_mqttc.update_topic}. Awaiting reconnect.. (timeout is {TIMEOUT_IN_MINUTES} minutes)")
|
|
@@ -41,14 +50,12 @@ def run(test):
|
|
|
41
50
|
timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
|
|
42
51
|
while datetime.datetime.now() < timeout:
|
|
43
52
|
gw_type, msg = cert_common.get_gw_type(dut_mqttc)
|
|
44
|
-
gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
|
|
45
53
|
if gw_type is not None:
|
|
46
54
|
break
|
|
47
55
|
print_update_wait(5)
|
|
48
|
-
test.dut.gw_api_version = gw_api_version
|
|
49
56
|
|
|
50
57
|
# generate logs
|
|
51
|
-
cert_mqtt.generate_log_file(test, "
|
|
58
|
+
cert_mqtt.generate_log_file(test, "reboot")
|
|
52
59
|
|
|
53
60
|
# Analyze results
|
|
54
61
|
if gw_type is None:
|
|
@@ -121,7 +121,10 @@ def report_and_results(test, sniffed_pkts):
|
|
|
121
121
|
test.reason = 'No packets collected.'
|
|
122
122
|
return
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
if test.active_brg.board_type == ag.BOARD_TYPE_FANSTEL_WIFI_V0:
|
|
125
|
+
x_value = ('tx_max_retries', 'TX Max Retries')
|
|
126
|
+
else:
|
|
127
|
+
x_value = ('tx_max_duration', 'TX Max Duration')
|
|
125
128
|
|
|
126
129
|
# Create scatter with OLS trendline per channel
|
|
127
130
|
fig = px.scatter(
|
|
@@ -12,7 +12,7 @@ import math
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
# DEFINES
|
|
15
|
-
STRESS_TEST_INDICATOR = get_random_hex_str(6)
|
|
15
|
+
STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
|
|
16
16
|
|
|
17
17
|
DUPLICATES = 1
|
|
18
18
|
ADVA_ASCII_LEN = 12
|
|
@@ -51,13 +51,13 @@ def run(test):
|
|
|
51
51
|
|
|
52
52
|
cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER)
|
|
53
53
|
|
|
54
|
-
ppses = [20, 40, 60, 80, 100, 120, 140, 160, 180, 200]
|
|
55
54
|
test_pkts_received = []
|
|
56
55
|
data_pkts_received = []
|
|
57
56
|
results = []
|
|
58
|
-
for
|
|
59
|
-
phase_run_print(f"PPS = {
|
|
57
|
+
for param in test.params:
|
|
58
|
+
phase_run_print(f"PPS = {param}")
|
|
60
59
|
test.flush_all_mqtt_packets()
|
|
60
|
+
pps = param.value
|
|
61
61
|
# adv_duration is increased only for lowest pps to increase packets sample for reliable results
|
|
62
62
|
adv_duration = ADV_DURATION_LOWEST_PPS if pps == LOWEST_PPS else ADV_DURATION_DEFAULT
|
|
63
63
|
delay = math.floor(1000 / pps) # This should be bigger than 2ms
|
|
@@ -74,20 +74,17 @@ def run(test):
|
|
|
74
74
|
cert_config.gw_action(test, gw_action_cmd, TESTER)
|
|
75
75
|
mqtt_scan_wait(test, adv_duration + upload_wait_time)
|
|
76
76
|
|
|
77
|
-
cert_mqtt.dump_pkts(test, log=
|
|
77
|
+
cert_mqtt.dump_pkts(test, log=param.name)
|
|
78
78
|
phase_pkts_received = cert_mqtt.get_all_aggregated_data_pkts(test.get_mqttc_by_target(DUT), indicator=STRESS_TEST_INDICATOR)
|
|
79
|
-
valid, reason = cert_common.validate_received_packets(phase_pkts_received)
|
|
80
|
-
test.add_phase(cert_utils.Phase(pps))
|
|
81
|
-
if valid is False:
|
|
82
|
-
test.set_phase_rc(str(pps), TEST_FAILED)
|
|
83
|
-
test.add_phase_reason(str(pps), reason)
|
|
84
|
-
utPrint(f"Phase {pps} failed validation: {reason}", "RED")
|
|
85
|
-
continue
|
|
86
|
-
phase_pkts_received = [p[AGGREGATED_PAYLOAD] for p in phase_pkts_received]
|
|
87
|
-
test, received_pps = cert_common.stress_analysis(test, pps, generated_payloads, phase_pkts_received)
|
|
88
|
-
results.extend([pps, received_pps])
|
|
89
|
-
cert_mqtt.generate_log_file(test, str(pps))
|
|
90
79
|
|
|
80
|
+
test, percentage_received = cert_common.stress_analysis(
|
|
81
|
+
test, pps, generated_payloads,
|
|
82
|
+
[(p[ALIAS_BRIDGE_ID] + p[AGGREGATED_PAYLOAD]) for p in phase_pkts_received])
|
|
83
|
+
results.extend([pps, percentage_received])
|
|
84
|
+
cert_mqtt.generate_log_file(test, param.name)
|
|
85
|
+
|
|
86
|
+
test.set_phase_rc(param.name, test.rc)
|
|
87
|
+
test.add_phase_reason(param.name, test.reason)
|
|
91
88
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
92
89
|
break # break the whole for loop and keep the test as failed
|
|
93
90
|
test.reset_result() # reset result and continue to next param
|
|
@@ -96,9 +93,6 @@ def run(test):
|
|
|
96
93
|
cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
|
|
97
94
|
|
|
98
95
|
# Generate stress test graphs
|
|
99
|
-
|
|
100
|
-
cert_common.generate_graph_stress_test(test, results, data_pkts_received)
|
|
101
|
-
else:
|
|
102
|
-
utPrint("No data packets received - skipping graph generation", "RED")
|
|
96
|
+
cert_common.generate_graph_stress_test(test, results, data_pkts_received)
|
|
103
97
|
|
|
104
98
|
return cert_common.test_epilog(test)
|
|
@@ -33,11 +33,9 @@ def run(test):
|
|
|
33
33
|
timeout = datetime.datetime.now() + datetime.timedelta(minutes=TIMEOUT_IN_MINUTES)
|
|
34
34
|
while datetime.datetime.now() < timeout:
|
|
35
35
|
gw_type, msg = cert_common.get_gw_type(dut_mqttc)
|
|
36
|
-
gw_api_version = cert_common.get_gw_api_version(dut_mqttc)
|
|
37
36
|
if gw_type is not None:
|
|
38
37
|
break
|
|
39
38
|
print_update_wait(5)
|
|
40
|
-
test.dut.gw_api_version = gw_api_version
|
|
41
39
|
|
|
42
40
|
# generate logs
|
|
43
41
|
cert_mqtt.generate_log_file(test, "reboot")
|
|
@@ -77,7 +77,7 @@ def main():
|
|
|
77
77
|
cert_common.wait_time_n_print(2)
|
|
78
78
|
|
|
79
79
|
# Print results
|
|
80
|
-
cert_results.generate_results_files(html=True, pdf=True, failures=failures,
|
|
80
|
+
cert_results.generate_results_files(test.dut, test.tester, html=True, pdf=True, failures=failures,
|
|
81
81
|
skipped=skipped, start_time=start_time, tests=tests)
|
|
82
82
|
if not pipeline_running():
|
|
83
83
|
webbrowser.open('file://' + os.path.realpath(os.path.join(ARTIFACTS_DIR, UT_RESULT_FILE_PDF)))
|
|
@@ -12,7 +12,7 @@ import math
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
# DEFINES
|
|
15
|
-
STRESS_TEST_INDICATOR = get_random_hex_str(6)
|
|
15
|
+
STRESS_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
|
|
16
16
|
|
|
17
17
|
DUPLICATES = 1
|
|
18
18
|
ADVA_ASCII_LEN = 12
|
|
@@ -50,13 +50,14 @@ def run(test):
|
|
|
50
50
|
return cert_common.test_epilog(test)
|
|
51
51
|
|
|
52
52
|
cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 1', TESTER)
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
test_pkts_received = []
|
|
55
55
|
data_pkts_received = []
|
|
56
56
|
results = []
|
|
57
|
-
for
|
|
58
|
-
phase_run_print(f"PPS = {
|
|
57
|
+
for param in test.params:
|
|
58
|
+
phase_run_print(f"PPS = {param}")
|
|
59
59
|
test.flush_all_mqtt_packets()
|
|
60
|
+
pps = param.value
|
|
60
61
|
# adv_duration is increased only for lowest pps to increase packets sample for reliable results
|
|
61
62
|
adv_duration = ADV_DURATION_LOWEST_PPS if pps == LOWEST_PPS else ADV_DURATION_DEFAULT
|
|
62
63
|
delay = math.floor(1000 / pps)
|
|
@@ -72,20 +73,17 @@ def run(test):
|
|
|
72
73
|
f'{BLE_SIM_ADV_37_38_39} {delay} {BLE_SIM_RADIO_1MBPS} {adv_duration * pps}', TESTER)
|
|
73
74
|
mqtt_scan_wait(test, adv_duration + upload_wait_time)
|
|
74
75
|
|
|
75
|
-
cert_mqtt.dump_pkts(test, log=
|
|
76
|
+
cert_mqtt.dump_pkts(test, log=param.name)
|
|
76
77
|
phase_pkts_received = cert_mqtt.get_all_data_pkts(test.get_mqttc_by_target(DUT), indicator=STRESS_TEST_INDICATOR)
|
|
77
|
-
test.add_phase(cert_utils.Phase(pps))
|
|
78
|
-
valid, reason = cert_common.validate_received_packets(phase_pkts_received)
|
|
79
|
-
if valid is False:
|
|
80
|
-
test.set_phase_rc(str(pps), TEST_FAILED)
|
|
81
|
-
test.add_phase_reason(str(pps), reason)
|
|
82
|
-
utPrint(f"Phase {pps} failed validation: {reason}", "RED")
|
|
83
|
-
continue
|
|
84
|
-
phase_pkts_received = [p[PAYLOAD] for p in phase_pkts_received]
|
|
85
|
-
test, received_pps = cert_common.stress_analysis(test, pps, generated_payloads, phase_pkts_received)
|
|
86
|
-
results.extend([pps, received_pps])
|
|
87
|
-
cert_mqtt.generate_log_file(test, str(pps))
|
|
88
78
|
|
|
79
|
+
test, percentage_received = cert_common.stress_analysis(
|
|
80
|
+
test, pps, generated_payloads,
|
|
81
|
+
[(p[ALIAS_BRIDGE_ID] + p[PAYLOAD]) for p in phase_pkts_received])
|
|
82
|
+
results.extend([pps, percentage_received])
|
|
83
|
+
cert_mqtt.generate_log_file(test, param.name)
|
|
84
|
+
|
|
85
|
+
test.set_phase_rc(param.name, test.rc)
|
|
86
|
+
test.add_phase_reason(param.name, test.reason)
|
|
89
87
|
if test.rc == TEST_FAILED and test.exit_on_param_failure:
|
|
90
88
|
break # break the whole for loop and keep the test as failed
|
|
91
89
|
test.reset_result() # reset result and continue to next param
|
|
@@ -93,9 +91,7 @@ def run(test):
|
|
|
93
91
|
test_pkts_received.extend(test.get_mqttc_by_target(DUT)._userdata[PKTS].data)
|
|
94
92
|
cert_config.gw_action(test, f'{cert_gw_sim.BLE_SIM_INIT} 0', TESTER)
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
else:
|
|
99
|
-
utPrint("No data packets received - skipping graph generation", "RED")
|
|
94
|
+
# Generate stress test graphs
|
|
95
|
+
cert_common.generate_graph_stress_test(test, results, data_pkts_received)
|
|
100
96
|
|
|
101
97
|
return cert_common.test_epilog(test)
|
|
@@ -4,13 +4,14 @@ from certificate.cert_prints import *
|
|
|
4
4
|
from certificate.cert_defines import *
|
|
5
5
|
from certificate.wlt_types import *
|
|
6
6
|
import certificate.cert_common as cert_common
|
|
7
|
+
import certificate.cert_utils as cert_utils
|
|
7
8
|
import certificate.cert_mqtt as cert_mqtt
|
|
8
9
|
import certificate.cert_config as cert_config
|
|
9
10
|
import certificate.cert_data_sim as cert_data_sim
|
|
10
11
|
from certificate.cert_gw_sim import GW_CERT_TESTER
|
|
11
12
|
|
|
12
13
|
# DEFINES
|
|
13
|
-
EXT_ADV_TEST_INDICATOR = get_random_hex_str(6)
|
|
14
|
+
EXT_ADV_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
|
|
14
15
|
EXPECTED_REPEAT_COUNT = 7
|
|
15
16
|
|
|
16
17
|
|
|
@@ -4,6 +4,7 @@ from certificate.cert_defines import *
|
|
|
4
4
|
from certificate.wlt_types import *
|
|
5
5
|
from common.api_if.api_validation import api_validation
|
|
6
6
|
import certificate.cert_common as cert_common
|
|
7
|
+
import certificate.cert_utils as cert_utils
|
|
7
8
|
import certificate.cert_mqtt as cert_mqtt
|
|
8
9
|
import certificate.cert_data_sim as cert_data_sim
|
|
9
10
|
import pandas as pd
|
|
@@ -12,28 +13,24 @@ import pandas as pd
|
|
|
12
13
|
# DEFINES
|
|
13
14
|
|
|
14
15
|
API_VALIDATION = "API Validation"
|
|
15
|
-
UPLINK_TEST_INDICATOR = get_random_hex_str(6)
|
|
16
|
+
UPLINK_TEST_INDICATOR = cert_utils.get_random_hex_str(len=6)
|
|
16
17
|
NUM_OF_BRGS = 3
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
# HELPER FUNCTIONS
|
|
20
|
-
def uplink_analysis(test,
|
|
21
|
+
def uplink_analysis(test, pkts, received_pkts, pkt_type):
|
|
21
22
|
if len(received_pkts) == 0:
|
|
22
23
|
test.set_phase_rc(pkt_type, TEST_FAILED)
|
|
23
24
|
test.add_phase_reason(pkt_type, "No packets were received!")
|
|
24
|
-
return test
|
|
25
|
+
return test, 0
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
utPrint(f"Received packets from {received_brgs} bridges instead of {NUM_OF_BRGS} bridges!", "RED")
|
|
32
|
-
return test
|
|
27
|
+
_sent_pkts = []
|
|
28
|
+
for pkt in pkts:
|
|
29
|
+
pkt_str = pkt.get_pkt()
|
|
30
|
+
adva_endianness_change = cert_common.change_endianness(pkt_str[:12]) + pkt_str[12:] # Switch to big endian adva
|
|
31
|
+
_sent_pkts.append(adva_endianness_change)
|
|
33
32
|
|
|
34
|
-
_sent_pkts = [p.get_pkt()[12:] for p in sent_pkts]
|
|
35
33
|
sent_df = pd.DataFrame(_sent_pkts, columns=[PACKETS])
|
|
36
|
-
received_pkts = [p[PAYLOAD] for p in received_pkts]
|
|
37
34
|
received_df = pd.DataFrame(received_pkts, columns=[PACKETS])
|
|
38
35
|
|
|
39
36
|
merged_df = pd.merge(sent_df, received_df, on=PACKETS, how='inner')
|
|
@@ -50,17 +47,16 @@ def uplink_analysis(test, sent_pkts, received_pkts, pkt_type):
|
|
|
50
47
|
if pkts_sent_count == 0:
|
|
51
48
|
test.set_phase_rc(pkt_type, TEST_FAILED)
|
|
52
49
|
test.add_phase_reason(pkt_type, "No packets were sent!")
|
|
53
|
-
return test
|
|
50
|
+
return test, 0
|
|
54
51
|
|
|
55
52
|
percentage_received = round(pkts_received_count * 100 / pkts_sent_count)
|
|
56
53
|
|
|
57
54
|
# PASS/FAIL logic
|
|
58
55
|
if percentage_received < 80:
|
|
59
|
-
test.
|
|
60
|
-
test.
|
|
56
|
+
test.rc = TEST_FAILED
|
|
57
|
+
test.reason = f"Insufficient amount of {pkt_type} packets were scanned & uploaded by the gateway"
|
|
61
58
|
else:
|
|
62
|
-
test.
|
|
63
|
-
test.add_phase_reason(pkt_type, f'{percentage_received}% of {pkt_type} packets received')
|
|
59
|
+
test.reason = f'{percentage_received}% of {pkt_type} packets received'
|
|
64
60
|
|
|
65
61
|
return test
|
|
66
62
|
|
|
@@ -134,29 +130,25 @@ def run(test):
|
|
|
134
130
|
|
|
135
131
|
mqtt_scan_wait(test, 10 + test.dut.upload_wait_time)
|
|
136
132
|
cert_mqtt.dump_pkts(test, log=param.name)
|
|
137
|
-
pixel_sim_thread.stop()
|
|
138
133
|
all_data_messages_in_test.extend(dut_mqttc._userdata[PKTS].data)
|
|
139
134
|
all_data_pkts.extend(cert_mqtt.get_all_data_pkts(dut_mqttc))
|
|
140
135
|
recieved_pkts = cert_mqtt.get_all_data_pkts(dut_mqttc, indicator=UPLINK_TEST_INDICATOR)
|
|
141
|
-
valid, reason = cert_common.validate_received_packets(recieved_pkts)
|
|
142
|
-
if valid is False:
|
|
143
|
-
test.set_phase_rc(param.name, TEST_FAILED)
|
|
144
|
-
test.add_phase_reason(param.name, reason)
|
|
145
|
-
utPrint(f"Phase {param.name} failed validation: {reason}", "RED")
|
|
146
|
-
continue
|
|
147
136
|
|
|
148
|
-
test = uplink_analysis(test, pkts, recieved_pkts, param.name)
|
|
137
|
+
test = uplink_analysis(test, pkts, [p[ALIAS_BRIDGE_ID] + p[PAYLOAD] for p in recieved_pkts], param.name)
|
|
149
138
|
|
|
150
139
|
cert_mqtt.generate_log_file(test, param.name)
|
|
151
|
-
field_functionality_pass_fail_print(test
|
|
152
|
-
|
|
140
|
+
field_functionality_pass_fail_print(test, 'pkt_type', value=param.name)
|
|
141
|
+
test.set_phase_rc(param.name, test.rc)
|
|
142
|
+
test.add_phase_reason(param.name, test.reason)
|
|
143
|
+
if test.rc == TEST_FAILED:
|
|
153
144
|
if test.exit_on_param_failure:
|
|
154
145
|
break # break the whole for loop and keep the test as failed
|
|
155
146
|
test.reset_result() # reset result and continue to next param
|
|
156
147
|
|
|
157
148
|
# Other Validations
|
|
158
149
|
# Api Validation
|
|
159
|
-
|
|
150
|
+
if not test.dut.protobuf:
|
|
151
|
+
test = api_validation(test)
|
|
160
152
|
test = cert_common.wiliot_pkts_validation(test, all_data_messages_in_test, all_data_pkts)
|
|
161
153
|
|
|
162
154
|
# Geolocation phase
|
|
@@ -105,15 +105,11 @@ def aging_analysis(test, datapath_module, pacer_interval, num_of_sim_tags):
|
|
|
105
105
|
if test.rc == TEST_FAILED:
|
|
106
106
|
return test
|
|
107
107
|
utPrint(f"\nEnd of aging time pixels count: {second_floor_tags_ctr}\n", "BLUE")
|
|
108
|
-
if test.sterile_run and second_floor_tags_ctr != 0
|
|
108
|
+
if ((test.sterile_run and second_floor_tags_ctr != 0) or
|
|
109
|
+
(not test.sterile_run and second_floor_tags_ctr > TAGS_CTR_OVER_THRESHOLD * first_floor_tags_ctr)):
|
|
109
110
|
test.rc = TEST_FAILED
|
|
110
111
|
test.add_reason("Pixel count is higher than expected. Looks like aging time is too long.\n"
|
|
111
|
-
f"
|
|
112
|
-
elif not test.sterile_run and (second_floor_tags_ctr > TAGS_CTR_OVER_THRESHOLD * first_floor_tags_ctr):
|
|
113
|
-
test.rc = TEST_FAILED
|
|
114
|
-
test.add_reason("Pixel count is higher than expected. Looks like aging time is too long.\n"
|
|
115
|
-
f"Number of pixels after aging time: {second_floor_tags_ctr},"
|
|
116
|
-
f" before tags simulation was: {second_peak_tags_ctr}\n")
|
|
112
|
+
f"tags_ctr value: {second_peak_tags_ctr}\nFloor number of pixels: {second_floor_tags_ctr}")
|
|
117
113
|
return test
|
|
118
114
|
|
|
119
115
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Event Test BLE 5",
|
|
3
3
|
"module": "Datapath",
|
|
4
|
-
"purpose": "Test
|
|
4
|
+
"purpose": "Test pacing disable (later dynamic pacing)",
|
|
5
5
|
"documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Pacing"],
|
|
6
6
|
"initialCondition": "Bridge & data simulator configured to defaults",
|
|
7
7
|
"procedure": ["Test prolog",
|
|
@@ -12,6 +12,5 @@
|
|
|
12
12
|
"multiBridgeTest": 0,
|
|
13
13
|
"gwOnlyTest": 0,
|
|
14
14
|
"dataSimOnlyTest": 1,
|
|
15
|
-
"
|
|
16
|
-
"allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
|
|
15
|
+
"allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
|
|
17
16
|
}
|
|
@@ -7,9 +7,17 @@ import certificate.cert_config as cert_config
|
|
|
7
7
|
|
|
8
8
|
NEW_TAG_EVENT_SCAN_TIME = 100 # in seconds
|
|
9
9
|
TAG_EVENT_SCAN_TIME = 60 # in seconds
|
|
10
|
+
NEW_TAG_HOURS_EVENT_SCAN_TIME = 62 * 60 # 62 minutes
|
|
10
11
|
RSSI_MOVEMENT_THRESHOLD = 15
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
def test_new_tag_event_hours(test, phase, datapath_module):
|
|
15
|
+
values = [ag.EVENT_TIME_UNIT_HOURS, TEST_EVENT_WINDOW_HR_CFG, ag.RX_CHANNEL_10_500K, ag.EVENT_TRIGGER_NEW_TAG, 0]
|
|
16
|
+
return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_HOURS_EVENT_SCAN_TIME,
|
|
17
|
+
ag.EVENT_TIME_UNIT_HOURS, ble5_test=True,
|
|
18
|
+
pkt_filter_cfg=ag.PKT_FILTER_TEMP_AND_ADVANCED_PKTS)
|
|
19
|
+
|
|
20
|
+
|
|
13
21
|
def test_new_tag_event_minutes(test, phase, datapath_module):
|
|
14
22
|
values = [ag.EVENT_TIME_UNIT_MINUTES, TEST_EVENT_WINDOW_MIN_CFG, ag.RX_CHANNEL_10_500K, ag.EVENT_TRIGGER_NEW_TAG, 0]
|
|
15
23
|
return cert_common.run_event_test_phase(test, phase, datapath_module, values, NEW_TAG_EVENT_SCAN_TIME,
|
|
@@ -46,7 +54,7 @@ def test_rssi_event(test, phase, datapath_module):
|
|
|
46
54
|
|
|
47
55
|
|
|
48
56
|
EVENT_TEST_MAP = {"rssi_event": test_rssi_event, "new_tag_event_seconds": test_new_tag_event_seconds,
|
|
49
|
-
"new_tag_event_minutes": test_new_tag_event_minutes,
|
|
57
|
+
"new_tag_event_minutes": test_new_tag_event_minutes, "new_tag_event_hours": test_new_tag_event_hours,
|
|
50
58
|
"temp_event": test_temp_event, "tx_rate_event": test_tx_rate_event}
|
|
51
59
|
|
|
52
60
|
|
|
@@ -55,11 +63,10 @@ def run(test):
|
|
|
55
63
|
test = cert_common.test_prolog(test)
|
|
56
64
|
if test.rc == TEST_FAILED:
|
|
57
65
|
return cert_common.test_epilog(test)
|
|
58
|
-
dut = cert_config.get_brg_by_target(test, DUT)
|
|
59
66
|
|
|
60
67
|
for param in test.params:
|
|
61
68
|
phase_run_print(param.name)
|
|
62
|
-
test = EVENT_TEST_MAP[param.value](test, param.name,
|
|
69
|
+
test = EVENT_TEST_MAP[param.value](test, param.name, test.active_brg.datapath)
|
|
63
70
|
cert_mqtt.generate_log_file(test, param.name)
|
|
64
71
|
field_functionality_pass_fail_print(test, param.name)
|
|
65
72
|
test.set_phase_rc(param.name, test.rc)
|
|
@@ -72,11 +79,10 @@ def run(test):
|
|
|
72
79
|
continue
|
|
73
80
|
|
|
74
81
|
# Reset to defaults after every phase (don't fail the phase on that)
|
|
75
|
-
test = cert_config.config_brg_defaults(test, modules=[
|
|
82
|
+
test = cert_config.config_brg_defaults(test, modules=[test.active_brg.datapath], ble5=True)[0]
|
|
83
|
+
print_update_wait(2 * BLE5_MAX_DURATION_SEC)
|
|
76
84
|
if test.rc == TEST_FAILED:
|
|
77
85
|
test.add_reason("Failed to restore brg to defaults")
|
|
78
|
-
if test.dut_is_bridge():
|
|
79
|
-
wait_time_n_print(BLE5_MAX_DURATION_SEC)
|
|
80
86
|
|
|
81
87
|
if test.rc == TEST_FAILED:
|
|
82
88
|
test.set_phase_rc(param.name, test.rc)
|
|
@@ -86,4 +92,4 @@ def run(test):
|
|
|
86
92
|
else:
|
|
87
93
|
test.reset_result()
|
|
88
94
|
|
|
89
|
-
return cert_common.test_epilog(test, revert_brgs=True, modules=[
|
|
95
|
+
return cert_common.test_epilog(test, revert_brgs=True, modules=[test.active_brg.datapath], ble5=True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Event Test",
|
|
3
3
|
"module": "Datapath",
|
|
4
|
-
"purpose": "Test
|
|
4
|
+
"purpose": "Test pacing disable for tags that had location events",
|
|
5
5
|
"documentation": ["https://community.wiliot.com/customers/s/article/Wiliot-Network-Data-Path-Module-Pacing"],
|
|
6
6
|
"initialCondition": "Bridge & data simulator configured to defaults",
|
|
7
7
|
"procedure": ["Test prolog",
|
|
@@ -12,6 +12,5 @@
|
|
|
12
12
|
"multiBridgeTest": 0,
|
|
13
13
|
"gwOnlyTest": 0,
|
|
14
14
|
"dataSimOnlyTest": 1,
|
|
15
|
-
"
|
|
16
|
-
"allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "temp_event", "tx_rate_event"]
|
|
15
|
+
"allSupportedValues": ["rssi_event", "new_tag_event_seconds", "new_tag_event_minutes", "new_tag_event_hours", "temp_event", "tx_rate_event"]
|
|
17
16
|
}
|