Skip to content
Snippets Groups Projects
Commit 9f0f5384 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix socket.test to work without Internet connection

Failed in a plane.
parent e150b8a6
No related branches found
No related tags found
No related merge requests found
......@@ -658,10 +658,6 @@ test_run:cmd("setopt delimiter ''");
---
- true
...
#(socket.getaddrinfo('tarantool.org', 'http', {})) > 0
---
- true
...
wrong_addr = socket.getaddrinfo('non-existing-domain-name-12211alklkl.com', 'http', {})
---
...
......@@ -879,36 +875,7 @@ sc:close()
- true
...
-- tcp_connect
s = socket.tcp_connect('tarantool.org', 80)
---
...
string.match(tostring(s), ', aka') ~= nil
---
- true
...
string.match(tostring(s), ', peer') ~= nil
---
- true
...
s:write("HEAD / HTTP/1.0\r\nHost: tarantool.org\r\n\r\n")
---
- 40
...
header = s:read({chunk = 4000, delimiter = {"\n\n", "\r\n\r\n" }}, 1)
---
...
string.match(header, "\r\n\r\n$") ~= nil
---
- true
...
string.match(header, "200 [Oo][Kk]") ~= nil
---
- true
...
s:close()
---
- true
...
-- test timeout
socket.tcp_connect('127.0.0.1', 80, 0.00000000001)
---
- null
......
......@@ -213,7 +213,6 @@ aexitst( socket.getaddrinfo('localhost', 'http', { protocol = 'tcp',
type = 'SOCK_STREAM'}), {'127.0.0.1', '::1'}, 80 );
test_run:cmd("setopt delimiter ''");
#(socket.getaddrinfo('tarantool.org', 'http', {})) > 0
wrong_addr = socket.getaddrinfo('non-existing-domain-name-12211alklkl.com', 'http', {})
wrong_addr == nil or #wrong_addr == 0
......@@ -280,15 +279,7 @@ sc:close()
-- tcp_connect
s = socket.tcp_connect('tarantool.org', 80)
string.match(tostring(s), ', aka') ~= nil
string.match(tostring(s), ', peer') ~= nil
s:write("HEAD / HTTP/1.0\r\nHost: tarantool.org\r\n\r\n")
header = s:read({chunk = 4000, delimiter = {"\n\n", "\r\n\r\n" }}, 1)
string.match(header, "\r\n\r\n$") ~= nil
string.match(header, "200 [Oo][Kk]") ~= nil
s:close()
-- test timeout
socket.tcp_connect('127.0.0.1', 80, 0.00000000001)
-- AF_INET
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment