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 14:19:30 +0200
committerMicael Karlberg <[email protected]>2019-05-29 13:47:40 +0200
commit56cad32ecdfa36ea7a4cddac1579eb1e414ec0fe (patch)
treeec3090f4ed2609086363b0797c069a50d0010d57 /erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
parent9ccec09217aa3d721501a0634b205d9d87cab914 (diff)
downloadotp-56cad32ecdfa36ea7a4cddac1579eb1e414ec0fe.tar.gz
otp-56cad32ecdfa36ea7a4cddac1579eb1e414ec0fe.tar.bz2
otp-56cad32ecdfa36ea7a4cddac1579eb1e414ec0fe.zip
[esock|ttest] Updated the ttest command line tool
Updated the ttest command line tool to the new API. 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.erl60
1 files changed, 47 insertions, 13 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 acf2556793..5b2a494ba0 100644
--- a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
+++ b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
@@ -21,30 +21,64 @@
-module(socket_test_ttest_tcp_client_socket).
-export([
- start/4, start/5, start/7, start/8,
+ start/3, start/4, start/6, start/7,
stop/1
]).
-define(TRANSPORT_MOD, socket_test_ttest_tcp_socket).
--define(MOD(M), {?TRANSPORT_MOD, #{method => Method}}).
+-define(MOD(D, M), {?TRANSPORT_MOD, #{domain => D, method => M}}).
-start(Method, Active, Addr, Port) ->
- socket_test_ttest_tcp_client:start_monitor(?MOD(Method), Active, Addr, Port).
+start(Method, ServerInfo = {Addr, _}, Active)
+ when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
+ Domain = inet,
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
+ ServerInfo, Active);
+start(Method, ServerInfo = {Addr, _}, Active)
+ when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
+ Domain = inet6,
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
+ ServerInfo, Active).
-start(Method, Active, Addr, Port, MsgID) ->
- socket_test_ttest_tcp_client:start(?MOD(Method),
- Active, Addr, Port, MsgID).
+start(Method, ServerInfo = {Addr, _}, Active, MsgID)
+ when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
+ %% This is just a simplification
+ Domain = inet,
+ 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) =:= 8) ->
+ Domain = inet6,
+ socket_test_ttest_tcp_client:start(?MOD(Domain, Method),
+ ServerInfo, Active, MsgID).
-start(Method, Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
+start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+ when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
+ Domain = inet,
socket_test_ttest_tcp_client:start(false,
- ?MOD(Method),
- Active, Addr, Port,
+ ?MOD(Domain, Method),
+ ServerInfo, Active,
+ MsgID, MaxOutstanding, RunTime);
+start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+ when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
+ Domain = inet6,
+ socket_test_ttest_tcp_client:start(false,
+ ?MOD(Domain, Method),
+ ServerInfo, Active,
MsgID, MaxOutstanding, RunTime).
-start(Quiet, Method, Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
+start(Quiet, Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+ when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
+ Domain = inet,
+ 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) =:= 8) ->
+ Domain = inet6,
socket_test_ttest_tcp_client:start(Quiet,
- ?MOD(Method),
- Active, Addr, Port,
+ ?MOD(Domain, Method),
+ ServerInfo, Active,
MsgID, MaxOutstanding, RunTime).
stop(Pid) ->