Merge branch 'feature/use_fixed_dut_in_ot_ci_cases_v5.3' into 'release/v5.3'

feat(openthread): use fixed port in ot ci cases (Backport v5.3)

See merge request espressif/esp-idf!36047
This commit is contained in:
Shu Chen
2024-12-31 12:00:08 +08:00

View File

@ -84,26 +84,44 @@ def fixture_Init_interface() -> bool:
default_br_ot_para = ocf.thread_parameter('leader', '', '12', '7766554433221100', True) default_br_ot_para = ocf.thread_parameter('leader', '', '12', '7766554433221100', True)
default_br_wifi_para = ocf.wifi_parameter('OTCITE', 'otcitest888', 10) default_br_wifi_para = ocf.wifi_parameter('OTCITE', 'otcitest888', 10)
default_cli_ot_para = ocf.thread_parameter('router', '', '', '', False) default_cli_ot_para = ocf.thread_parameter('router', '', '', '', False)
ESPPORT1 = os.getenv('ESPPORT1')
ESPPORT2 = os.getenv('ESPPORT2')
ESPPORT3 = os.getenv('ESPPORT3')
PORT_MAPPING = {
'ESPPORT1': 'esp32h2',
'ESPPORT2': 'esp32s3',
'ESPPORT3': 'esp32c6'
}
# Case 1: Thread network formation and attaching # Case 1: Thread network formation and attaching
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
('rcp_spi|cli|br_spi', 3, f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'esp32c6|esp32h2|esp32s3',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
'esp32h2|esp32c6|esp32s3'), id='c6-h2-s3'
),
pytest.param(
'rcp_spi|cli|br_spi',
3,
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32h2|esp32c6|esp32s3',
f'{ESPPORT1}|{ESPPORT3}|{ESPPORT2}',
id='h2-c6-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -163,17 +181,21 @@ def formBasicWiFiThreadNetwork(br:IdfDut, cli:IdfDut) -> None:
# Case 2: Bidirectional IPv6 connectivity # Case 2: Bidirectional IPv6 connectivity
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -212,17 +234,21 @@ def test_Bidirectional_IPv6_connectivity(Init_interface:bool, dut: Tuple[IdfDut,
# Case 3: Multicast forwarding from Wi-Fi to Thread network # Case 3: Multicast forwarding from Wi-Fi to Thread network
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -262,17 +288,21 @@ def test_multicast_forwarding_A(Init_interface:bool, dut: Tuple[IdfDut, IdfDut,
# Case 4: Multicast forwarding from Thread to Wi-Fi network # Case 4: Multicast forwarding from Thread to Wi-Fi network
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -313,17 +343,21 @@ def test_multicast_forwarding_B(Init_interface:bool, dut: Tuple[IdfDut, IdfDut,
# Case 5: discover dervice published by Thread device # Case 5: discover dervice published by Thread device
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -369,17 +403,21 @@ def test_service_discovery_of_Thread_device(Init_interface:bool, Init_avahi:bool
# Case 6: discover dervice published by Wi-Fi device # Case 6: discover dervice published by Wi-Fi device
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -432,17 +470,21 @@ def test_service_discovery_of_WiFi_device(Init_interface:bool, Init_avahi:bool,
# Case 7: ICMP communication via NAT64 # Case 7: ICMP communication via NAT64
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -467,17 +509,21 @@ def test_ICMP_NAT64(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) ->
# Case 8: UDP communication via NAT64 # Case 8: UDP communication via NAT64
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -520,17 +566,21 @@ def test_UDP_NAT64(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) -> N
# Case 9: TCP communication via NAT64 # Case 9: TCP communication via NAT64
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -582,15 +632,26 @@ def test_TCP_NAT64(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) -> N
@pytest.mark.esp32c6 @pytest.mark.esp32c6
@pytest.mark.openthread_sleep @pytest.mark.openthread_sleep
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('cli|sleepy', 2, [
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device/light_sleep")}', 'cli|sleepy',
'esp32h2|esp32c6'), 2,
('cli|sleepy', 2, f'{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}' f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device/light_sleep")}',
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device/light_sleep")}', 'esp32h2|esp32c6',
'esp32c6|esp32h2'), f'{ESPPORT1}|{ESPPORT3}',
id='h2-c6'
),
pytest.param(
'cli|sleepy',
2,
f'{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_sleepy_device/light_sleep")}',
'esp32c6|esp32h2',
f'{ESPPORT3}|{ESPPORT1}',
id='c6-h2'
),
], ],
indirect=True, indirect=True,
) )
@ -628,16 +689,20 @@ def test_ot_sleepy_device(dut: Tuple[IdfDut, IdfDut]) -> None:
# Case 11: Basic startup Test of BR # Case 11: Basic startup Test of BR
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|br', 2, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 'rcp_uart|br',
'esp32c6|esp32s3'), 2,
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32s3',
f'{ESPPORT3}|{ESPPORT2}',
id='c6-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -666,17 +731,21 @@ def test_basic_startup(dut: Tuple[IdfDut, IdfDut]) -> None:
# Case 12: Curl a website via DNS and NAT64 # Case 12: Curl a website via DNS and NAT64
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_bbr @pytest.mark.openthread_bbr
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -704,15 +773,20 @@ def test_NAT64_DNS(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) -> N
# Case 13: Meshcop discovery of Border Router # Case 13: Meshcop discovery of Border Router
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|br', 2, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 'rcp_uart|br',
'esp32c6|esp32s3'), 2,
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32s3',
f'{ESPPORT3}|{ESPPORT2}',
id='c6-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -761,17 +835,21 @@ def test_br_meshcop(Init_interface:bool, Init_avahi:bool, dut: Tuple[IdfDut, Idf
# Case 14: Curl a website over HTTPS via DNS and NAT64 # Case 14: Curl a website over HTTPS via DNS and NAT64
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_bbr @pytest.mark.openthread_bbr
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('rcp_uart|cli|br', 3, [
f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}' 'rcp_uart|cli|br',
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}', 3,
'esp32c6|esp32h2|esp32s3'), f'{os.path.join(os.path.dirname(__file__), "ot_rcp")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_cli")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_br")}',
'esp32c6|esp32h2|esp32s3',
f'{ESPPORT3}|{ESPPORT1}|{ESPPORT2}',
id='c6-h2-s3'
),
], ],
indirect=True, indirect=True,
) )
@ -797,15 +875,20 @@ def test_https_NAT64_DNS(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]
# Case 15: Thread network formation and attaching with TREL # Case 15: Thread network formation and attaching with TREL
@pytest.mark.supported_targets @pytest.mark.supported_targets
@pytest.mark.esp32c6
@pytest.mark.openthread_br @pytest.mark.openthread_br
@pytest.mark.flaky(reruns=1, reruns_delay=1) @pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize( @pytest.mark.parametrize(
'config, count, app_path, target', [ 'config, count, app_path, target, port',
('trel|trel', 2, [
f'{os.path.join(os.path.dirname(__file__), "ot_trel")}' pytest.param(
f'|{os.path.join(os.path.dirname(__file__), "ot_trel")}', 'trel|trel',
'esp32c6|esp32s3'), 2,
f'{os.path.join(os.path.dirname(__file__), "ot_trel")}'
f'|{os.path.join(os.path.dirname(__file__), "ot_trel")}',
'esp32c6|esp32s3',
f'{ESPPORT3}|{ESPPORT2}',
id='c6-s3'
),
], ],
indirect=True, indirect=True,
) )