fix(usb_device): Fix failing NCM device test by increasing dealy for the network ifc

This commit is contained in:
peter.marcisovsky
2025-04-11 16:49:04 +02:00
parent 771e9db73e
commit dbc111ebff

View File

@ -13,12 +13,14 @@ from pytest_embedded_idf.utils import idf_parametrize
@idf_parametrize('target', ['esp32s2', 'esp32s3'], indirect=['target'])
def test_usb_device_ncm_example(dut: Dut) -> None:
netif_mac = dut.expect(
r'Network interface HW address: ([0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2})'
r'Network interface HW address: '
r'([0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:'
r'[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2})'
)
netif_mac = netif_mac.group(1).decode('utf-8')
dut.expect_exact('USB NCM and WiFi initialized and started')
dut.expect_exact('Returned from app_main()')
time.sleep(1) # Wait 1s for the network interface to appear
time.sleep(2) # Wait 2s for the network interface to appear
out_bytes = subprocess.check_output('ifconfig', shell=True, timeout=5)
out_str = out_bytes.decode('utf-8')
print('expected network interface HW address: ', netif_mac)