anchor.diff:  	 leech_transmission/0, leech_transmission/1]).
   
   -define(TESTFILE30M, "test_file_30M.random").
  +-define(ETORRENT_WORK_DIR, "nothing-et").
   
   suite() ->
       [{timetrap, {minutes, 3}}].
   
   %% Setup/Teardown
   %% ----------------------------------------------------------------------
  +init_per_group(main_group, Config) ->
  +    init_locations(Config);
   init_per_group(_Group, Config) ->
       Config.
   
  
positive.code:     test_server:stop_node(LN),
      ok.
  
  init_per_testcase(leech_transmission, Config) ->
      Data = ?config(data_dir, Config),
      LN = ?config(leech_node, Config),
      Priv = ?config(priv_dir, Config),
      CommonConf = ct:get_config(common_conf),
      LeechConfig = leech_configuration(CommonConf, Priv, "nothing-et"),
      SeedTorrent = filename:join([Data, ?TESTFILE30M ++ ".torrent"]),
      TransmissionSeedTorrent =
  	filename:join([Priv, "nothing", ?TESTFILE30M ++ ".torrent"]),
      LeechTorrent = filename:join([Priv, ?TESTFILE30M ++ ".torrent"]),
      SeedFile = filename:join([Data, ?TESTFILE30M]),
      LeechFile = filename:join([Priv, "nothing-et", ?TESTFILE30M]),
      TransmissionSeedFile = filename:join([Priv, "nothing", ?TESTFILE30M]),
      file:make_dir(filename:join([Priv, "nothing"])),
      file:make_dir(filename:join([Priv, "nothing-et"])),
      {ok, _} = file:copy(SeedTorrent, LeechTorrent),
      {ok, _} = file:copy(SeedTorrent, TransmissionSeedTorrent),
      {ok, _} = file:copy(SeedFile, TransmissionSeedFile),
      DownloadDir = filename:join([Priv, "nothing"]),
      {ok, _} = file:copy(filename:join([Data, "transmission", "settings.json"]),
  			filename:join([DownloadDir, "settings.json"])),
      {Ref, Pid} = start_transmission(Data,
  				    DownloadDir,
  				    LeechTorrent),
      ok = ct:sleep({seconds, 8}), %% Wait for transmission to start up
      ok = rpc:call(LN, etorrent, start_app, [LeechConfig]),
      [{ln, LN},
       {transmission_port, {Ref, Pid}},
       {seed_torrent, SeedTorrent},
       {leech_torrent, LeechTorrent},
       {seed_file, SeedFile},
       {leech_file, LeechFile} | Config];
  init_per_testcase(seed_transmission, Config) ->
      Data = ?config(data_dir, Config),
      SN = ?config(seed_node, Config),
  
negative.code: 
  leech_transmission(Config) ->
      {Ref, Pid} = {make_ref(), self()},
      ok = rpc:call(?config(leech_node, Config),
  		  etorrent, start,
  		  [?config(seed_torrent, Config), {Ref, Pid}]),
      receive
  	{Ref, done} -> ok
      after
  	120*1000 -> exit(timeout_error)
      end,
      sha1_file(?config(tr_seed_file, Config))
  	=:= sha1_file(?config(et_leech_file, Config)).
  
  seed_leech() ->
      [{require, common_conf, etorrent_common_config}].
  