anchor.diff:  distr_changed_prep(Conf) when is_list(Conf) ->
   
       % Write .app files
  -    ?line {ok, Fd1} = file:open("app1.app", [write]),
  -    ?line w_app1(Fd1),
  -    ?line file:close(Fd1),
  -    ?line {ok, Fd2} = file:open("app2.app", [write]),
  -    ?line w_app2(Fd2),
  -    ?line file:close(Fd2),
  -    ?line {ok, Fd3} = file:open("app3.app", [write]),
  -    ?line w_app3(Fd3),
  -    ?line file:close(Fd3),
  -    ?line {ok, Fd4} = file:open("app6.app", [write]),
  -    ?line w_app6(Fd4),
  -    ?line file:close(Fd4),
  -    ?line {ok, Fd5} = file:open("app7.app", [write]),
  -    ?line w_app7(Fd5),
  -    ?line file:close(Fd5),
  -    ?line {ok, Fd6} = file:open("app8.app", [write]),
  -    ?line w_app8(Fd6),
  -    ?line file:close(Fd6),
  +    {ok, Fd1} = file:open("app1.app", [write]),
  +    w_app1(Fd1),
  +    file:close(Fd1),
  +    {ok, Fd2} = file:open("app2.app", [write]),
  +    w_app2(Fd2),
  +    file:close(Fd2),
  +    {ok, Fd3} = file:open("app3.app", [write]),
  +    w_app3(Fd3),
  +    file:close(Fd3),
  +    {ok, Fd4} = file:open("app6.app", [write]),
  +    w_app6(Fd4),
  +    file:close(Fd4),
  +    {ok, Fd5} = file:open("app7.app", [write]),
  +    w_app7(Fd5),
  +    file:close(Fd5),
  +    {ok, Fd6} = file:open("app8.app", [write]),
  +    w_app8(Fd6),
  +    file:close(Fd6),
   
   
       % Create the .app files and the boot script
  -    ?line {{KernelVer,StdlibVer}, _} = create_script_dc("dc"),
  -
  -    ?line case is_real_system(KernelVer, StdlibVer) of
  +    {{KernelVer,StdlibVer}, _} = create_script_dc("dc"),
  +
  +    case is_real_system(KernelVer, StdlibVer) of
   	      true ->
   		  Options = [];
   	      false  ->
   		  Options = [local]
   	  end,
   
  -    ?line ok = systools:make_script("dc", Options),
  +    ok = systools:make_script("dc", Options),
       
       NodeNames = [Ncp1, Ncp2, Ncp3] = node_names([cp1, cp2, cp3], Conf),
       NoSyncTime = config_fun_fast(config_dc(NodeNames)),
       WithSyncTime = config_fun(config_dc(NodeNames)),
   
  -    ?line Dir = ?config(priv_dir,Conf),
  -    ?line {ok, Fd_dc2} = file:open(filename:join(Dir, "sys2.config"), [write]),
  -    ?line (config_dc2(NodeNames))(Fd_dc2),
  -    ?line file:close(Fd_dc2),
  -    ?line Config2 = filename:join(Dir, "sys2"),
  +    Dir = ?config(priv_dir,Conf),
  +    {ok, Fd_dc2} = file:open(filename:join(Dir, "sys2.config"), [write]),
  +    (config_dc2(NodeNames))(Fd_dc2),
  +    file:close(Fd_dc2),
  +    Config2 = filename:join(Dir, "sys2"),
       
       % Test [cp1, cp2, cp3]
  -    ?line {ok, Cp1} = start_node_boot_config(Ncp1, NoSyncTime, Conf, dc),
  -    ?line {ok, Cp2} = start_node_boot_config(Ncp2, NoSyncTime, Conf, dc),
  -    ?line {ok, Cp3} = start_node_boot_config(Ncp3, WithSyncTime, Conf, dc),
  -    ?line global:sync(),
  +    {ok, Cp1} = start_node_boot_config(Ncp1, NoSyncTime, Conf, dc),
  +    {ok, Cp2} = start_node_boot_config(Ncp2, NoSyncTime, Conf, dc),
  +    {ok, Cp3} = start_node_boot_config(Ncp3, WithSyncTime, Conf, dc),
  +    global:sync(),
   
       %% Read the current configuration parameters, and change them
  -    ?line OldEnv = rpc:call(Cp1, application_controller, prep_config_change, []),
  -    ?line {value, {kernel, OldKernel}} = lists:keysearch(kernel, 1, OldEnv),
  +    OldEnv = rpc:call(Cp1, application_controller, prep_config_change, []),
  +    {value, {kernel, OldKernel}} = lists:keysearch(kernel, 1, OldEnv),
       {OldKernel, OldEnv, {Cp1, Cp2, Cp3}, {Ncp1, Ncp2, Ncp3}, Config2}.
   
   
  
positive.code: config_change(Conf) when is_list(Conf) ->
  
      %% Change to data_dir
      ?line {ok, CWD} = file:get_cwd(),
      ?line DataDir = ?config(data_dir, Conf),
      ?line ok = file:set_cwd(DataDir),
  
      %% Find out application data from boot script
      ?line Boot = filename:join([code:root_dir(), "bin", "start.boot"]),
      ?line {ok, Bin} = file:read_file(Boot),
      ?line Appls = get_appls(binary_to_term(Bin)),
  
      %% Simulate contents of "sys.config"
      ?line Config = [{stdlib, [{par1,sys},{par2,sys}]},
  		    "t1",
  		    "t2.config",
  		    filename:join([DataDir, "subdir", "t3"]),
  		    {stdlib, [{par6,sys}]}],
  
      %% Order application_controller to update configuration
      ?line ok = application_controller:change_application_data(Appls,
  							      Config),
  
      %% Check that stdlib parameters are correctly set
      ?line Env = application:get_all_env(stdlib),
      ?line {value, {par1,sys}} = lists:keysearch(par1, 1, Env),
      ?line {value, {par2,t1}}  = lists:keysearch(par2, 1, Env),
      ?line {value, {par3,t1}}  = lists:keysearch(par3, 1, Env),
      ?line {value, {par4,t2}}  = lists:keysearch(par4, 1, Env),
      ?line {value, {par5,t3}}  = lists:keysearch(par5, 1, Env),
      ?line {value, {par6,sys}} = lists:keysearch(par6, 1, Env),
  
      ?line ok = file:set_cwd(CWD).
  
  %% This function is stolen from SASL module release_handler, OTP R10B
  get_appls({script, _, Script}) ->
  
negative.code:     {OldKernel, OldEnv, {Cp1, Cp2, Cp3}, {_Ncp1, _Ncp2, _Ncp3}, _Config2} = 
  	distr_changed_prep(Conf),
  
      NewDist = {distributed, [{app1, [Cp3]},
  				   {app2, 5000, [Cp2]},
  				   {app3, [Cp3, {Cp1, Cp2}]},
  				   {app6, [Cp1, {Cp3, Cp2}]},
  				   {app7, 1000, [Cp3]},
  				   {app8, [Cp1, {Cp2, Cp3}]}]},
      
      NewKernel = [{kernel, lists:keyreplace(distributed, 1, OldKernel, NewDist)}],
      ok = rpc:call(Cp1, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      ok = rpc:call(Cp2, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      ok = rpc:call(Cp3, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      
      {[ok,ok,ok],[]} = 
  	rpc:multicall([Cp1, Cp2, Cp3], 
  		      application_controller, config_change, [OldEnv]),
      
      test_server:sleep(7000),
      
      DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
      DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
      DcInfo3 = rpc:call(Cp3, dist_ac, info, []),
  
      DcWa1 = which_applications(Cp1),
      DcWa2 = which_applications(Cp2),
      DcWa3 = which_applications(Cp3),
      
      Wa1 = lists:foldl(fun({A1, _N1, _V1}, AccIn) -> [A1 | AccIn] end,
  			    [], DcWa1),
      Wa2 = lists:foldl(fun({A2, _N2, _V2}, AccIn) -> [A2 | AccIn] end,
  			    [], DcWa2),
      Wa3 = lists:foldl(fun({A3, _N3, _V3}, AccIn) -> [A3 | AccIn] end,
  			    [], DcWa3),
      case lists:sort(Wa1) of
  	      [app1, app2, app3, kernel, stdlib] ->
  		  ok;
  	      EWa1 ->
  		  X1 = io_lib:format("distribution error: Cp1 ~p ",[EWa1]),
  		  test_server:fail(lists:flatten(X1))
  	  end,
  		  
      case lists:sort(Wa2) of
  	      [app6, app8, kernel, stdlib] ->
  		  ok;
  	      EWa2 ->
  		  X2 = io_lib:format("distribution error: Cp2 ~p ",[EWa2]),
  		  test_server:fail(lists:flatten(X2))
  	  end,
  		  
      case lists:sort(Wa3) of
  	      [app7, kernel, stdlib] ->
  		  ok;
  	      EWa3 ->
  		  X3 = io_lib:format("distribution error: Cp3 ~p ",[EWa3]),
  		  test_server:fail(lists:flatten(X3))
  	  end,
  		  
      DcInfo1n = rpc:call(Cp1, dist_ac, info, []),
      DcInfo2n = rpc:call(Cp2, dist_ac, info, []),
      DcInfo3n = rpc:call(Cp3, dist_ac, info, []),
  
      %% Added afterwards. Got rid of some warnings for unused variables.
      true = DcInfo1 =:= DcInfo1n,
      true = DcInfo2 =:= DcInfo2n,
      true = DcInfo3 =:= DcInfo3n,
  
      stop_node_nice(Cp1),
      stop_node_nice(Cp2),   
      stop_node_nice(Cp3),   
  
      ok = file:delete("dc.boot"),
      ok = file:delete("dc.rel"),
      ok = file:delete("dc.script"),
  
      ok.
  
  