diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index af65d00cf0..9d76504e1b 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -463,6 +463,15 @@ pytest_examples_esp32_ethernet_vlan: artifacts: false tags: [ esp32, ethernet_vlan ] +pytest_examples_esp32_ethernet_ip101: + extends: + - .pytest_examples_dir_template + - .rules:test:example_test-esp32 + needs: + - job: build_pytest_examples_esp32 + artifacts: false + tags: [ esp32, eth_ip101 ] + pytest_examples_esp32_ethernet_bridge: extends: - .pytest_examples_dir_template @@ -715,6 +724,15 @@ pytest_components_esp32_sdio: artifacts: false tags: [ esp32, sdio_master_slave ] +pytest_components_esp32_ip101: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32 + needs: + - job: build_pytest_components_esp32 + artifacts: false + tags: [ esp32, eth_ip101 ] + pytest_components_esp32_lan8720: extends: - .pytest_components_dir_template diff --git a/components/esp_eth/test_apps/pytest_esp_eth.py b/components/esp_eth/test_apps/pytest_esp_eth.py index e6b83c4980..54d29497b5 100644 --- a/components/esp_eth/test_apps/pytest_esp_eth.py +++ b/components/esp_eth/test_apps/pytest_esp_eth.py @@ -24,6 +24,7 @@ class EthTestIntf(object): def find_target_if(self, my_if: str = '') -> None: # try to determine which interface to use netifs = os.listdir('/sys/class/net/') + # order matters - ETH NIC with the highest number is connected to DUT on CI runner netifs.sort(reverse=True) logging.info('detected interfaces: %s', str(netifs)) @@ -203,7 +204,7 @@ def test_esp_emac_hal(dut: IdfDut) -> None: @pytest.mark.esp32 -@pytest.mark.ip101 +@pytest.mark.eth_ip101 @pytest.mark.parametrize('config', [ 'default_ip101', ], indirect=True) diff --git a/examples/protocols/l2tap/pytest_example_l2tap_echo.py b/examples/protocols/l2tap/pytest_example_l2tap_echo.py index 7bbf205931..ca6a5e6c4d 100644 --- a/examples/protocols/l2tap/pytest_example_l2tap_echo.py +++ b/examples/protocols/l2tap/pytest_example_l2tap_echo.py @@ -22,6 +22,8 @@ def configure_eth_if(eth_type: int, target_if: str='') -> Iterator[socket.socket if target_if == '': # try to determine which interface to use netifs = os.listdir('/sys/class/net/') + # order matters - ETH NIC with the highest number is connected to DUT on CI runner + netifs.sort(reverse=True) logging.info('detected interfaces: %s', str(netifs)) for netif in netifs: if netif.find('eth') == 0 or netif.find('enx') == 0 or netif.find('enp') == 0 or netif.find('eno') == 0: @@ -100,7 +102,7 @@ def actual_test(dut: Dut) -> None: @pytest.mark.esp32 # internally tested using ESP32 with IP101 but may support all targets with SPI Ethernet -@pytest.mark.ip101 +@pytest.mark.eth_ip101 @pytest.mark.flaky(reruns=3, reruns_delay=5) def test_esp_netif_l2tap_example(dut: Dut) -> None: actual_test(dut) diff --git a/tools/ci/idf_pytest/constants.py b/tools/ci/idf_pytest/constants.py index 918ce54a2a..078e505346 100644 --- a/tools/ci/idf_pytest/constants.py +++ b/tools/ci/idf_pytest/constants.py @@ -42,7 +42,7 @@ ENV_MARKERS = { # single-dut markers 'generic': 'tests should be run on generic runners', 'flash_suspend': 'support flash suspend feature', - 'ip101': 'connected via wired 10/100M ethernet', + 'eth_ip101': 'connected via wired 10/100M ethernet', 'eth_lan8720': 'connected via LAN8720 ethernet transceiver', 'eth_rtl8201': 'connected via RTL8201 ethernet transceiver', 'eth_ksz8041': 'connected via KSZ8041 ethernet transceiver',