From d1dee48b2dd884efabc17ce8681266c348795df3 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Thu, 9 Dec 2021 07:37:26 +0100 Subject: [PATCH] CI: Use Console.logs instead of prints in eth test apps --- components/esp_eth/test_apps/component_ut_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_eth/test_apps/component_ut_test.py b/components/esp_eth/test_apps/component_ut_test.py index 37a026ca81..3edca9dd52 100644 --- a/components/esp_eth/test_apps/component_ut_test.py +++ b/components/esp_eth/test_apps/component_ut_test.py @@ -4,6 +4,7 @@ import socket import tiny_test_fw import ttfw_idf +from tiny_test_fw import Utility from ttfw_idf import TestFormat try: @@ -17,14 +18,14 @@ def configure_eth_if(func): # type: (typing.Any) -> typing.Any # try to determine which interface to use netifs = os.listdir('/sys/class/net/') target_if = '' - print('detected interfaces: ' + str(netifs)) + Utility.console_log('detected interfaces: ' + str(netifs)) for netif in netifs: if netif.find('eth') == 0 or netif.find('enp') == 0 or netif.find('eno') == 0: target_if = netif break if target_if == '': raise Exception('no network interface found') - print('Use ' + target_if + ' for testing') + Utility.console_log('Use ' + target_if + ' for testing') so = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 0x2222) so.bind((target_if, 0)) @@ -81,6 +82,7 @@ def test_component_ut_esp_eth(env, appname): # type: (tiny_test_fw.Env, str) -> expect_result = dut.expect(re.compile(r'([\s\S]*)DUT MAC: ([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})'), timeout=10) stdout = expect_result[0] + Utility.console_log('DUTs MAC address: {}'.format(expect_result[1])) send_eth_packet(bytes.fromhex('ffffffffffff')) # broadcast frame send_eth_packet(bytes.fromhex('010000000000')) # multicast frame send_eth_packet(bytes.fromhex(expect_result[1].replace(':', ''))) # unicast frame