anchor.diff:  req_and_cancel(doc) ->
       [];
   req_and_cancel(Config) when is_list(Config) ->
  -    put(verbosity, ?TEST_VERBOSITY),
  -    put(sname,     "TEST"),
  -    i("req_and_cancel -> starting"),
  -
  -    MgcNode = make_node_name(mgc),
  -    Mg1Node = make_node_name(mg1),
  -
  -    d("req_and_cancel -> Nodes: "
  -      "~n   MgcNode: ~p"
  -      "~n   Mg1Node: ~p", 
  -      [MgcNode, Mg1Node]),
  -    ok = megaco_test_lib:start_nodes([MgcNode, Mg1Node], 
  -				     ?FILE, ?LINE),
  -
  +    Pre = fun() ->
  +                  MgcNode = make_node_name(mgc),
  +                  MgNode  = make_node_name(mg),
  +                  d("try start nodes: "
  +                    "~n      MgcNode: ~p"
  +                    "~n      MgNode:  ~p", 
  +                    [MgcNode, MgNode]),
  +                  Nodes = [MgcNode, MgNode],
  +                  ok    = ?START_NODES(Nodes),
  +                  Nodes
  +          end,
  +    Case = fun do_req_and_cancel/1,
  +    Post = fun(Nodes) ->
  +                   d("stop nodes (in the reverse order):"
  +                     "~n       ~p", [Nodes]),
  +                   ?STOP_NODES(lists:reverse(Nodes))
  +           end,
  +    try_tc(req_and_cancel, Pre, Case, Post).
  +
  +do_req_and_cancel([MgcNode, MgNode]) ->
       %% Start the MGC and MGs
  -    i("req_and_cancel -> start the MGC"),    
  +    i("start the MGC"),    
       ET = [{text,tcp}, {text,udp}, {binary,tcp}, {binary,udp}],
       {ok, Mgc} = 
   	?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY),
   
  -    i("req_and_cancel -> start the MG"),
  -    {ok, Mg1} = 
  -	?MG_START(Mg1Node, {deviceName, "mg1"}, text, tcp, ?MG_VERBOSITY),
  -
  -    i("req_and_cancel -> connect the MG"),
  -    Res1 = ?MG_SERV_CHANGE(Mg1),
  -    d("req_and_cancel -> service change result: ~p", [Res1]),
  -
  -
  -    sleep(1000),
  -
  -    i("req_and_cancel -> change request action to pending"),
  +    i("start the MG"),
  +    {ok, Mg} =
  +	?MG_START(MgNode, {deviceName, "mg"}, text, tcp, ?MG_VERBOSITY),
  +
  +    i("connect the MG"),
  +    Res1 = ?MG_SERV_CHANGE(Mg),
  +    d("service change result: ~p", [Res1]),
  +
  +
  +    sleep(1000),
  +
  +    i("change request action to pending"),
       {ok, _} = ?MGC_REQ_DISC(Mgc,5000),
   
  -    i("req_and_cancel -> send notify request"),
  -    ?MG_NOTIF_REQ(Mg1),
  +    i("send notify request"),
  +    ?MG_NOTIF_REQ(Mg),
       
  -    d("req_and_cancel -> wait some to get it going",[]),
  -    sleep(1000),
  -
  -    i("req_and_cancel -> now cancel the notify request"),
  -    ok = ?MG_CANCEL(Mg1,req_and_cancel),
  -
  -    i("req_and_cancel -> now await the notify request result"),
  -    Res2 = ?MG_NOTIF_AR(Mg1),
  -    req_and_cancel_analyze_result(Res2),
  +    d("wait some to get it going",[]),
  +    sleep(1000),
  +
  +    i("now cancel the notify request"),
  +    ok = ?MG_CANCEL(Mg, req_and_cancel),
  +
  +    i("now await the notify request result"),
  +    Res2 = ?MG_NOTIF_AR(Mg),
  +    rac_analyze_result(Res2),
       
   
       %% Tell MGs to stop
  -    i("req_and_cancel -> stop the MGs"),
  -    ?MG_STOP(Mg1),
  +    i("stop the MG"),
  +    ?MG_STOP(Mg),
   
       %% Tell Mgc to stop
  -    i("req_and_cancel -> stop the MGC"),
  +    i("stop the MGC"),
       ?MGC_STOP(Mgc),
   
  -    i("req_and_cancel -> done", []),
  -    ok.% ?SKIP(not_implemented_yet).
  -
  -
  -req_and_cancel_analyze_result({ok,{_PV,Res}}) ->
  -    i("req_and_cancel_analyze_result -> notify request result: ~n   ~p", [Res]),
  -    req_and_cancel_analyze_result2(Res);
  -req_and_cancel_analyze_result(Unexpected) ->
  -    e("req_and_cancel_analyze_result -> unexpected result: "
  +    i("done", []),
  +    ok.
  +
  +
  +rac_analyze_result({ok, {_PV,Res}}) ->
  +    i("rac_analyze_result -> notify request result:"
  +      "~n      ~p", [Res]),
  +    rac_analyze_result2(Res);
  +rac_analyze_result(Unexpected) ->
  +    e("rac_analyze_result -> unexpected result: "
         "~n      ~p", [Unexpected]),
       exit({unexpected_result, Unexpected}).
   
  -req_and_cancel_analyze_result2({error,{user_cancel,req_and_cancel}}) ->
  +rac_analyze_result2({error,{user_cancel, req_and_cancel}}) ->
       ok;
  -req_and_cancel_analyze_result2([]) ->
  +rac_analyze_result2([]) ->
       ok;
  -req_and_cancel_analyze_result2([{error,{user_cancel,req_and_cancel}}|Res]) ->
  -    req_and_cancel_analyze_result2(Res);
  -req_and_cancel_analyze_result2([Unknown|_Res]) ->
  -    e("req_and_cancel_analyze_result2 -> unexpected result: "
  +rac_analyze_result2([{error,{user_cancel, req_and_cancel}}|Res]) ->
  +    rac_analyze_result2(Res);
  +rac_analyze_result2([Unknown|_Res]) ->
  +    e("rac_analyze_result2 -> unexpected result: "
         "~n      ~p", [Unknown]),
       exit({unknown_result, Unknown}).
       
  
positive.code:     %% Collect the statistics
      i("collect the MGC statistics"),
      {ok, MgcStats4} = ?MGC_GET_STATS(Mgc, 1),
      d("stats (1) for Mgc: ~n~p~n", [MgcStats4]),
      {ok, MgcStats5} = ?MGC_GET_STATS(Mgc, 2),
      d("stats (2) for Mgc: ~n~p~n", [MgcStats5]),
  
      %% Tell Mgc to stop
      i("stop the MGC"),
  
negative.code:     lists:reverse(Acc);
  rar_get_mg_stats([{Name, Pid}|Mgs], Acc) ->
      {ok, Stats} = ?MG_GET_STATS(Pid),
      d("rar_get_mg_stats -> stats for ~s: "
        "~n      ~p"
        "~n", [Name, Stats]),
      rar_get_mg_stats(Mgs, [{Name, Stats}|Acc]).
  
  
  