Download raw body.
benchmarks/tsung 1.8.0.20241119
Ping - any opinions on that? If not, is anyone still interested in
benchmarks/tsung at all?
On 5/25/25 2:58 PM, Volker Schlecht wrote:
> benchmarks/tsung currently suffers from a number of compilation
> and runtime errors when compiling/running on OTP versions > 25
>
> All that is needed to fix that, has been documented in a number
> of issues, and pull requests, but it appears that there isn't a
> lot of drive left in the project (and possibly its user base)
> anymore.
>
> I've applied the already proposed changes and filled the gaps
> with a few patches of my own, and the result passes tests (save
> one test, which has always been failing on OpenBSD).
>
> While at first glance it appears the some of the patches disable
> SSL verification, those are just reinstating the behavior that
> tsung always had: Erlang changed the default behavior for SSL
> connections from not-verifying to verifying, and tsung leans on the
> old default.
>
> Not nice, but also nothing new ... changing it without breaking
> existing setups is beyond the length I want to invest in this
> port :-)
>
> With these changes, we could move tsung to use MODERL_DEFAULT_VERSION
> and get rid of erlang/25 and erlang/26 eventually.
>
> Thoughts? Opinions?
Index: Makefile
===================================================================
RCS file: /cvs/ports/benchmarks/tsung/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- Makefile 21 Dec 2024 11:37:34 -0000 1.24
+++ Makefile 25 May 2025 12:35:27 -0000
@@ -3,8 +3,8 @@ COMMENT= multi-protocol distributed load
V= 1.8.0
GH_ACCOUNT= processone
GH_PROJECT= tsung
-GH_TAGNAME= v${V}
-REVISION= 2
+GH_COMMIT= 4b4e1e86f33d4a17641a60b26c0d1cab1f1953b0
+DISTNAME= ${GH_PROJECT}-${V}.20241119
CATEGORIES= benchmarks net
@@ -13,7 +13,6 @@ PERMIT_PACKAGE= Yes
MODULES= lang/erlang \
lang/python
-MODERL_VERSION= 25
MODPY_BUILDDEP= No
RUN_DEPENDS= graphics/py-matplotlib \
Index: distinfo
===================================================================
RCS file: /cvs/ports/benchmarks/tsung/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo 10 Apr 2023 16:42:34 -0000 1.4
+++ distinfo 25 May 2025 12:35:27 -0000
@@ -1,2 +1,2 @@
-SHA256 (tsung-1.8.0.tar.gz) = bFXfSLgvGF39YK5yceCbvCXGyLxWi7i/wM2wVtd8OJk=
-SIZE (tsung-1.8.0.tar.gz) = 972168
+SHA256 (tsung-1.8.0.20241119-4b4e1e86.tar.gz) = RsutGDTECwG8E/7XgL6Q8I2E+pGS8cW9IXW22sAsX50=
+SIZE (tsung-1.8.0.20241119-4b4e1e86.tar.gz) = 973993
Index: patches/patch-src_lib_websocket_erl
===================================================================
RCS file: patches/patch-src_lib_websocket_erl
diff -N patches/patch-src_lib_websocket_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_lib_websocket_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,13 @@
+Doesn't run, and seeding isn't needed here anyway
+
+Index: src/lib/websocket.erl
+--- src/lib/websocket.erl.orig
++++ src/lib/websocket.erl
+@@ -131,7 +131,6 @@ decode(Data) ->
+ %%% Internal functions
+ %%%===================================================================
+ gen_accept_key() ->
+- rand:seed(erlang:now()),
+ Key = crypto:strong_rand_bytes(16),
+ KeyStr = base64:encode_to_string(Key),
+ Accept = binary:list_to_bin(KeyStr ++ "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"),
Index: patches/patch-src_test_ts_test_config_erl
===================================================================
RCS file: patches/patch-src_test_ts_test_config_erl
diff -N patches/patch-src_test_ts_test_config_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_test_ts_test_config_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/test/ts_test_config.erl
+--- src/test/ts_test_config.erl.orig
++++ src/test/ts_test_config.erl
+@@ -122,7 +122,7 @@ config_thinktime2_test() ->
+ receive
+ {timeout,Ref2,end_thinktime} -> ok
+ end,
+- rand:seed(), % reinit seed for others tests
++ rand:seed(default), % reinit seed for others tests
+ ?assertMatch({random,1000}, Req).
+
+ read_config_tag_noexclusion_test() ->
Index: patches/patch-src_tsung_recorder_ts_proxy_http_erl
===================================================================
RCS file: patches/patch-src_tsung_recorder_ts_proxy_http_erl
diff -N patches/patch-src_tsung_recorder_ts_proxy_http_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_recorder_ts_proxy_http_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/tsung_recorder/ts_proxy_http.erl
+--- src/tsung_recorder/ts_proxy_http.erl.orig
++++ src/tsung_recorder/ts_proxy_http.erl
+@@ -260,7 +260,7 @@ connect(Scheme, Host, Port)->
+ case Scheme of
+ https ->
+ {ok, _} = ssl:connect(Host,Port,
+- [{active, once}]);
++ [{active, once}] ++ [{verify, verify_none}]);
+ _ ->
+ {ok, _} = gen_tcp:connect(Host,Port,
+ [{active, once},
Index: patches/patch-src_tsung_ts_bosh_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_bosh_erl
diff -N patches/patch-src_tsung_ts_bosh_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_bosh_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/tsung/ts_bosh.erl
+--- src/tsung/ts_bosh.erl.orig
++++ src/tsung/ts_bosh.erl
+@@ -563,7 +563,7 @@ socket_connect(ssl, Host, Port, Options, Timeout) ->
+ % {ok, S} = gen_tcp:connect(Host, Port, [{active, false}|ForConnection], Timeout),
+ % ssl:connect(S, ForSSL, Timeout).
+ % ?LOGF("Connect ~p", [ForSSL], ?ERR),
+- ssl:connect(Host, Port, [{ssl_imp, new}|Options], Timeout).
++ ssl:connect(Host, Port, [{ssl_imp, new}|Options] ++ [{verify, verify_none}], Timeout).
+
+
+ socket_send(tcp, Socket, Data) ->
Index: patches/patch-src_tsung_ts_digest_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_digest_erl
diff -N patches/patch-src_tsung_ts_digest_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_digest_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,19 @@
+Index: src/tsung/ts_digest.erl
+--- src/tsung/ts_digest.erl.orig
++++ src/tsung/ts_digest.erl
+@@ -72,13 +72,13 @@ shahex(Clear) ->
+ %%%----------------------------------------------------------------------
+ tohex(A)->
+ Fun = fun(X)->
+- ts_utils:to_lower(padhex(httpd_util:integer_to_hexlist(X)))
++ ts_utils:to_lower(padhex(erlang:integer_to_list(X,16)))
+ end,
+ lists:flatten( lists:map(Fun, A) ).
+
+ %%%----------------------------------------------------------------------
+ %%% Func: padhex/1
+-%%% Purpose: needed because httpd_util:integer_to_hexlist returns hex
++%%% Purpose: needed because httpd_util:integer_to_list(X,16) returns hex
+ %%% values <10 as only 1 character, ie. "0F" is simply returned as
+ %%% "F". For our digest, we need these leading zeros to be present.
+ %%% ----------------------------------------------------------------------
Index: patches/patch-src_tsung_ts_http_common_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_http_common_erl
diff -N patches/patch-src_tsung_ts_http_common_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_http_common_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/tsung/ts_http_common.erl
+--- src/tsung/ts_http_common.erl.orig
++++ src/tsung/ts_http_common.erl
+@@ -405,7 +405,7 @@ parse_chunked(Body, State)->
+ %%----------------------------------------------------------------------
+ read_chunk(<<>>, State, Int, Acc) ->
+ ?LOGF("No data in chunk [Int=~p, Acc=~p] ~n", [Int,Acc],?INFO),
+- AccInt = list_to_binary(httpd_util:integer_to_hexlist(Int)),
++ AccInt = list_to_binary(erlang:integer_to_list(Int, 16)),
+ { State#state_rcv{acc = AccInt, ack_done = false }, [] }; % read more data
+ %% this code has been inspired by inets/http_lib.erl
+ %% Extensions not implemented
Index: patches/patch-src_tsung_ts_http_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_http_erl
diff -N patches/patch-src_tsung_ts_http_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_http_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/tsung/ts_http.erl
+--- src/tsung/ts_http.erl.orig
++++ src/tsung/ts_http.erl
+@@ -315,7 +315,7 @@ decode_chunk_size(<<Head:2/binary, Data/binary >>, Hea
+ ?Debug("decode chunk: crlf, no digit"),
+ decode_chunk_size(Data, Headers, Body, <<>>);
+ decode_chunk_size(<<Head:2/binary, Data/binary >>, Headers, Body,Digits) when Head == << "\r\n" >> ->
+- case httpd_util:hexlist_to_integer(binary_to_list(Digits)) of
++ case erlang:list_to_integer(binary_to_list(Digits), 16) of
+ 0 ->
+ decode_chunk_size(Data, Headers, Body ,<<>>);
+ Size ->
Index: patches/patch-src_tsung_ts_server_websocket_ssl_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_server_websocket_ssl_erl
diff -N patches/patch-src_tsung_ts_server_websocket_ssl_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_server_websocket_ssl_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,12 @@
+Index: src/tsung/ts_server_websocket_ssl.erl
+--- src/tsung/ts_server_websocket_ssl.erl.orig
++++ src/tsung/ts_server_websocket_ssl.erl
+@@ -60,7 +60,7 @@ connect(Host, Port, Opts, Timeout) ->
+ Protocol = WSConfig#ws_config.subprotos,
+ Origin = WSConfig#ws_config.origin,
+
+- case ssl:connect(Host, Port, opts_to_tcp_opts(TcpOpts),Timeout) of
++ case ssl:connect(Host, Port, opts_to_tcp_opts(TcpOpts) ++ [{verify, verify_none}],Timeout) of
+ {ok, Socket} ->
+ Pid = spawn_link(
+ fun() ->
Index: patches/patch-src_tsung_ts_ssl6_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_ssl6_erl
diff -N patches/patch-src_tsung_ts_ssl6_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_ssl6_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,16 @@
+Index: src/tsung/ts_ssl6.erl
+--- src/tsung/ts_ssl6.erl.orig
++++ src/tsung/ts_ssl6.erl
+@@ -42,10 +42,10 @@ connect(Host, Port, Opts) when is_list(Host) ->
+ connect(Host, Port, Opts, infinity);
+
+ connect(Socket, Opts, ConnectTimeout) ->
+- ssl:connect(Socket, Opts, ConnectTimeout).
++ ssl:connect(Socket, Opts ++ [{verify, verify_none}], ConnectTimeout).
+
+ connect(Host, Port, Opts, ConnectTimeout) ->
+- ssl:connect(Host, Port, Opts, ConnectTimeout).
++ ssl:connect(Host, Port, Opts ++ [{verify, verify_none}], ConnectTimeout).
+
+ connect(Socket, Opts) ->
+ connect(Socket, Opts, infinity).
Index: patches/patch-src_tsung_ts_ssl_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_ssl_erl
diff -N patches/patch-src_tsung_ts_ssl_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_ssl_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,16 @@
+Index: src/tsung/ts_ssl.erl
+--- src/tsung/ts_ssl.erl.orig
++++ src/tsung/ts_ssl.erl
+@@ -37,10 +37,10 @@ connect(Host, Port, Opts) when is_list(Host) ->
+ connect(Host, Port, opts_to_tcp_opts(Opts), infinity);
+
+ connect(Socket, Opts, ConnectTimeout) ->
+- ssl:connect(Socket, opts_to_tcp_opts(Opts), ConnectTimeout).
++ ssl:connect(Socket, opts_to_tcp_opts(Opts) ++ [{verify, verify_none}], ConnectTimeout).
+
+ connect(Host, Port, Opts, ConnectTimeout) ->
+- ssl:connect(Host, Port, opts_to_tcp_opts(Opts), ConnectTimeout).
++ ssl:connect(Host, Port, opts_to_tcp_opts(Opts) ++ [{verify, verify_none}], ConnectTimeout).
+
+ connect(Socket, Opts) ->
+ connect(Socket, Opts, infinity).
Index: patches/patch-src_tsung_ts_utils_erl
===================================================================
RCS file: patches/patch-src_tsung_ts_utils_erl
diff -N patches/patch-src_tsung_ts_utils_erl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_tsung_ts_utils_erl 25 May 2025 12:35:27 -0000
@@ -0,0 +1,24 @@
+Index: src/tsung/ts_utils.erl
+--- src/tsung/ts_utils.erl.orig
++++ src/tsung/ts_utils.erl
+@@ -162,7 +162,7 @@ init_seed(A) when is_integer(A)->
+ %% node to set a reproductible but different seed for each launcher.
+ Id=get_node_id(),
+ ?DebugF("Seeding with ~p on node ~p~n",[Id,node()]),
+- rand:seed(1000*Id,-1000*A*Id,1000*A*A);
++ rand:seed(default, {1000*Id,-1000*A*Id,1000*A*A});
+ init_seed({A,B}) when is_integer(A) and is_integer(B)->
+ Id=get_node_id(),
+ ?DebugF("Seeding with ~p ~p ~p on node ~p~n",[A,B,Id,node()]),
+@@ -171,9 +171,9 @@ init_seed({A,B}) when is_integer(A) and is_integer(B)-
+ %% initial pseudo random values will be quite closed to each
+ %% other. Trying to avoid this by using a multiplier big enough
+ %% (because the algorithm use mod 30XXX , see random.erl).
+- rand:seed(4000*A*B*Id,-4000*B*A*Id,4000*Id*Id*A);
++ rand:seed(default, {4000*A*B*Id,-4000*B*A*Id,4000*Id*Id*A});
+ init_seed({A,B,C}) ->
+- rand:seed(A,B,C).
++ rand:seed(default, {A,B,C}).
+
+ get_node_id() ->
+ case string:tokens(atom_to_list(node()),"@") of
benchmarks/tsung 1.8.0.20241119