~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/snmp/test/snmp_agent_test_lib.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%<copyright>
2
 
%% <year>2005-2007</year>
 
2
%% <year>2005-2008</year>
3
3
%% <holder>Ericsson AB, All Rights Reserved</holder>
4
4
%%</copyright>
5
5
%%<legalnotice>
335
335
    ?DBG("run -> Crypto: ~p", [Crypto]),
336
336
    catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
337
337
    StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
 
338
    Vsn = get(vsn), 
338
339
    ?DBG("run -> config:"
339
340
           "~n   M:           ~p"
 
341
           "~n   Vsn:         ~p"
340
342
           "~n   Dir:         ~p"
341
343
           "~n   User:        ~p"
342
344
           "~n   SecLevel:    ~p"
344
346
           "~n   CtxEngineID: ~p"
345
347
           "~n   Community:   ~p"
346
348
           "~n   StdM:        ~p",
347
 
           [M,Dir,User,SecLevel,EngineID,CtxEngineID,Community,StdM]),
 
349
           [M,Vsn,Dir,User,SecLevel,EngineID,CtxEngineID,Community,StdM]),
348
350
    case snmp_test_mgr:start([%% {agent, snmp_test_lib:hostname()},
349
 
                         {packet_server_debug,true},
350
 
                         {debug,true},
351
 
                         {agent, get(master_host)}, 
352
 
                         {agent_udp, 4000},
353
 
                         {trap_udp, 5000},
354
 
                         {recbuf,65535},
355
 
                         quiet,
356
 
                         get(vsn),
357
 
                         {community, Community},
358
 
                         {user, User},
359
 
                         {sec_level, SecLevel},
360
 
                         {engine_id, EngineID},
361
 
                         {context_engine_id, CtxEngineID},
362
 
                         {dir, Dir},
363
 
                         {mibs, mibs(StdM, M)}]) of
 
351
                              {packet_server_debug,true},
 
352
                              {debug,true},
 
353
                              {agent, get(master_host)}, 
 
354
                              {agent_udp, 4000},
 
355
                              {trap_udp, 5000},
 
356
                              {recbuf,65535},
 
357
                              quiet,
 
358
                              Vsn, 
 
359
                              {community, Community},
 
360
                              {user, User},
 
361
                              {sec_level, SecLevel},
 
362
                              {engine_id, EngineID},
 
363
                              {context_engine_id, CtxEngineID},
 
364
                              {dir, Dir},
 
365
                              {mibs, mibs(StdM, M)}]) of
364
366
        {ok, _Pid} ->
365
367
            case (catch apply(Mod, Func, Args)) of
366
368
                {'EXIT', Reason} ->
367
369
                    catch snmp_test_mgr:stop(),
368
370
                    ?FAIL({apply_failed, {Mod, Func, Args}, Reason});
369
371
                Res ->
 
372
                    catch snmp_test_mgr:stop(),
370
373
                    Res
371
374
            end;
372
375
        Err ->
374
377
            catch snmp_test_mgr:stop(),
375
378
            ?line ?FAIL({mgr_start, Err})
376
379
    end.
377
 
            
 
380
 
378
381
 
379
382
%% ---------------------------------------------------------------
380
383
%% ---                                                         ---