mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-13 21:55:07 +00:00
CI: fix ipv6 test failed on some runners
This commit is contained in:
@@ -11,9 +11,9 @@ import socket
|
||||
import sys
|
||||
from threading import Event, Thread
|
||||
|
||||
import netifaces
|
||||
import ttfw_idf
|
||||
from common_test_methods import get_env_config_variable, get_host_ip_by_interface, get_my_interface_by_dest_ip
|
||||
from common_test_methods import (get_env_config_variable, get_host_ip4_by_dest_ip, get_host_ip6_by_dest_ip,
|
||||
get_my_interface_by_dest_ip)
|
||||
|
||||
# ----------- Config ----------
|
||||
PORT = 3333
|
||||
@@ -107,13 +107,13 @@ def test_examples_protocol_socket_tcpclient(env, extra_data):
|
||||
my_interface = get_my_interface_by_dest_ip(ipv4)
|
||||
# test IPv4
|
||||
with TcpServer(PORT, socket.AF_INET):
|
||||
server_ip = get_host_ip_by_interface(my_interface, netifaces.AF_INET)
|
||||
server_ip = get_host_ip4_by_dest_ip(ipv4)
|
||||
print('Connect tcp client to server IP={}'.format(server_ip))
|
||||
dut1.write(server_ip)
|
||||
dut1.expect(re.compile(r'OK: Message from ESP32'))
|
||||
# test IPv6
|
||||
with TcpServer(PORT, socket.AF_INET6):
|
||||
server_ip = get_host_ip_by_interface(my_interface, netifaces.AF_INET6)
|
||||
server_ip = get_host_ip6_by_dest_ip(ipv6, my_interface)
|
||||
print('Connect tcp client to server IP={}'.format(server_ip))
|
||||
dut1.write(server_ip)
|
||||
dut1.expect(re.compile(r'OK: Message from ESP32'))
|
||||
|
Reference in New Issue
Block a user