mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
CI: fix connection failures in asio example tests
This commit is contained in:
parent
62359f3442
commit
9703c1a32f
@ -38,6 +38,7 @@ def test_examples_protocol_asio_chat_server(env, extra_data):
|
|||||||
# 2. get the server IP address
|
# 2. get the server IP address
|
||||||
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
||||||
# 3. create tcp client and connect to server
|
# 3. create tcp client and connect to server
|
||||||
|
dut1.expect('ASIO engine is up and running', timeout=1)
|
||||||
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
cli.settimeout(30)
|
cli.settimeout(30)
|
||||||
cli.connect((data[0],80))
|
cli.connect((data[0],80))
|
||||||
|
@ -208,6 +208,8 @@ int asio_main()
|
|||||||
servers.emplace_back(io_context, endpoint);
|
servers.emplace_back(io_context, endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "ASIO engine is up and running" << std::endl;
|
||||||
|
|
||||||
io_context.run();
|
io_context.run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -40,6 +40,7 @@ def test_examples_protocol_asio_tcp_server(env, extra_data):
|
|||||||
# 2. get the server IP address
|
# 2. get the server IP address
|
||||||
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
||||||
# 3. create tcp client and connect to server
|
# 3. create tcp client and connect to server
|
||||||
|
dut1.expect('ASIO engine is up and running', timeout=1)
|
||||||
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
cli.settimeout(30)
|
cli.settimeout(30)
|
||||||
cli.connect((data[0],80))
|
cli.connect((data[0],80))
|
||||||
|
@ -86,6 +86,8 @@ void asio_main()
|
|||||||
|
|
||||||
server s(io_context, std::atoi(CONFIG_EXAMPLE_PORT));
|
server s(io_context, std::atoi(CONFIG_EXAMPLE_PORT));
|
||||||
|
|
||||||
|
std::cout << "ASIO engine is up and running" << std::endl;
|
||||||
|
|
||||||
io_context.run();
|
io_context.run();
|
||||||
|
|
||||||
}
|
}
|
@ -40,6 +40,7 @@ def test_examples_protocol_asio_udp_server(env, extra_data):
|
|||||||
# 2. get the server IP address
|
# 2. get the server IP address
|
||||||
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
data = dut1.expect(re.compile(r" sta ip: ([^,]+),"), timeout=30)
|
||||||
# 3. create tcp client and connect to server
|
# 3. create tcp client and connect to server
|
||||||
|
dut1.expect('ASIO engine is up and running', timeout=1)
|
||||||
cli = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
cli = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
cli.settimeout(30)
|
cli.settimeout(30)
|
||||||
cli.connect((data[0], 80))
|
cli.connect((data[0], 80))
|
||||||
|
@ -65,5 +65,7 @@ void asio_main()
|
|||||||
|
|
||||||
server s(io_context, std::atoi(CONFIG_EXAMPLE_PORT));
|
server s(io_context, std::atoi(CONFIG_EXAMPLE_PORT));
|
||||||
|
|
||||||
|
std::cout << "ASIO engine is up and running" << std::endl;
|
||||||
|
|
||||||
io_context.run();
|
io_context.run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user