From 0eb29c0eebd4e58f294005dbe355e270208756d9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 23 May 2019 15:14:29 +0200 Subject: [esock|ttest] Make it possible use local for ttest Make Unix Domain (stream) socket work with the ttest command line tool (for esock server and client). OTP-15822 --- .../test/socket_test_ttest_tcp_client_socket.erl | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'erts/emulator/test/socket_test_ttest_tcp_client_socket.erl') diff --git a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl index 5b2a494ba0..ccace2a560 100644 --- a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl +++ b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl @@ -28,6 +28,11 @@ -define(TRANSPORT_MOD, socket_test_ttest_tcp_socket). -define(MOD(D, M), {?TRANSPORT_MOD, #{domain => D, method => M}}). +start(Method, ServerInfo, Active) + when is_list(ServerInfo) -> + Domain = local, + socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method), + ServerInfo, Active); start(Method, ServerInfo = {Addr, _}, Active) when is_tuple(Addr) andalso (size(Addr) =:= 4) -> Domain = inet, @@ -39,6 +44,12 @@ start(Method, ServerInfo = {Addr, _}, Active) socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method), ServerInfo, Active). +start(Method, ServerInfo, Active, MsgID) + when is_list(ServerInfo) -> + %% This is just a simplification + Domain = local, + socket_test_ttest_tcp_client:start(?MOD(Domain, Method), + ServerInfo, Active, MsgID); start(Method, ServerInfo = {Addr, _}, Active, MsgID) when is_tuple(Addr) andalso (size(Addr) =:= 4) -> %% This is just a simplification @@ -51,6 +62,13 @@ start(Method, ServerInfo = {Addr, _}, Active, MsgID) socket_test_ttest_tcp_client:start(?MOD(Domain, Method), ServerInfo, Active, MsgID). +start(Method, ServerInfo, Active, MsgID, MaxOutstanding, RunTime) + when is_list(ServerInfo) -> + Domain = local, + socket_test_ttest_tcp_client:start(false, + ?MOD(Domain, Method), + ServerInfo, Active, + MsgID, MaxOutstanding, RunTime); start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime) when is_tuple(Addr) andalso (size(Addr) =:= 4) -> Domain = inet, @@ -66,6 +84,13 @@ start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime) ServerInfo, Active, MsgID, MaxOutstanding, RunTime). +start(Quiet, Method, ServerInfo, Active, MsgID, MaxOutstanding, RunTime) + when is_list(ServerInfo) -> + Domain = local, + socket_test_ttest_tcp_client:start(Quiet, + ?MOD(Domain, Method), + ServerInfo, Active, + MsgID, MaxOutstanding, RunTime); start(Quiet, Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime) when is_tuple(Addr) andalso (size(Addr) =:= 4) -> Domain = inet, -- cgit v1.2.3