diff options
author | Anders Svensson <[email protected]> | 2011-12-20 14:51:56 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2011-12-20 14:51:56 +0100 |
commit | 58336ee5c613de56f6d69562cd59b651eef734f0 (patch) | |
tree | 5a593244269992c86b9157229a2cb6d0242bbb79 /lib/diameter/test/diameter_capx_SUITE.erl | |
parent | e986108d71a71d835c241d22cdb08f97584958c5 (diff) | |
parent | 84873533d8caf176a710135d15e3578168350eab (diff) | |
download | otp-58336ee5c613de56f6d69562cd59b651eef734f0.tar.gz otp-58336ee5c613de56f6d69562cd59b651eef734f0.tar.bz2 otp-58336ee5c613de56f6d69562cd59b651eef734f0.zip |
Merge branch 'anders/diameter/testsuites/OTP-9829' into maint
* anders/diameter/testsuites/OTP-9829: (21 commits)
Install example dictionaries
Move example code to examples/code
Move example dictionaries to examples/dict
Set name/prefix at compilation, not in dictionaries
Add RFC 4004 (MIP) dictionary
Add RFC 4740 (SIP) dictionary
Add RFC 4072 (EAP) dictionary
Add RFC 4006 (CC) dictionary
Add RFC 4005 (NAS) dictionary
Add standards testcase to compiler suite
Remove {init,end}_per_group workaround
Use new syntax for specifying ct group properties
Increase timetrap in compiler suite
Minor capx suite tweaks
Minor makefile tweak
Remove trailing whitespace
Update skip condition in gen_sctp suite
Reintroduce gen_sctp suite
Remove delay from connect in transport suite
Add codec testcase for decode of unknown AVPs
...
Diffstat (limited to 'lib/diameter/test/diameter_capx_SUITE.erl')
-rw-r--r-- | lib/diameter/test/diameter_capx_SUITE.erl | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/lib/diameter/test/diameter_capx_SUITE.erl b/lib/diameter/test/diameter_capx_SUITE.erl index e6b1558bf6..54a161d606 100644 --- a/lib/diameter/test/diameter_capx_SUITE.erl +++ b/lib/diameter/test/diameter_capx_SUITE.erl @@ -27,8 +27,6 @@ -export([suite/0, all/0, groups/0, - init_per_group/2, - end_per_group/2, init_per_testcase/2, end_per_testcase/2]). @@ -93,30 +91,26 @@ -define(cea, #diameter_base_CEA). -define(answer_message, #'diameter_base_answer-message'). +-define(fail(T), erlang:error({T, process_info(self(), messages)})). + +-define(TIMEOUT, 2000). + %% =========================================================================== suite() -> [{timetrap, {seconds, 10}}]. -all() -> - [start, start_services, add_listeners - | [{group, N} || {N, _, _} <- groups()]] - ++ [remove_listeners, stop_services, stop]. +all() -> [start, + start_services, + add_listeners, + {group, all}, + {group, all, [parallel]}, + remove_listeners, + stop_services, + stop]. groups() -> - Ts = testcases(), - [{grp(P), P, Ts} || P <- [[], [parallel]]]. - -grp([]) -> - sequential; -grp([parallel = P]) -> - P. - -init_per_group(_Name, Config) -> - Config. - -end_per_group(_, _) -> - ok. + [{all, [], lists:flatmap(fun tc/1, tc())}]. %% Generate a unique hostname for each testcase so that watchdogs %% don't prevent a connection from being brought up immediately. @@ -137,9 +131,6 @@ end_per_testcase(Name, Config) -> ok = diameter:remove_transport(?CLIENT, CRef). %% Testcases all come in two flavours, client and server. -testcases() -> - lists:flatmap(fun tc/1, tc()). - tc(Name) -> [?A([C,$_|?L(Name)]) || C <- "cs"]. @@ -270,8 +261,8 @@ s_client_reject(Config) -> ?packet{}}} = Info -> Info - after 2000 -> - fail({LRef, OH}) + after ?TIMEOUT -> + ?fail({LRef, OH}) end. c_client_reject(Config) -> @@ -307,12 +298,12 @@ server_closed(Config, F, RC) -> = Reason, {listen, _}}} -> Reason - after 2000 -> - fail({LRef, OH}) + after ?TIMEOUT -> + ?fail({LRef, OH}) end. %% server_reject/3 - + server_reject(Config, F, RC) -> true = diameter:subscribe(?SERVER), OH = host(Config), @@ -328,8 +319,8 @@ server_reject(Config, F, RC) -> = Reason, {listen, _}}} -> Reason - after 2000 -> - fail({LRef, OH}) + after ?TIMEOUT -> + ?fail({LRef, OH}) end. %% cliient_closed/4 @@ -345,13 +336,13 @@ client_closed(Config, Host, F, RC) -> %% client_recv/1 -client_recv(CRef) -> +client_recv(CRef) -> receive ?event{service = ?CLIENT, info = {closed, CRef, Reason, {connect, _}}} -> Reason - after 2000 -> - fail(CRef) + after ?TIMEOUT -> + ?fail(CRef) end. %% server_capx/3 @@ -373,9 +364,6 @@ client_capx(_, ?caps{origin_host = {[_,$_|"client_reject." ++ _], _}}) -> %% =========================================================================== -fail(T) -> - erlang:error({T, process_info(self(), messages)}). - host(Config) -> {_, H} = lists:keyfind(host, 1, Config), ?HOST(H). |