diff options
author | Siri Hansen <[email protected]> | 2012-09-05 13:29:04 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-09-05 13:29:04 +0200 |
commit | 7093815df64fbf090351927282f998a22c3e1470 (patch) | |
tree | 19651244bb44319e79d1be15f01445c43540a92a /lib | |
parent | 50c20c504694ad606b9d1fe705a87b40e46140c3 (diff) | |
parent | 53dfb8dbeba18fbd73d6107f171b65903d65afcb (diff) | |
download | otp-7093815df64fbf090351927282f998a22c3e1470.tar.gz otp-7093815df64fbf090351927282f998a22c3e1470.tar.bz2 otp-7093815df64fbf090351927282f998a22c3e1470.zip |
Merge branch 'siri/sasl/rb_SUITE/OTP-10387'
* siri/sasl/rb_SUITE/OTP-10387:
Fix rb_SUITE failing tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sasl/test/rb_SUITE.erl | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/sasl/test/rb_SUITE.erl b/lib/sasl/test/rb_SUITE.erl index 35a4eb7e7b..b0e43be3a2 100644 --- a/lib/sasl/test/rb_SUITE.erl +++ b/lib/sasl/test/rb_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011. All Rights Reserved. +%% Copyright Ericsson AB 2011-2012. 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 @@ -66,23 +66,31 @@ init_per_group(running_error_logger,Config) -> restart_sasl(), Config. -end_per_group(running_error_logger,Config) -> +end_per_group(running_error_logger,_Config) -> %% Remove log_mf_h??? ok. init_per_testcase(_Case,Config) -> case whereis(?SUP) of - undefined -> ok; - Pid -> kill(Pid) + undefined -> + ok; + Sup -> + Server = whereis(?MODULE), + exit(Sup,kill), + wait_for_down([Server,Sup]) end, empty_error_logs(Config), Config. -kill(Pid) -> +wait_for_down([]) -> + ok; +wait_for_down([undefined|Rest]) -> + wait_for_down(Rest); +wait_for_down([Pid|Rest]) -> Ref = erlang:monitor(process,Pid), - exit(Pid,kill), - receive {'DOWN', Ref, process, Pid, _Info} -> ok end. + receive {'DOWN', Ref, process, Pid, _Info} -> ok end, + wait_for_down(Rest). end_per_testcase(Case,Config) -> try apply(?MODULE,Case,[cleanup,Config]) @@ -96,8 +104,9 @@ end_per_testcase(Case,Config) -> help(_Config) -> Help = capture(fun() -> rb:h() end), - "Report Browser Tool - usage" = hd(Help), - "rb:stop - stop the rb_server" = lists:last(Help), + %% Check that first and last line is there + true = lists:member("Report Browser Tool - usage", Help), + true = lists:member("rb:stop - stop the rb_server", Help), ok. %% Test that all three sasl env vars must be set for a successful start of rb |