aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/src/cth_log_redirect.erl9
-rw-r--r--lib/common_test/test/ct_hooks_SUITE.erl43
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl74
-rw-r--r--lib/crypto/test/crypto_SUITE.erl13
-rw-r--r--lib/inets/src/ftp/ftp.erl6
-rw-r--r--lib/runtime_tools/vsn.mk2
-rw-r--r--lib/ssh/src/ssh_cli.erl15
7 files changed, 150 insertions, 12 deletions
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index 8fed341600..61700a2032 100644
--- a/lib/common_test/src/cth_log_redirect.erl
+++ b/lib/common_test/src/cth_log_redirect.erl
@@ -73,7 +73,7 @@ pre_init_per_group(Group, Config, State) ->
set_curr_func({group,Group,init_per_group}, Config),
{Config, State}.
-post_init_per_group(Group, Config, Result, tc_log_async) ->
+post_init_per_group(Group, Config, Result, tc_log_async) when is_list(Config) ->
case lists:member(parallel,proplists:get_value(
tc_group_properties,Config,[])) of
true ->
@@ -154,7 +154,8 @@ handle_info(_, State) ->
handle_call(flush,State) ->
{ok, ok, State};
-handle_call({set_curr_func,{group,Group,Conf},Config}, State) ->
+handle_call({set_curr_func,{group,Group,Conf},Config},
+ State) when is_list(Config) ->
Parallel = case proplists:get_value(tc_group_properties, Config) of
undefined -> false;
Props -> lists:member(parallel, Props)
@@ -162,6 +163,10 @@ handle_call({set_curr_func,{group,Group,Conf},Config}, State) ->
{ok, ok, State#eh_state{curr_group = Group,
curr_func = Conf,
parallel_tcs = Parallel}};
+handle_call({set_curr_func,{group,Group,Conf},_SkipOrFail}, State) ->
+ {ok, ok, State#eh_state{curr_group = Group,
+ curr_func = Conf,
+ parallel_tcs = false}};
handle_call({set_curr_func,{group,undefined},_Config}, State) ->
{ok, ok, State#eh_state{curr_group = undefined,
curr_func = undefined,
diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl
index 083c87b49e..b5855da9df 100644
--- a/lib/common_test/test/ct_hooks_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE.erl
@@ -80,7 +80,7 @@ all(suite) ->
scope_per_suite_state_cth, scope_per_group_state_cth,
scope_suite_state_cth,
fail_pre_suite_cth, double_fail_pre_suite_cth,
- fail_post_suite_cth, skip_pre_suite_cth,
+ fail_post_suite_cth, skip_pre_suite_cth, skip_pre_end_cth,
skip_post_suite_cth, recover_post_suite_cth, update_config_cth,
state_update_cth, options_cth, same_id_cth,
fail_n_skip_with_minimal_cth, prio_cth, no_config,
@@ -181,6 +181,10 @@ skip_pre_suite_cth(Config) when is_list(Config) ->
do_test(skip_pre_suite_cth, "ct_cth_empty_SUITE.erl",
[skip_pre_suite_cth],Config).
+skip_pre_end_cth(Config) when is_list(Config) ->
+ do_test(skip_pre_end_cth, "ct_scope_per_group_cth_SUITE.erl",
+ [skip_pre_end_cth],Config).
+
skip_post_suite_cth(Config) when is_list(Config) ->
do_test(skip_post_suite_cth, "ct_cth_empty_SUITE.erl",
[skip_post_suite_cth],Config).
@@ -759,6 +763,43 @@ test_events(skip_pre_suite_cth) ->
{?eh,stop_logging,[]}
];
+test_events(skip_pre_end_cth) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,init_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,init_per_suite,ok}},
+
+ [{?eh,tc_start,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]}}},
+ {?eh,cth,{'_',id,[[]]}},
+ {?eh,cth,{'_',init,['_',[]]}},
+ {?eh,cth,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]},ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,test_case}},
+ {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,test_case,ok}},
+
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]}}},
+ {?eh,cth,{'_',pre_end_per_group,[group1,'$proplist',[]]}},
+ {?eh,cth,{'_',post_end_per_group,[group1,'$proplist','_',[]]}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]},
+ {skipped,"Test skip"}}}],
+ {?eh,cth,{'_',on_tc_skip,[end_per_group,
+ {tc_user_skip,{skipped,"Test skip"}},
+ []]}},
+ {?eh,tc_start,{ct_scope_per_group_cth_SUITE,end_per_suite}},
+ {?eh,tc_done,{ct_scope_per_group_cth_SUITE,end_per_suite,
+ {skipped,"Test skip"}}},
+ {?eh,cth,{'_',on_tc_skip,[end_per_suite,
+ {tc_user_skip,{skipped,"Test skip"}},
+ []]}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{'_',terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
test_events(skip_post_suite_cth) ->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
new file mode 100644
index 0000000000..ece4eb2247
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_end_cth.erl
@@ -0,0 +1,74 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(skip_pre_end_cth).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% CT Hooks
+-compile(export_all).
+
+init(Id, Opts) ->
+ empty_cth:init(Id, Opts).
+
+
+pre_init_per_suite(Suite, Config, State) ->
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ empty_cth:pre_end_per_suite(Suite,Config,State),
+ {{skip, "Test skip"}, State}.
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ empty_cth:pre_end_per_group(Group,Config,State),
+ {{skip, "Test skip"}, State}.
+
+post_end_per_group(Group,Config,Return,State) ->
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 645b1203ef..ddc9607e29 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -144,7 +144,7 @@ hash() ->
[{doc, "Test all different hash functions"}].
hash(Config) when is_list(Config) ->
{Type, MsgsLE, Digests} = proplists:get_value(hash, Config),
- Msgs = lists:map(fun lazy_eval/1, MsgsLE),
+ Msgs = lazy_eval(MsgsLE),
[LongMsg | _] = lists:reverse(Msgs),
Inc = iolistify(LongMsg),
[IncrDigest | _] = lists:reverse(Digests),
@@ -156,7 +156,7 @@ hmac() ->
[{doc, "Test all different hmac functions"}].
hmac(Config) when is_list(Config) ->
{Type, Keys, DataLE, Expected} = proplists:get_value(hmac, Config),
- Data = lists:map(fun lazy_eval/1, DataLE),
+ Data = lazy_eval(DataLE),
hmac(Type, Keys, Data, Expected),
hmac(Type, lists:map(fun iolistify/1, Keys), lists:map(fun iolistify/1, Data), Expected),
hmac_increment(Type).
@@ -173,7 +173,8 @@ block(Config) when is_list(Config) ->
stream() ->
[{doc, "Test stream ciphers"}].
stream(Config) when is_list(Config) ->
- Streams = proplists:get_value(stream, Config),
+ Streams = lazy_eval(proplists:get_value(stream, Config)),
+
lists:foreach(fun stream_cipher/1, Streams),
lists:foreach(fun stream_cipher/1, stream_iolistify(Streams)),
lists:foreach(fun stream_cipher_incment/1, stream_iolistify(Streams)).
@@ -803,6 +804,8 @@ long_msg() ->
%% test_server crash with 'no_answer_from_tc_supervisor' sometimes on some
%% machines. Therefore lazy evaluation when test case has started.
lazy_eval(F) when is_function(F) -> F();
+lazy_eval(Lst) when is_list(Lst) -> lists:map(fun lazy_eval/1, Lst);
+lazy_eval(Tpl) when is_tuple(Tpl) -> list_to_tuple(lists:map(fun lazy_eval/1, tuple_to_list(Tpl)));
lazy_eval(Term) -> Term.
long_sha_digest() ->
@@ -1253,7 +1256,7 @@ blowfish_ofb64() ->
rc4() ->
[{rc4, <<"apaapa">>, <<"Yo baby yo">>},
{rc4, <<"apaapa">>, list_to_binary(lists:seq(0, 255))},
- {rc4, <<"apaapa">>, lists:duplicate(1000000, $a)}
+ {rc4, <<"apaapa">>, long_msg()}
].
aes_ctr() ->
@@ -1301,7 +1304,7 @@ aes_ctr() ->
{aes_ctr, hexstr2bin("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"),
hexstr2bin("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"),
- lists:duplicate(1000000, $a)}
+ long_msg()}
].
rsa_plain() ->
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl
index 86ef9280ad..520db1b457 100644
--- a/lib/inets/src/ftp/ftp.erl
+++ b/lib/inets/src/ftp/ftp.erl
@@ -2068,7 +2068,7 @@ setup_data_connection(#state{mode = active,
{ok, LSock} =
gen_tcp:listen(0, [{ip, IP}, {active, false},
inet6, binary, {packet, 0}]),
- {ok, {_, Port}} = sockname(LSock),
+ {ok, {_, Port}} = sockname({tcp,LSock}),
IpAddress = inet_parse:ntoa(IP),
Cmd = mk_cmd("EPRT |2|~s|~p|", [IpAddress, Port]),
send_ctrl_message(State, Cmd),
@@ -2351,8 +2351,8 @@ millisec_time() ->
peername({tcp, Socket}) -> inet:peername(Socket);
peername({ssl, Socket}) -> ssl:peername(Socket).
-sockname({tcp, Socket}) -> inet:peername(Socket);
-sockname({ssl, Socket}) -> ssl:peername(Socket).
+sockname({tcp, Socket}) -> inet:sockname(Socket);
+sockname({ssl, Socket}) -> ssl:sockname(Socket).
maybe_tls_upgrade(Pid, undefined) ->
{ok, Pid};
diff --git a/lib/runtime_tools/vsn.mk b/lib/runtime_tools/vsn.mk
index 9ee1aba29c..c282661a61 100644
--- a/lib/runtime_tools/vsn.mk
+++ b/lib/runtime_tools/vsn.mk
@@ -1 +1 @@
-RUNTIME_TOOLS_VSN = 1.8.12
+RUNTIME_TOOLS_VSN = 1.8.13
diff --git a/lib/ssh/src/ssh_cli.erl b/lib/ssh/src/ssh_cli.erl
index 5cb1e133d3..2c8e515a14 100644
--- a/lib/ssh/src/ssh_cli.erl
+++ b/lib/ssh/src/ssh_cli.erl
@@ -161,6 +161,21 @@ handle_msg({ssh_channel_up, ChannelId, ConnectionHandler},
cm = ConnectionHandler} = State) ->
{ok, State};
+handle_msg({Group, set_unicode_state, _Arg}, State) ->
+ Group ! {self(), set_unicode_state, false},
+ {ok, State};
+
+handle_msg({Group, get_unicode_state}, State) ->
+ Group ! {self(), get_unicode_state, false},
+ {ok, State};
+
+handle_msg({Group, tty_geometry}, #state{group = Group,
+ pty = #ssh_pty{width=Width,
+ height=Height}
+ } = State) ->
+ Group ! {self(),tty_geometry,{Width,Height}},
+ {ok,State};
+
handle_msg({Group, Req}, #state{group = Group, buf = Buf, pty = Pty,
cm = ConnectionHandler,
channel = ChannelId} = State) ->