File 0492-megaco-test-mib-Minor-adjustment-of-the-traffic-case.patch of Package erlang
From 6b58c6af609c60eddfe0cd461ff10bdd8bbe84e6 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Tue, 20 Sep 2022 16:03:24 +0200
Subject: [PATCH 1/3] [megaco|test|mib] Minor adjustment of the traffic case
---
lib/megaco/test/megaco_mib_SUITE.erl | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/megaco/test/megaco_mib_SUITE.erl b/lib/megaco/test/megaco_mib_SUITE.erl
index 965e368f73..65dacf6d43 100644
--- a/lib/megaco/test/megaco_mib_SUITE.erl
+++ b/lib/megaco/test/megaco_mib_SUITE.erl
@@ -675,11 +675,15 @@ traffic_verify_counter(Name, Counter, Counters, Expected) ->
{value, {Counter, Val}} ->
i("counter ~w *not* verified for ~p: "
"~n Expected: ~w"
- "~n Actual: ~w", [Counter, Name, Expected, Val]),
- exit({illegal_counter_value, Counter, Val, Expected, Name});
+ "~n Actual: ~w"
+ "~n Counters: ~w",
+ [Counter, Name, Expected, Val, Counters]),
+ exit({illegal_counter_value, Name, Counter, Expected, Val,
+ Counters});
false ->
- i("counter ~w *not* found for ~p", [Counter, Name]),
- exit({not_found, Counter, Counters, Name, Expected})
+ i("counter ~w *not* found for ~p: "
+ "~n Counters: ~p", [Counter, Name, Counters]),
+ exit({not_found, Name, Counter, Counters, Expected})
end.
@@ -1200,7 +1204,7 @@ start_mg(Node, Mid, Encoding, Transport, Verbosity) ->
mg(Parent, Verbosity, Config) ->
process_flag(trap_exit, true),
put(verbosity, Verbosity),
- put(sname, "MG"),
+ put(sname, get_mg_sname(Config)),
i("mg -> starting"),
{Mid, ConnHandle} = mg_init(Config),
notify_started(Parent),
@@ -1208,6 +1212,14 @@ mg(Parent, Verbosity, Config) ->
i("mg -> started"),
mg_loop(S).
+get_mg_sname(Config) ->
+ case get_conf(local_mid, Config) of
+ {deviceName, Name} ->
+ Name;
+ _ ->
+ "MG"
+end.
+
mg_init(Config) ->
d("mg_init -> entry"),
Mid = get_conf(local_mid, Config),
--
2.35.3