diff options
author | Micael Karlberg <[email protected]> | 2019-06-10 20:55:48 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-07-01 18:01:56 +0200 |
commit | eb12db36e0e66055fddb31f52c03b423997528b0 (patch) | |
tree | ea0debfd0477f31ec1e6fa6ba6dd255f9682c509 /lib/megaco/examples/simple/megaco_simple_mgc.erl | |
parent | d96df449f8232c33dff837b13a5f706390301b71 (diff) | |
download | otp-eb12db36e0e66055fddb31f52c03b423997528b0.tar.gz otp-eb12db36e0e66055fddb31f52c03b423997528b0.tar.bz2 otp-eb12db36e0e66055fddb31f52c03b423997528b0.zip |
[megaco|test] Fixing the examples test suite
The simple test case was faulty in that the simple example
(which it is testing) require that the MGC and MG run on different
erlang nodes. But the test case did not do this. Instead, it ran
both the MGC and the MG on the test server node, which caused
the test case to fail 1 time of 10.
Diffstat (limited to 'lib/megaco/examples/simple/megaco_simple_mgc.erl')
-rw-r--r-- | lib/megaco/examples/simple/megaco_simple_mgc.erl | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/megaco/examples/simple/megaco_simple_mgc.erl b/lib/megaco/examples/simple/megaco_simple_mgc.erl index f324e17a3a..8a78262b86 100644 --- a/lib/megaco/examples/simple/megaco_simple_mgc.erl +++ b/lib/megaco/examples/simple/megaco_simple_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2016. All Rights Reserved. +%% Copyright Ericsson AB 2001-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -193,15 +193,17 @@ stop(Mid) -> d("stop -> entry with~n Mid: ~p", [Mid]), Disco = fun(CH) -> d("stop -> CH: ~p", [CH]), - Reason = stopped_by_user, - Pid = megaco:conn_info(CH, control_pid), - SendMod = megaco:conn_info(CH, send_mod), + Reason = stopped_by_user, + Pid = megaco:conn_info(CH, control_pid), + SendMod = megaco:conn_info(CH, send_mod), SendHandle = megaco:conn_info(CH, send_handle), d("stop -> disconnect", []), megaco:disconnect(CH, Reason), + d("stop -> cancel", []), - megaco:cancel(CH, Reason), + megaco:cancel(CH, Reason), % see handle_disconnect + d("stop -> close transport" "~n SendMod: ~p" "~n SendHandle: ~p", [SendMod, SendHandle]), @@ -247,6 +249,7 @@ handle_disconnect(ConnHandle, ProtocolVersion, Reason) -> "~n ProtocolVersion: ~p" "~n Reason: ~p" "", [ConnHandle, ProtocolVersion, Reason]), + info_msg("handle_disconnect - cancel outstanding messages~n"), megaco:cancel(ConnHandle, Reason), % Cancel the outstanding messages ok. @@ -443,6 +446,12 @@ get_arg(Key, Args) -> %% DEBUGGING %%---------------------------------------------------------------------- +info_msg(F) -> + info_msg(F, []). +info_msg(F, A) -> + io:format("~p MGC: " ++ F ++ "~n", [self()|A]). + + d(F) -> d(F, []). |