Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:Ledest:erlang:23
erlang
7612-snmp-manager-test-Improved-printouts.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 7612-snmp-manager-test-Improved-printouts.patch of Package erlang
From 75423cd5d982733029a1c678533d047aea8c7543 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 15 Dec 2020 18:34:06 +0100 Subject: [PATCH 2/2] [snmp|manager|test] Improved printouts --- lib/snmp/test/snmp_manager_SUITE.erl | 46 ++++++++++++++++++---------- lib/snmp/test/snmp_manager_user.erl | 5 ++- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/lib/snmp/test/snmp_manager_SUITE.erl b/lib/snmp/test/snmp_manager_SUITE.erl index 6cc84d1e35..53557f7d77 100644 --- a/lib/snmp/test/snmp_manager_SUITE.erl +++ b/lib/snmp/test/snmp_manager_SUITE.erl @@ -2139,10 +2139,22 @@ do_simple_sync_get3(Config, Get, PostVerify) -> do_simple_sync_get3(Node, TargetName, Oids, Get, PostVerify) when is_function(Get, 3) andalso is_function(PostVerify, 0) -> - ?line {ok, Reply, _Rem} = Get(Node, TargetName, Oids), - ?DBG("~n Reply: ~p" - "~n Rem: ~w", [Reply, _Rem]), + ?IPRINT("try get for ~p (on ~p):" + "~n Oids: ~p", [TargetName, Node, Oids]), + ?line Reply = + case Get(Node, TargetName, Oids) of + {ok, R, _Rem} -> + ?IPRINT("get reply: " + "~n Reply: ~p" + "~n Rem: ~w", [R, _Rem]), + + R; + {error, Reason} = ERROR -> + ?EPRINT("get failed: " + "~n ~p", [Reason]), + ERROR + end, %% verify that the operation actually worked: %% The order should be the same, so no need to search @@ -5320,11 +5332,11 @@ start_manager(Node, Vsns, Config) -> start_manager(Node, Vsns, Config, []). start_manager(Node, Vsns, Conf0, _Opts) -> - ?DBG("start_manager -> entry with" - "~n Node: ~p" - "~n Vsns: ~p" - "~n Conf0: ~p" - "~n Opts: ~p", [Node, Vsns, Conf0, _Opts]), + ?IPRINT("start_manager -> entry with" + "~n Node: ~p" + "~n Vsns: ~p" + "~n Conf0: ~p" + "~n Opts: ~p", [Node, Vsns, Conf0, _Opts]), AtlDir = ?config(manager_log_dir, Conf0), ConfDir = ?config(manager_conf_dir, Conf0), @@ -5490,16 +5502,16 @@ start_manager_node() -> start_node(Name) -> start_node(Name, true). start_node(Name, Retry) -> + + ?IPRINT("start_node -> entry with" + "~n Name: ~p" + "~n when" + "~n hostname of this node: ~p", + [Name, list_to_atom(?HOSTNAME(node()))]), + Pa = filename:dirname(code:which(?MODULE)), - Args = case init:get_argument('CC_TEST') of - {ok, [[]]} -> - " -pa /clearcase/otp/libraries/snmp/ebin "; - {ok, [[Path]]} -> - " -pa " ++ Path; - error -> - "" - end, - A = Args ++ " -pa " ++ Pa ++ + + A = " -pa " ++ Pa ++ " -s " ++ atom_to_list(snmp_test_sys_monitor) ++ " start" ++ " -s global sync", try ?START_NODE(Name, A) of diff --git a/lib/snmp/test/snmp_manager_user.erl b/lib/snmp/test/snmp_manager_user.erl index 60a6844875..5c56ed5c15 100644 --- a/lib/snmp/test/snmp_manager_user.erl +++ b/lib/snmp/test/snmp_manager_user.erl @@ -321,11 +321,14 @@ loop(#state{parent = Parent, id = Id} = S) -> {{sync_get2, TargetName, Oids, SendOpts}, From, Ref} when is_list(TargetName) -> + snmpm:verbosity(server, trace), d("loop -> received sync_get2 request with" "~n TargetName: ~p" "~n Oids: ~p" "~n SendOpts: ~p", [TargetName, Oids, SendOpts]), Res = snmpm:sync_get2(Id, TargetName, Oids, SendOpts), + d("loop -> result:" + "~n ~p", [Res]), reply(From, Res, Ref), loop(S); @@ -637,6 +640,6 @@ d(F, A) -> d(get(debug), F, A). d(true, F, A) -> - io:format("~w:" ++ F ++ "~n", [?SERVER|A]); + ?IPRINT("~w:" ++ F, [?SERVER|A]); d(_, _, _) -> ok. -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor