2365
otp_8395_1(suite) -> [];
2368
otp_8395_1(Conf) when is_list(Conf) ->
2369
put(tname, otp_8395_1),
2371
process_flag(trap_exit, true),
2372
otp8395(Conf, false, ok),
2375
otp_8395_2(suite) -> [];
2378
otp_8395_2(Conf) when is_list(Conf) ->
2379
put(tname, otp_8395_2),
2381
process_flag(trap_exit, true),
2382
otp8395(Conf, true, ok),
2385
otp_8395_3(suite) -> [];
2388
otp_8395_3(Conf) when is_list(Conf) ->
2389
put(tname, otp_8395_3),
2391
process_flag(trap_exit, true),
2392
otp8395(Conf, gurka, error),
2395
otp8395(Conf, SeqNoVal, Expect) ->
2396
ConfDir = ?config(manager_conf_dir, Conf),
2397
DbDir = ?config(manager_db_dir, Conf),
2398
LogDir = ?config(manager_log_dir, Conf),
2399
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
2401
write_manager_conf(ConfDir),
2403
%% Third set of options (no versions):
2405
NetIfOpts = [{module, snmpm_net_if},
2407
{options, [{recbuf, 30000},
2409
{no_reuse, false}]}],
2410
ServerOpts = [{timeout, 10000}, {verbosity, trace}],
2411
NoteStoreOpts = [{timeout, 20000}, {verbosity, trace}],
2412
ConfigOpts = [{dir, ConfDir}, {verbosity, trace}, {db_dir, DbDir}],
2413
Mibs = [join(StdMibDir, "SNMP-NOTIFICATION-MIB"),
2414
join(StdMibDir, "SNMP-USER-BASED-SM-MIB")],
2416
ATL = [{type, read_write},
2422
Opts = [{config, ConfigOpts},
2423
{net_if, NetIfOpts},
2424
{server, ServerOpts},
2425
{note_store, NoteStoreOpts},
2426
{audit_trail_log, ATL},
2431
case config_start(Opts) of
2432
{ok, _Pid} when (Expect =:= ok) ->
2433
?line ok = config_stop(),
2435
{ok, _Pid} when (Expect =/= ok) ->
2437
exit({unexpected_started_config, SeqNoVal});
2438
_Error when (Expect =/= ok) ->
2440
Error when (Expect =:= ok) ->
2441
exit({unexpected_failed_starting_config, SeqNoVal, Error})
2447
otp_8395_4(suite) -> [];
2450
otp_8395_4(Conf) when is_list(Conf) ->
2451
put(tname, otp_8395_4),
2453
process_flag(trap_exit, true),
2455
snmp:print_version_info(),
2457
ConfDir = ?config(manager_conf_dir, Conf),
2458
DbDir = ?config(manager_db_dir, Conf),
2459
LogDir = ?config(manager_log_dir, Conf),
2460
StdMibDir = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
2462
write_manager_conf(ConfDir),
2464
%% Third set of options (no versions):
2466
NetIfOpts = [{module, snmpm_net_if},
2468
{options, [{recbuf, 30000},
2470
{no_reuse, false}]}],
2471
ServerOpts = [{timeout, 10000}, {verbosity, trace}],
2472
NoteStoreOpts = [{timeout, 20000}, {verbosity, trace}],
2473
ConfigOpts = [{dir, ConfDir}, {verbosity, trace}, {db_dir, DbDir}],
2474
Mibs = [join(StdMibDir, "SNMP-NOTIFICATION-MIB"),
2475
join(StdMibDir, "SNMP-USER-BASED-SM-MIB")],
2477
ATL = [{type, read_write},
2483
Opts = [{config, ConfigOpts},
2484
{net_if, NetIfOpts},
2485
{server, ServerOpts},
2486
{note_store, NoteStoreOpts},
2487
{audit_trail_log, ATL},
2492
?line {ok, _Pid} = config_start(Opts),
2494
Counter = otp_8395_4,
2499
%% At this call the counter does *not* exist. The call creates
2500
%% it with the initial value!
2503
Val1 = otp8395_incr_counter(Counter, Initial, Increment, Max),
2505
%% Now it exist, make sure another call does the expected increment
2507
Val2 = Initial + Increment,
2508
Val2 = otp8395_incr_counter(Counter, Initial, Increment, Max),
2510
?line ok = config_stop(),
2516
otp8395_incr_counter(Counter, Initial, Increment, Max) ->
2517
snmpm_config:increment_counter(Counter, Initial, Increment, Max).
2350
2520
%%======================================================================
2351
2521
%% Internal functions
2352
2522
%%======================================================================