From 3f6df2bea5d60264830705f9c663ec7b9286b85f Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 10 Oct 2012 12:08:55 +0200 Subject: [common_test] Extend valid interval for approximate timer values in tests When matching the result of tests of timetrap timeouts, the actual time is measured against the expected time, and an interval of +/- 2% was seen as correct result. This turned out to fail on some platforms and is now changed to 5%. --- lib/common_test/test/ct_test_support.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index e5e2e68fcb..7aca1fe235 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -1051,8 +1051,8 @@ result_match({SkipOrFail,{ErrorInd,{EMod,EFunc,{Why,'_'}}}}, true; result_match({failed,{timetrap_timeout,{'$approx',Num}}}, {failed,{timetrap_timeout,Value}}) -> - if Value >= trunc(Num-0.02*Num), - Value =< trunc(Num+0.02*Num) -> true; + if Value >= trunc(Num-0.05*Num), + Value =< trunc(Num+0.05*Num) -> true; true -> false end; result_match({user_timetrap_error,{Why,'_'}}, -- cgit v1.2.3 From 14351577fbc3e560ca36fa888e8988e332e5ad79 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 10 Oct 2012 12:11:00 +0200 Subject: [common_test] Extend timeout values for slave nodes in ct_master_SUITE Some tests in ct_master_SUITE failed on some platforms with boot_timeout when trying to start slave nodes. The default timeout value was 3 seconds, and it is now extended to 10 seconds in these tests. To avoid similar errors with init_timeout and startup_timeout, these are both exteded from 1 second default value to 10 seconds in this test. --- lib/common_test/test/ct_master_SUITE.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl index 56a343a96f..b89d7d4dc5 100644 --- a/lib/common_test/test/ct_master_SUITE.erl +++ b/lib/common_test/test/ct_master_SUITE.erl @@ -154,6 +154,9 @@ make_spec(DataDir, FileName, NodeNames, Suites, Config) -> {init,NodeName,[ {node_start,[{startup_functions,[]}, {monitor_master,true}, + {boot_timeout,10}, + {init_timeout,10}, + {startup_timeout,10}, {env,Env}]}, {eval,{erlang,nodes,[]}}] } -- cgit v1.2.3 From f044676419eea2f77f81ccd718ea67524fac03c6 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Thu, 6 Dec 2012 12:02:00 +0100 Subject: [common_test] Changed call to publick_key to use documented interface Earlier used 'OTP-PUB-KEY':encode/2 - now public_key:der_encode/2 instead. --- lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl index d337158bce..54526e8e83 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl @@ -1044,12 +1044,9 @@ gen_dsa(LSize,NSize) when is_integer(LSize), is_integer(NSize) -> Key = gen_dsa2(LSize, NSize), {Key, encode_key(Key)}. -encode_key(Key = #'RSAPrivateKey'{}) -> - {ok, Der} = 'OTP-PUB-KEY':encode('RSAPrivateKey', Key), - {'RSAPrivateKey', list_to_binary(Der), not_encrypted}; encode_key(Key = #'DSAPrivateKey'{}) -> - {ok, Der} = 'OTP-PUB-KEY':encode('DSAPrivateKey', Key), - {'DSAPrivateKey', list_to_binary(Der), not_encrypted}. + Der = public_key:der_encode('DSAPrivateKey', Key), + {'DSAPrivateKey', Der, not_encrypted}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3 From e1f1d22a72bab14fe4e8a3443cbef298764c001e Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 14 Dec 2012 11:26:03 +0100 Subject: [common_test] Avoid hanging ct@host node if crypto does not exist ct_netconfc:init_per_suite called ct_test_support:init_per_suite before checking if crypto exists. This caused the slave node (ct@host) to be started even though the suite would be skipped when crypto did not exist - which in turn caused a hanging ct node since end_per_suite is not run in a skipped suite. This has been corrected. --- lib/common_test/test/ct_netconfc_SUITE.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/common_test/test/ct_netconfc_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE.erl index 3042a924fe..c89a4cdabe 100644 --- a/lib/common_test/test/ct_netconfc_SUITE.erl +++ b/lib/common_test/test/ct_netconfc_SUITE.erl @@ -43,12 +43,11 @@ %% there will be clashes with logging processes etc). %%-------------------------------------------------------------------- init_per_suite(Config) -> - Config1 = ct_test_support:init_per_suite(Config), case application:load(crypto) of - {error,Reason} -> + {error,Reason} when Reason=/={already_loaded,crypto} -> {skip, Reason}; _ -> - Config1 + ct_test_support:init_per_suite(Config) end. end_per_suite(Config) -> -- cgit v1.2.3 From 4aa7be58e6c1e7031042e7ea7b008de1cf4c0ad6 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 14 Dec 2012 12:15:30 +0100 Subject: [common_test] Extend timetrap time in ct_hooks_SUITE This suite often fails with timetrap timeout on some test machines. --- lib/common_test/test/ct_hooks_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl index 405df1e978..796a0832d7 100644 --- a/lib/common_test/test/ct_hooks_SUITE.erl +++ b/lib/common_test/test/ct_hooks_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(TestCase, Config) -> suite() -> - [{timetrap,{seconds,20}}]. + [{timetrap,{minutes,1}}]. all() -> all(suite). -- cgit v1.2.3