From 1856a071183a3d0c546b2736dbec603f504298b2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 21 Sep 2011 09:49:34 +0200 Subject: Skip update_cpu_info if 'taskset' cannot be found --- erts/emulator/test/scheduler_SUITE.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index f16d0ea429..3606b8a730 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -87,8 +87,17 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - +init_per_testcase(update_cpu_info, Config) -> + case os:find_executable("taskset") of + false -> + {skip,"Could not find 'taskset' in path"}; + _ -> + init_per_tc(update_cpu_info, Config) + end; init_per_testcase(Case, Config) when is_list(Config) -> + init_per_tc(Case, Config). + +init_per_tc(Case, Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), process_flag(priority, max), erlang:display({'------------', ?MODULE, Case, '------------'}), -- cgit v1.2.3 From 4508c35b9b5af75fcdd730d479c19e75c5102ae2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 21 Sep 2011 10:24:08 +0200 Subject: Increase timeout in scheduler_suspend for slow platforms --- erts/emulator/test/scheduler_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index 3606b8a730..debb54579b 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -1039,7 +1039,7 @@ sbt_test(Config, CpuTCmd, ClBt, Bt, LP) -> ?line ok. scheduler_suspend(Config) when is_list(Config) -> - ?line Dog = ?t:timetrap(?t:minutes(2)), + ?line Dog = ?t:timetrap(?t:minutes(5)), ?line lists:foreach(fun (S) -> scheduler_suspend_test(Config, S) end, [64, 32, 16, default]), ?line ?t:timetrap_cancel(Dog), -- cgit v1.2.3 From f1f8e2ff2c7f53ae9de3c7bb27402f8cc6f8532a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 21 Sep 2011 17:50:48 +0200 Subject: Use now instead of os:timestamp This is done in order to improve timing when testing debug builds, especially ppc debug builds. --- erts/emulator/test/busy_port_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index 8365e1c540..2cb01f5a8c 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -495,12 +495,12 @@ hs_busy_pcmd(Prt, Opts, StartFun, EndFun) -> P = spawn_link(fun () -> erlang:yield(), Tester ! {self(), doing_port_command}, - Start = os:timestamp(), + Start = now(), Res = try {return, port_command(Prt, [], Opts)} catch Exception:Error -> {Exception, Error} end, - End = os:timestamp(), + End = now(), Time = round(timer:now_diff(End, Start)/1000), Tester ! {self(), port_command_result, Res, Time} end), -- cgit v1.2.3 From 702505ef8a077b07ec9cb4845bb780d4c68e22ec Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 21 Sep 2011 18:05:49 +0200 Subject: Double timeout to make sure debug builds pass --- erts/emulator/test/distribution_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index e4af5c00a6..05dbffc819 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -331,7 +331,7 @@ receiver2(Num, TotSize) -> link_to_busy(doc) -> "Test that link/1 to a busy distribution port works."; link_to_busy(Config) when is_list(Config) -> - ?line Dog = test_server:timetrap(test_server:seconds(30)), + ?line Dog = test_server:timetrap(test_server:seconds(60)), ?line {ok, Node} = start_node(link_to_busy), ?line Recv = spawn(Node, erlang, apply, [fun sink/1, [link_to_busy_sink]]), @@ -378,7 +378,7 @@ tail_applied_linker(Pid) -> exit_to_busy(doc) -> "Test that exit/2 to a busy distribution port works."; exit_to_busy(Config) when is_list(Config) -> - ?line Dog = test_server:timetrap(test_server:seconds(30)), + ?line Dog = test_server:timetrap(test_server:seconds(60)), ?line {ok, Node} = start_node(exit_to_busy), Tracer = case os:getenv("TRACE_BUSY_DIST_PORT") of -- cgit v1.2.3 From 9b2b8c8652032c216c4f14d54fa24a2492c8325b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 22 Sep 2011 09:47:42 +0200 Subject: Extend slave start timeout for windows tests --- lib/common_test/test/ct_test_support.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index 31381abc40..e85e8e6ad3 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -25,6 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("common_test/include/ct_event.hrl"). +-include_lib("common_test/include/ct.hrl"). -export([init_per_suite/1, init_per_suite/2, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, @@ -46,9 +47,10 @@ init_per_suite(Config) -> init_per_suite(Config, Level) -> case os:type() of {win32, _} -> - %% Extend timeout for windows as starting node + %% Extend timeout to 1 hour for windows as starting node %% can take a long time there - test_server:timetrap( 120000 * test_server:timetrap_scale_factor()); + test_server:timetrap( 60*60*1000 * + test_server:timetrap_scale_factor()); _ -> ok end, -- cgit v1.2.3 From c058ca00728fbdbb7cef535a8beb13abbaa58cb7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 26 Sep 2011 12:25:59 +0200 Subject: Allow out of memory exception for max_port checks --- erts/emulator/test/port_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index eac56a867d..0a1ef5a78f 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -724,6 +724,8 @@ open_ports(Name, Settings) -> []; system_limit -> []; + enomem -> + []; Other -> ?line test_server:fail({open_ports, Other}) end; -- cgit v1.2.3 From 8b06e8921f7e2f9d907df7edd8daf11ee24a0a1e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 26 Sep 2011 19:04:25 +0200 Subject: Extend time to wait for zone files to be loaded This change was made in order to make slow solaris machines work. --- lib/kernel/test/inet_res_SUITE_data/run-named | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kernel/test/inet_res_SUITE_data/run-named b/lib/kernel/test/inet_res_SUITE_data/run-named index b418607d48..7caa3756ef 100755 --- a/lib/kernel/test/inet_res_SUITE_data/run-named +++ b/lib/kernel/test/inet_res_SUITE_data/run-named @@ -2,7 +2,7 @@ ## ## %CopyrightBegin% ## -## Copyright Ericsson AB 2009. All Rights Reserved. +## Copyright Ericsson AB 2009-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 @@ -155,7 +155,7 @@ $NAMED $NAMED_FG -c "$CONF_FILE" >"$LOG_FILE" 2>&1 /dev/null 2>&1; wait $NAMED >/dev/null 2>&1" \ 0 1 2 3 15 -sleep 1 # Give name server time to load its zone files +sleep 2 # Give name server time to load its zone files echo "Running: Enter \`\`quit'' to terminate nameserver[$NAMED]..." while read LINE; do test :"$LINE" = :'quit' && break -- cgit v1.2.3 From a176db06b4de2354a385813409a3340c85c3b341 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 26 Sep 2011 19:13:03 +0200 Subject: Use static port for old solaris versions Solaris version before 10 have some problem with releasing addresses after doing a gen_udp:open, which causes inet_res to get a econnrefused. With this fix we hope that the static port will not collide with anything. --- lib/kernel/test/inet_res_SUITE.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index 6064a9b2d9..8a3d220e46 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -117,9 +117,15 @@ ns_init(ZoneDir, PrivDir, DataDir) -> case os:type() of {unix,_} when ZoneDir =:= undefined -> undefined; {unix,_} -> - {ok,S} = gen_udp:open(0, [{reuseaddr,true}]), - {ok,PortNum} = inet:port(S), - gen_udp:close(S), + PortNum = case {os:type(),os:version()} of + {{unix,solaris},{M,V,_}} when M =< 5, V < 10 -> + 11895 + random:uniform(100); + _ -> + {ok,S} = gen_udp:open(0, [{reuseaddr,true}]), + {ok,PNum} = inet:port(S), + gen_udp:close(S), + PNum + end, RunNamed = filename:join(DataDir, ?RUN_NAMED), NS = {{127,0,0,1},PortNum}, P = erlang:open_port({spawn_executable,RunNamed}, -- cgit v1.2.3 From 22a3818adb4e3433d7ab9f34e0ade06fdf10d8d6 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 27 Sep 2011 12:03:04 +0200 Subject: Skip getaddr_v6 test if on the ipv4_only host --- lib/kernel/test/inet_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 1bb173a3ac..aaa20b7398 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -294,7 +294,7 @@ t_getaddr_v6(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,_IP,_,IP_46_Str,IP46} = ct:get_config(test_host_ipv4_only), case {inet:getaddr(IP_46_Str, inet6),inet:getaddr(Name, inet6)} of - {{ok,IP46},{ok,_}} -> + {{ok,IP46},{ok,V4Addr}} when V4Addr /= {0,0,0,0,0,0,0,1} -> %% Since we suceeded in parsing an IPv6 address string and %% look up the name, this computer fully supports IPv6. ?line {ok,IP46} = inet:getaddr(IP46, inet6), -- cgit v1.2.3 From bb98bf86894527817e0d00aa87286a4291937d03 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 27 Sep 2011 12:20:41 +0200 Subject: Remove test_server path instead of cwd for clash test With the introduction of common_test as test framework the working directory of the tests changed to be the emulator_test directory. So we now have to remove the ../test_server directory instead. This change only affect tests run with a emulator which has not been installed. --- lib/kernel/test/code_SUITE.erl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 86cccebc29..f7d56eed48 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -573,11 +573,13 @@ add_del_path(Config) when is_list(Config) -> clash(Config) when is_list(Config) -> DDir = ?config(data_dir,Config)++"clash/", P = code:get_path(), + [TestServerPath|_] = [Path || Path <- code:get_path(), + re:run(Path,"test_server/?$",[]) /= nomatch], %% test non-clashing entries - %% remove "." to prevent clash with test-server path - ?line true = code:del_path("."), + %% remove TestServerPath to prevent clash with test-server path + ?line true = code:del_path(TestServerPath), ?line true = code:add_path(DDir++"foobar-0.1/ebin"), ?line true = code:add_path(DDir++"zork-0.8/ebin"), test_server:capture_start(), @@ -589,8 +591,8 @@ clash(Config) when is_list(Config) -> %% test clashing entries - %% remove "." to prevent clash with test-server path - ?line true = code:del_path("."), + %% remove TestServerPath to prevent clash with test-server path + ?line true = code:del_path(TestServerPath), ?line true = code:add_path(DDir++"foobar-0.1/ebin"), ?line true = code:add_path(DDir++"foobar-0.1.ez/foobar-0.1/ebin"), test_server:capture_start(), @@ -603,9 +605,9 @@ clash(Config) when is_list(Config) -> %% test "Bad path can't read" - %% remove "." to prevent clash with test-server path + %% remove TestServerPath to prevent clash with test-server path Priv = ?config(priv_dir, Config), - ?line true = code:del_path("."), + ?line true = code:del_path(TestServerPath), TmpEzFile = Priv++"foobar-0.tmp.ez", ?line {ok, _} = file:copy(DDir++"foobar-0.1.ez", TmpEzFile), ?line true = code:add_path(TmpEzFile++"/foobar-0.1/ebin"), -- cgit v1.2.3 From d41617d9969253d9e66270beebac843865036baa Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 27 Sep 2011 17:14:08 +0200 Subject: Skip create_big_boot on platforms without crypto This has to be done as many other applications depend on that crypto is present. --- lib/kernel/test/code_SUITE.erl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index f7d56eed48..b677f34ed0 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -81,6 +81,13 @@ init_per_suite(Config) -> end_per_suite(Config) -> Config. +init_per_testcase(big_boot_embedded, Config) -> + case catch crypto:start() of + ok -> + init_per_testcase(do_big_boot_embedded, Config); + _Else -> + {skip, "Needs crypto!"} + end; init_per_testcase(_Func, Config) -> Dog=?t:timetrap(?t:minutes(5)), P=code:get_path(), -- cgit v1.2.3