From 5bef23a095dff0e5e0a8662011f0cf312bf67ffc Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Mon, 5 Dec 2011 18:48:35 +0100 Subject: Ensure that TLS will be available in TLS suite The existence of openssl is not enough. --- lib/diameter/test/diameter_tls_SUITE.erl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/diameter/test/diameter_tls_SUITE.erl b/lib/diameter/test/diameter_tls_SUITE.erl index 7854411d2e..a325ca33eb 100644 --- a/lib/diameter/test/diameter_tls_SUITE.erl +++ b/lib/diameter/test/diameter_tls_SUITE.erl @@ -151,16 +151,22 @@ init_per_group(_, Config) -> end_per_group(_, _) -> ok. +%% Shouldn't really have to know about crypto here but 'ok' from +%% ssl:start() isn't enough to guarantee that TLS is available. init_per_suite(Config) -> - case os:find_executable("openssl") of - false -> - {skip, no_openssl}; - _ -> - Config + try + false /= os:find_executable("openssl") + orelse throw({?MODULE, no_openssl}), + ok == crypto:start() + orelse throw({?MODULE, no_crypto}), + Config + catch + {?MODULE, E} -> + {skip, E} end. end_per_suite(_Config) -> - ok. + crypto:stop(). %% Testcases to run when services are started and connections %% established. -- cgit v1.2.3 From f7cd24ba70e47bfdfe88ecd171c1a8badbe7e338 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Mon, 5 Dec 2011 19:07:33 +0100 Subject: Skip sctp tests on {error, esocktnosupport} This is returned on MontaVista 4.0.1, Linux 2.6.10. On Solaris 9 (for one at least) it's eprotonosupport. --- lib/diameter/test/diameter_transport_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/diameter/test/diameter_transport_SUITE.erl b/lib/diameter/test/diameter_transport_SUITE.erl index 3bd96ee422..df7161fd1e 100644 --- a/lib/diameter/test/diameter_transport_SUITE.erl +++ b/lib/diameter/test/diameter_transport_SUITE.erl @@ -179,7 +179,8 @@ have_sctp() -> {ok, Sock} -> gen_sctp:close(Sock), true; - {error, eprotonosupport} -> %% fail on any other reason + {error, E} when E == eprotonosupport; + E == esocktnosupport -> %% fail on any other reason false catch error: badarg -> -- cgit v1.2.3 From 75fa191f9fc48a769e5f99f8dc6b9463d21c9e0c Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Tue, 6 Dec 2011 00:31:03 +0100 Subject: Minor diameter_dict_scanner fix Spec was wrong. Scanning a file that ended with $' or contained an empty $'-delimited string would have failed. --- lib/diameter/src/compiler/diameter_dict_scanner.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/diameter/src/compiler/diameter_dict_scanner.erl b/lib/diameter/src/compiler/diameter_dict_scanner.erl index 963b58fdfc..45189376fb 100644 --- a/lib/diameter/src/compiler/diameter_dict_scanner.erl +++ b/lib/diameter/src/compiler/diameter_dict_scanner.erl @@ -32,7 +32,9 @@ %% # scan/1 %% ----------------------------------------------------------- --spec scan(string()) -> {ok, [Token]} | {error, {atom(), string(), Lineno}} +-spec scan(string() | binary()) + -> {ok, [Token]} + | {error, {string(), string(), Lineno}} when Token :: {word, Lineno, string()} | {number, Lineno, non_neg_integer()} | {Symbol, Lineno}, @@ -169,7 +171,7 @@ split([H|_] = L) when $a =< H, H =< $z; {word(P), Rest}; split([$'|T]) -> - case splitwith(fun(C) -> not lists:member(C, "'\r\n") end, T) of + case lists:splitwith(fun(C) -> not lists:member(C, "'\r\n") end, T) of {[_|_] = A, [$'|Rest]} -> {{word, A}, Rest}; {[], [$'|_]} -> -- cgit v1.2.3