aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-04 10:53:04 +0200
committerMicael Karlberg <[email protected]>2019-04-11 18:55:44 +0200
commitdcd4ba6359ede0f51a2aec9c8ba536e319c36dfa (patch)
treea2e6cb35093498ad35b0459466847c50056c067c
parent8bd83e6a805ee15c52e239e8d404e1d3e1021048 (diff)
downloadotp-dcd4ba6359ede0f51a2aec9c8ba536e319c36dfa.tar.gz
otp-dcd4ba6359ede0f51a2aec9c8ba536e319c36dfa.tar.bz2
otp-dcd4ba6359ede0f51a2aec9c8ba536e319c36dfa.zip
[snmp|agent|test] The agent test local-db may already be started
Handle when the agent test manager starts the fake local-db and that process is already running (for some reason).
-rw-r--r--lib/snmp/test/snmp_test_mgr_misc.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl
index 89d6f93a88..b52cd06bd5 100644
--- a/lib/snmp/test/snmp_test_mgr_misc.erl
+++ b/lib/snmp/test/snmp_test_mgr_misc.erl
@@ -603,9 +603,15 @@ init_usm('version-3', Dir) ->
ets:new(snmp_agent_table, [set, public, named_table]),
ets:insert(snmp_agent_table, {agent_mib_storage, persistent}),
?vlog("init_usm -> try start fake local-db", []),
- {ok, _} = snmpa_local_db:start_link(normal, Dir,
- [{sname, "MGR-LOCAL-DB"},
- {verbosity, trace}]),
+ case snmpa_local_db:start_link(normal, Dir,
+ [{sname, "MGR-LOCAL-DB"},
+ {verbosity, trace}]) of
+ {ok, _} ->
+ ok;
+ {error, {already_started, Pid}} ->
+ ?vlog("already started: ~p"
+ "~n ~p", [process_info(Pid)])
+ end,
NameDb = snmpa_agent:db(snmpEngineID),
?vlog("init_usm -> try set manager engine-id", []),
R = snmp_generic:variable_set(NameDb, "mgrEngine"),