50
50
simple_start_and_stop/1,
51
start_without_mandatory_opts/1,
51
start_without_mandatory_opts1/1,
52
start_without_mandatory_opts2/1,
52
53
start_with_all_valid_opts/1,
53
54
start_with_unknown_opts/1,
54
55
start_with_incorrect_opts/1,
174
175
start_and_stop(suite) ->
176
177
simple_start_and_stop,
177
start_without_mandatory_opts,
178
start_without_mandatory_opts1,
179
start_without_mandatory_opts2,
178
180
start_with_all_valid_opts,
179
181
start_with_unknown_opts,
180
182
start_with_incorrect_opts,
218
start_without_mandatory_opts(suite) -> [];
219
start_without_mandatory_opts(doc) ->
220
"Start the snmp manager config process with the \n"
220
start_without_mandatory_opts1(suite) -> [];
221
start_without_mandatory_opts1(doc) ->
222
"Start the snmp manager config process with some of the \n"
221
223
"mandatory options missing.";
222
start_without_mandatory_opts(Conf) when list(Conf) ->
224
start_without_mandatory_opts1(Conf) when list(Conf) ->
224
226
put(verbosity,trace),
226
228
process_flag(trap_exit, true),
230
232
write_manager_conf(ConfDir),
233
%% First set of options (config, but no dir):
235
%% config, but no dir:
234
236
p("config option, but no dir"),
235
Opts1 = [{priority, normal},
236
{config, [{verbosity, trace}, {db_dir, DbDir}]}, {mibs, []}],
237
%% ?line {error, R1} = snmpm_config:start_link(Opts1),
238
?line {error, {missing_mandatory,dir}} = config_start(Opts1),
239
%% ?line ok = config_stop(),
237
Opts = [{priority, normal},
238
{config, [{verbosity, trace}, {db_dir, DbDir}]}, {mibs, []}],
239
?line {error, {missing_mandatory,dir}} = config_start(Opts),
249
start_without_mandatory_opts2(suite) -> [];
250
start_without_mandatory_opts2(doc) ->
251
"Start the snmp manager config process with some of the \n"
252
"mandatory options missing.";
253
start_without_mandatory_opts2(Conf) when list(Conf) ->
255
put(verbosity,trace),
257
process_flag(trap_exit, true),
258
ConfDir = ?config(manager_conf_dir, Conf),
260
write_manager_conf(ConfDir),
241
263
%% Second set of options (no config):
242
264
p("no config option"),
243
Opts2 = [{priority, normal},
245
?line {error, {missing_mandatory,config,[dir, db_dir]}} = config_start(Opts2),
246
%% ?line ok = config_stop(),
265
Opts = [{priority, normal},
267
?line {error, {missing_mandatory,config,[dir, db_dir]}} =
2165
2192
?line 10 = loop(10, -1, Stats1Inc),
2167
2194
?line ok = snmpm_config:stop(),
2195
await_config_not_running(),
2171
2199
loop(0, Acc, _) ->
2173
loop(N, _, F) when N > 0, function(F) ->
2201
loop(N, _, F) when (N > 0) andalso is_function(F) ->
2175
2203
loop(N-1, Acc, F).
2197
2225
ConfDir = ?config(manager_conf_dir, Config),
2198
2226
DbDir = ?config(manager_db_dir, Config),
2228
p("write manager configuration"),
2200
2229
write_manager_conf(ConfDir),
2202
2231
Opts1 = [{versions, [v1]},
2203
2232
{inform_request_behaviour, user},
2204
2233
{config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}],
2235
p("start manager config"),
2206
2236
?line {ok, _Pid1} = snmpm_config:start_link(Opts1),
2238
p("get some manager config"),
2208
2239
{ok, {user, _}} = snmpm_config:system_info(net_if_irb),
2241
p("stop manager config"),
2210
2242
?line ok = snmpm_config:stop(),
2243
await_config_not_running(),
2212
2245
IRB_TO = 15322,
2213
2246
Opts2 = [{versions, [v1]},
2214
2247
{inform_request_behaviour, {user, IRB_TO}},
2215
2248
{config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}],
2250
p("start manager config"),
2217
2251
?line {ok, _Pid2} = snmpm_config:start_link(Opts2),
2253
p("get some manager config"),
2219
2254
{ok, {user, IRB_TO}} = snmpm_config:system_info(net_if_irb),
2256
p("stop manager config"),
2221
2257
?line ok = snmpm_config:stop(),
2258
await_config_not_running(),