diff options
author | Ingela Anderton Andin <[email protected]> | 2016-03-01 14:06:20 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-03-01 14:06:20 +0100 |
commit | 75bc5bebc070a59535b8f6b7b9085c210b4723b5 (patch) | |
tree | 8868096be6ad2eadce99475293f370008df1aa9f /erts/epmd/test | |
parent | 6f8997c001a17b9d9322e26757690489d6111dac (diff) | |
parent | 40695d080b0dc0665b01803768ffc74ed2eca207 (diff) | |
download | otp-75bc5bebc070a59535b8f6b7b9085c210b4723b5.tar.gz otp-75bc5bebc070a59535b8f6b7b9085c210b4723b5.tar.bz2 otp-75bc5bebc070a59535b8f6b7b9085c210b4723b5.zip |
Merge branch 'msantos/epmd-IPv6-node-reg2/PR-864/OTP-13364' into maint
* msantos/epmd-IPv6-node-reg2/PR-864/OTP-13364:
epmd: support IPv6 node registration
Diffstat (limited to 'erts/epmd/test')
-rw-r--r-- | erts/epmd/test/epmd_SUITE.erl | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index 4de65500e9..d5837e5b8c 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -43,6 +43,7 @@ -export( [ register_name/1, + register_name_ipv6/1, register_names_1/1, register_names_2/1, register_duplicate_name/1, @@ -113,7 +114,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> - [register_name, register_names_1, register_names_2, + [register_name, register_name_ipv6, + register_names_1, register_names_2, register_duplicate_name, unicode_name, long_unicode_name, get_port_nr, slow_get_port_nr, unregister_others_name_1, unregister_others_name_2, @@ -172,6 +174,24 @@ register_name(Config) when is_list(Config) -> ?line ok = close(Sock), % Unregister ok. +register_name_ipv6(doc) -> + ["Register a name over IPv6"]; +register_name_ipv6(suite) -> + []; +register_name_ipv6(Config) when is_list(Config) -> + % Test if the host has an IPv6 loopback address + Res = gen_tcp:listen(0, [inet6, {ip, {0,0,0,0,0,0,0,1}}]), + case Res of + {ok,LSock} -> + gen_tcp:close(LSock), + ?line ok = epmdrun(), + ?line {ok,Sock} = register_node6("foobar6"), + ?line ok = close(Sock), % Unregister + ok; + _Error -> + {skip, "Host does not have an IPv6 loopback address"} + end. + register_names_1(doc) -> ["Register and unregister two nodes"]; register_names_1(suite) -> @@ -245,9 +265,14 @@ register_node(Name) -> register_node(Name,Port) -> register_node_v2(Port,$M,0,5,5,Name,""). +register_node6(Name) -> + register_node_v2({0,0,0,0,0,0,0,1},?DUMMY_PORT,$M,0,5,5,Name,""). + register_node_v2(Port, NodeType, Prot, HVsn, LVsn, Name, Extra) -> + register_node_v2("localhost", Port, NodeType, Prot, HVsn, LVsn, Name, Extra). +register_node_v2(Addr, Port, NodeType, Prot, HVsn, LVsn, Name, Extra) -> Req = alive2_req(Port, NodeType, Prot, HVsn, LVsn, Name, Extra), - case send_req(Req) of + case send_req(Req, Addr) of {ok,Sock} -> case recv(Sock,4) of {ok, [?EPMD_ALIVE2_RESP,_Res=0,_C0,_C1]} -> @@ -1186,7 +1211,9 @@ send_direct(Sock, Bytes) -> end. send_req(Req) -> - case connect() of + send_req(Req, "localhost"). +send_req(Req, Addr) -> + case connect(Addr) of {ok,Sock} -> case send(Sock, [size16(Req), Req]) of ok -> |