Skip to content

Commit

Permalink
Merge branch 'backport/add_thread_curl_https_ci_case_v5.3' into 'rele…
Browse files Browse the repository at this point in the history
…ase/v5.3'

feat(openthread): add thread curl https ci case (Backport v5.3)

See merge request espressif/esp-idf!33586
  • Loading branch information
chshu committed Sep 19, 2024
2 parents 7fbc78d + 307df28 commit 01613ca
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions examples/openthread/pytest_otbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@
# Case 9: TCP communication via NAT64
# Thread device (IPV6) send tcp message to the host device (IPV4) via NAT64.

# Case 10: Sleepy device test
# Start a Thread sleepy device, wait it join the Thread network and check related flags.

# Case 11: Basic startup Test of BR
# Test the basic startup and network formation of a Thread device.

# Case 12: Curl a website via DNS and NAT64
# A border router joins a Wi-Fi network and forms a Thread network, a Thread devices attached to it and curl a website.

# Case 13: Meshcop discovery of Border Router
# A border router joins a Wi-Fi network, forms a Thread network and publish a meshcop service. Linux Host device discover the mescop service.

# Case 14: Curl a website over HTTPS via DNS and NAT64
# A border router joins a Wi-Fi network and forms a Thread network, a Thread devices attached to it and curl a https website.


@pytest.fixture(scope='module', name='Init_avahi')
def fixture_Init_avahi() -> bool:
Expand Down Expand Up @@ -736,3 +751,39 @@ def test_br_meshcop(Init_interface:bool, Init_avahi:bool, dut: Tuple[IdfDut, Idf
finally:
ocf.execute_command(br, 'factoryreset')
time.sleep(3)


# Case 14: Curl a website over HTTPS via DNS and NAT64
@pytest.mark.supported_targets
@pytest.mark.esp32h2
@pytest.mark.esp32c6
@pytest.mark.openthread_bbr
@pytest.mark.flaky(reruns=1, reruns_delay=1)
@pytest.mark.parametrize(
'config, count, app_path, target', [
('rcp|cli_h2|br', 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")}',
'esp32c6|esp32h2|esp32s3'),
],
indirect=True,
)
def test_https_NAT64_DNS(Init_interface:bool, dut: Tuple[IdfDut, IdfDut, IdfDut]) -> None:
br = dut[2]
cli = dut[1]
assert Init_interface
dut[0].serial.stop_redirect_thread()

formBasicWiFiThreadNetwork(br, cli)
try:
ocf.execute_command(cli, 'dns64server 8.8.8.8')
cli.expect('Done', timeout=5)
command = 'curl https://www.example.com/'
message = ocf.get_ouput_string(cli, command, 20)
assert '<html>' in str(message)
assert 'This domain is for use in illustrative examples in documents' in str(message)
finally:
ocf.execute_command(br, 'factoryreset')
ocf.execute_command(cli, 'factoryreset')
time.sleep(3)

0 comments on commit 01613ca

Please sign in to comment.