mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'feat/add_thread_ssed_ci_test_scenario_v5.5' into 'release/v5.5'
feat: add thread ssed ci testcase scenario (v5.5) See merge request espressif/esp-idf!51498
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
import ipaddress
|
import ipaddress
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
@@ -265,11 +266,20 @@ def ot_ping(
|
|||||||
return tx_count, rx_count
|
return tx_count, rx_count
|
||||||
|
|
||||||
|
|
||||||
def ping_and_check(dut: IdfDut, target: str, tx_total: int = 10, timeout: int = 6, pass_rate: float = 0.8) -> None:
|
def ping_and_check(
|
||||||
|
dut: IdfDut,
|
||||||
|
target: str,
|
||||||
|
tx_total: int = 10,
|
||||||
|
timeout: int = 6,
|
||||||
|
pass_rate: float = 0.8,
|
||||||
|
size: int = 10,
|
||||||
|
size_range: Optional[Tuple[int, int]] = None,
|
||||||
|
) -> None:
|
||||||
tx_count = 0
|
tx_count = 0
|
||||||
rx_count = 0
|
rx_count = 0
|
||||||
for _ in range(tx_total):
|
for _ in range(tx_total):
|
||||||
tx, rx = ot_ping(dut, target, timeout=timeout, count=1, size=10, interval=6)
|
ping_size = random.randint(*size_range) if size_range else size
|
||||||
|
tx, rx = ot_ping(dut, target, timeout=timeout, count=1, size=ping_size, interval=6)
|
||||||
tx_count += tx
|
tx_count += tx
|
||||||
rx_count += rx
|
rx_count += rx
|
||||||
|
|
||||||
|
|||||||
@@ -1160,9 +1160,9 @@ def test_ot_ssed_device(dut: Tuple[IdfDut, IdfDut]) -> None:
|
|||||||
cli_rloc_addr = ':'.join(ocf.get_rloc_addr(leader).split(':')[:-1])
|
cli_rloc_addr = ':'.join(ocf.get_rloc_addr(leader).split(':')[:-1])
|
||||||
ssed_address = f'{cli_rloc_addr}:{rloc16_decode_from_leader}'
|
ssed_address = f'{cli_rloc_addr}:{rloc16_decode_from_leader}'
|
||||||
|
|
||||||
ocf.ping_and_check(dut=leader, target=ssed_address, tx_total=10, timeout=6)
|
ocf.ping_and_check(dut=leader, target=ssed_address, tx_total=10, timeout=6, size_range=(10, 70))
|
||||||
time.sleep(random.randint(5, 20))
|
time.sleep(random.randint(5, 20))
|
||||||
ocf.ping_and_check(dut=leader, target=ssed_address, tx_total=10, timeout=6)
|
ocf.ping_and_check(dut=leader, target=ssed_address, tx_total=10, timeout=6, size_range=(100, 200))
|
||||||
finally:
|
finally:
|
||||||
ocf.execute_command(leader, 'factoryreset')
|
ocf.execute_command(leader, 'factoryreset')
|
||||||
ocf.hardreset_dut(ssed_device)
|
ocf.hardreset_dut(ssed_device)
|
||||||
|
|||||||
Reference in New Issue
Block a user