mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Add YT8531/S31 tests for esp_eth, eth basic, and iperf. Remove test_apps coverage of drivers maintained outside IDF.
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
|
import platform
|
|
import subprocess
|
|
|
|
import pytest
|
|
from pytest_embedded import Dut
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
'config, target',
|
|
[
|
|
pytest.param('defaults', 'esp32', marks=[pytest.mark.eth_ip101]),
|
|
pytest.param('lan8720_esp32', 'esp32', marks=[pytest.mark.eth_lan8720]),
|
|
pytest.param('defaults_esp32p4', 'esp32p4', marks=[pytest.mark.eth_ip101]),
|
|
pytest.param('defaults_esp32p4v1', 'esp32p4', marks=[pytest.mark.eth_ip101, pytest.mark.esp32p4_rev1]),
|
|
pytest.param('defaults_esp32s31', 'esp32s31', marks=[pytest.mark.eth_yt8531]),
|
|
],
|
|
indirect=['target'],
|
|
)
|
|
def test_esp_eth_basic(dut: Dut) -> None:
|
|
# wait for ip received
|
|
dut_ip = dut.expect(r'esp_netif_handlers: .+ ip: (\d+\.\d+\.\d+\.\d+),').group(1)
|
|
# ping it once
|
|
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
|
command = ['ping', param, '1', dut_ip]
|
|
output = subprocess.run(command, capture_output=True)
|
|
if 'unreachable' in str(output.stdout):
|
|
raise RuntimeError('Host unreachable')
|