aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-05-23 15:14:29 +0200
committerMicael Karlberg <[email protected]>2019-05-29 13:47:40 +0200
commit0eb29c0eebd4e58f294005dbe355e270208756d9 (patch)
tree8b07c5deb0c4afa8fd7cbd8d3019de4d50098639 /erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
parent56cad32ecdfa36ea7a4cddac1579eb1e414ec0fe (diff)
downloadotp-0eb29c0eebd4e58f294005dbe355e270208756d9.tar.gz
otp-0eb29c0eebd4e58f294005dbe355e270208756d9.tar.bz2
otp-0eb29c0eebd4e58f294005dbe355e270208756d9.zip
[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
Diffstat (limited to 'erts/emulator/test/socket_test_ttest_tcp_client_socket.erl')
-rw-r--r--erts/emulator/test/socket_test_ttest_tcp_client_socket.erl25
1 files changed, 25 insertions, 0 deletions
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,