anchor.diff:  		false -> {fail, "Bad logfile"}
   	    end
       end.
  +
  +%%-------------------------------------------------------------------------
  +start_ftp() ->
  +    [{doc, "Start/stop of ftp service"}].
  +start_ftp(Config) ->
  +    Pid0 = proplists:get_value(ftp,Config),
  +    Pids0 = [ServicePid || {_, ServicePid} <- ftp:services()],
  +    true = lists:member(Pid0, Pids0),
  +    {ok, [_|_]} = ftp:service_info(Pid0),
  +    ftp:stop_service(Pid0),
  +    ct:sleep(100),
  +    Pids1 =  [ServicePid || {_, ServicePid} <- ftp:services()], 
  +    false = lists:member(Pid0, Pids1),
  +
  +    Host = proplists:get_value(ftpd_host,Config),
  +    Port = proplists:get_value(ftpd_port,Config),
  +
  +    {ok, Pid1} = ftp:start_standalone([{host, Host},{port, Port}]),
  +    Pids2 =  [ServicePid || {_, ServicePid} <- ftp:services()],
  +    false = lists:member(Pid1, Pids2).
  +
  +%%-------------------------------------------------------------------------
  +ftp_worker() ->
  +    [{doc, "Makes sure the ftp worker processes are added and removed "
  +      "appropriatly to/from the supervison tree."}].
  +ftp_worker(Config) ->
  +    Pid = proplists:get_value(ftp,Config),
  +    case supervisor:which_children(ftp_sup) of
  +        [{_,_, worker, [ftp]}] ->
  +            ftp:stop_service(Pid), 
  +            ct:sleep(5000),
  +            [] = supervisor:which_children(ftp_sup),
  +            ok;
  +        Children ->
  +            ct:fail("Unexpected children: ~p",[Children])
  +    end.
  +
   
   %%%----------------------------------------------------------------
   %%% Error codes not tested elsewhere
  
positive.code:      {group, ftp_active},
       {group, ftps_passive},
       {group, ftps_active},
       error_ehost,
       clean_shutdown
      ].
  
negative.code:     ok = ftp:close(proplists:get_value(ftp,Config)),
      Config.
  
  ftp_start_service(Config, Options) ->
      Host = proplists:get_value(ftpd_host,Config),
      Port = proplists:get_value(ftpd_port,Config),
      ct:log("Host=~p, Port=~p",[Host,Port]),
      {ok,Pid} = ftp:start_service([{host, Host},{port,Port} | Options]),
      [{ftp,Pid}|Config].
  
  ftp_stop_service(Config) ->
      ok = ftp:stop_service(proplists:get_value(ftp,Config)),
      Config.
  
  split(Cs) -> string:tokens(Cs, "\r\n").
  
  find_diff(Bin1, Bin2) -> 
  