aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test/snmp_test_mgr_misc.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-05 12:37:19 +0200
committerMicael Karlberg <[email protected]>2019-04-11 18:55:44 +0200
commit5ac8a73af358e47666e4a3bb6bbe3edbfe98bf36 (patch)
tree5caffa22e632a35efc5b5d9ea8046a9811422986 /lib/snmp/test/snmp_test_mgr_misc.erl
parentdcd4ba6359ede0f51a2aec9c8ba536e319c36dfa (diff)
downloadotp-5ac8a73af358e47666e4a3bb6bbe3edbfe98bf36.tar.gz
otp-5ac8a73af358e47666e4a3bb6bbe3edbfe98bf36.tar.bz2
otp-5ac8a73af358e47666e4a3bb6bbe3edbfe98bf36.zip
[snmp|agent|test] More test tweaking
Improved test printouts (more with timestamps), also fixed the printouts of the (fake) local-db start result printout. Also updated the copyright end-dates.
Diffstat (limited to 'lib/snmp/test/snmp_test_mgr_misc.erl')
-rw-r--r--lib/snmp/test/snmp_test_mgr_misc.erl21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl
index b52cd06bd5..badbbad894 100644
--- a/lib/snmp/test/snmp_test_mgr_misc.erl
+++ b/lib/snmp/test/snmp_test_mgr_misc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-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.
@@ -39,11 +39,13 @@
-define(SNMP_USE_V3, true).
-include_lib("snmp/include/snmp_types.hrl").
-include_lib("snmp/src/misc/snmp_verbosity.hrl").
+-include("snmp_test_lib.hrl").
%%----------------------------------------------------------------------
%% The InHandler process will receive messages on the form {snmp_pdu, Pdu}.
%%----------------------------------------------------------------------
+
start_link_packet(
InHandler, AgentIp, UdpPort, TrapUdp, VsnHdr, Version, Dir, BufSz) ->
start_link_packet(
@@ -606,11 +608,12 @@ init_usm('version-3', Dir) ->
case snmpa_local_db:start_link(normal, Dir,
[{sname, "MGR-LOCAL-DB"},
{verbosity, trace}]) of
- {ok, _} ->
- ok;
+ {ok, Pid} ->
+ ?vlog("started: ~p"
+ "~n ~p", [Pid, process_info(Pid)]);
{error, {already_started, Pid}} ->
?vlog("already started: ~p"
- "~n ~p", [process_info(Pid)])
+ "~n ~p", [Pid, process_info(Pid)])
end,
NameDb = snmpa_agent:db(snmpEngineID),
?vlog("init_usm -> try set manager engine-id", []),
@@ -819,13 +822,15 @@ sz(O) ->
{unknown_size, O}.
d(F) -> d(F, []).
-d(F,A) -> d(get(debug),F,A).
+d(F,A) -> d(get(debug), F, A).
-d(true,F,A) ->
- io:format("*** [~s] MGR_PS_DBG *** " ++ F ++ "~n",
- [formated_timestamp()|A]);
+d(true, F, A) ->
+ print(F, A);
d(_,_F,_A) ->
ok.
+print(F, A) ->
+ ?PRINT2("MGR_PS " ++ F, A).
+
formated_timestamp() ->
snmp_test_lib:formated_timestamp().