@Test
  @Ignore // not actual because all configs/attributes/tags were moved to STOMP configurations topic
  public void testReConfigureServiceClient() throws Exception, AuthorizationException {
    String cluster1 = getUniqueName();
    createCluster(cluster1);
    Cluster cluster = clusters.getCluster(cluster1);
    cluster.setDesiredStackVersion(new StackId("HDP-0.1"));
    String serviceName1 = "HDFS";
    String serviceName2 = "MAPREDUCE";
    String componentName1 = "NAMENODE";
    String componentName2 = "DATANODE";
    String componentName3 = "HDFS_CLIENT";
    String componentName4 = "JOBTRACKER";
    String componentName5 = "TASKTRACKER";
    String componentName6 = "MAPREDUCE_CLIENT";

    createService(cluster1, serviceName1, repositoryVersion01, null);
    createService(cluster1, serviceName2, repositoryVersion01, null);

    createServiceComponent(cluster1, serviceName1, componentName1,
      State.INIT);
    createServiceComponent(cluster1, serviceName1, componentName2,
      State.INIT);
    createServiceComponent(cluster1, serviceName1, componentName3,
      State.INIT);
    createServiceComponent(cluster1, serviceName2, componentName4,
      State.INIT);
    createServiceComponent(cluster1, serviceName2, componentName5,
      State.INIT);
    createServiceComponent(cluster1, serviceName2, componentName6,
      State.INIT);

    String host1 = getUniqueName();
    String host2 = getUniqueName();
    String host3 = getUniqueName();

    addHostToCluster(host1, cluster1);
    addHostToCluster(host2, cluster1);
    addHostToCluster(host3, cluster1);

    createServiceComponentHost(cluster1, serviceName1, componentName1,
      host1, null);
    createServiceComponentHost(cluster1, serviceName1, componentName2,
      host1, null);
    createServiceComponentHost(cluster1, serviceName2, componentName4,
      host1, null);
    createServiceComponentHost(cluster1, serviceName2, componentName5,
      host1, null);
    createServiceComponentHost(cluster1, serviceName1, componentName2,
      host2, null);
    createServiceComponentHost(cluster1, serviceName1, componentName3,
      host2, null);
    createServiceComponentHost(cluster1, serviceName2, componentName6,
      host2, null);
    createServiceComponentHost(cluster1, serviceName1, componentName3,
      host3, null);
    createServiceComponentHost(cluster1, serviceName2, componentName6,
      host3, null);

    // Create and attach config
    Map<String, String> configs = new HashMap<>();
    configs.put("a", "b");
    Map<String, String> configs2 = new HashMap<>();
    configs2.put("c", "d");
    Map<String, String> configs3 = new HashMap<>();

    ConfigurationRequest cr1,cr2,cr3,cr4;
    cr1 = new ConfigurationRequest(cluster1, "core-site","version1",
      configs, null);
    cr2 = new ConfigurationRequest(cluster1, "hdfs-site","version1",
      configs, null);
    cr4 = new ConfigurationRequest(cluster1, "kerberos-env", "version1",
      configs3, null);

    ConfigFactory cf = injector.getInstance(ConfigFactory.class);
    Config config1 = cf.createNew(cluster, "kerberos-env", "version1",
      new HashMap<>(), new HashMap<>());

    ClusterRequest crReq = new ClusterRequest(cluster.getClusterId(), cluster1, null, null);
    crReq.setDesiredConfig(Collections.singletonList(cr1));
    controller.updateClusters(Collections.singleton(crReq), null);
    crReq = new ClusterRequest(cluster.getClusterId(), cluster1, null, null);
    crReq.setDesiredConfig(Collections.singletonList(cr2));
    controller.updateClusters(Collections.singleton(crReq), null);
    crReq = new ClusterRequest(cluster.getClusterId(), cluster1, null, null);
    crReq.setDesiredConfig(Collections.singletonList(cr4));
    controller.updateClusters(Collections.singleton(crReq), null);

    // Install
    long requestId1 = installService(cluster1, serviceName1, true, false);

    List<Stage> stages = actionDB.getAllStages(requestId1);

    installService(cluster1, serviceName2, false, false);

    // Start
    startService(cluster1, serviceName1, true, false);
    startService(cluster1, serviceName2, true, false);

    // Reconfigure
    cr3 = new ConfigurationRequest(cluster1, "core-site","version122",
        configs2, null);
    crReq = new ClusterRequest(cluster.getClusterId(), cluster1, null, null);
    crReq.setDesiredConfig(Collections.singletonList(cr3));
    controller.updateClusters(Collections.singleton(crReq), null);

    // Stop HDFS & MAPREDUCE
    stopService(cluster1, serviceName1, false, false);
    stopService(cluster1, serviceName2, false, false);

    // Start
    long requestId2 = startService(cluster1, serviceName1, true, true);
    long requestId3 = startService(cluster1, serviceName2, true, true);

    stages = new ArrayList<>();
    stages.addAll(actionDB.getAllStages(requestId2));
    stages.addAll(actionDB.getAllStages(requestId3));
    HostRoleCommand hdfsCmdHost3 = null;
    HostRoleCommand hdfsCmdHost2 = null;
    HostRoleCommand mapRedCmdHost2 = null;
    HostRoleCommand mapRedCmdHost3 = null;
    for (Stage stage : stages) {
      List<HostRoleCommand> hrcs = stage.getOrderedHostRoleCommands();

      for (HostRoleCommand hrc : hrcs) {
        LOG.debug("role: {}", hrc.getRole());
        if (hrc.getRole().toString().equals("HDFS_CLIENT")) {
          if (hrc.getHostName().equals(host3)) {
            hdfsCmdHost3 = hrc;
          } else if (hrc.getHostName().equals(host2)) {
            hdfsCmdHost2 = hrc;
          }
        }
        if (hrc.getRole().toString().equals("MAPREDUCE_CLIENT")) {
          if (hrc.getHostName().equals(host2)) {
            mapRedCmdHost2 = hrc;
          } else if (hrc.getHostName().equals(host3)) {
            mapRedCmdHost3 = hrc;
          }
        }
      }
    }
    Assert.assertNotNull(hdfsCmdHost3);
    Assert.assertNotNull(hdfsCmdHost2);
    ExecutionCommand execCmd = hdfsCmdHost3.getExecutionCommandWrapper()
      .getExecutionCommand();
    // Check if MapReduce client is reinstalled
    Assert.assertNotNull(mapRedCmdHost2);
    Assert.assertNotNull(mapRedCmdHost3);

    /*
     * Test for lost host
     */
    // Stop HDFS & MAPREDUCE
    stopService(cluster1, serviceName1, false, false);
    stopService(cluster1, serviceName2, false, false);

    clusters.getHost(host2).setState(HostState.HEARTBEAT_LOST);

    // Start MAPREDUCE, HDFS is started as a dependency
    requestId3 = startService(cluster1, serviceName2, true, true);
    stages = actionDB.getAllStages(requestId3);
    HostRoleCommand clientWithHostDown = null;
    for (Stage stage : stages) {
      for (HostRoleCommand hrc : stage.getOrderedHostRoleCommands()) {
        if (hrc.getRole().toString().equals("MAPREDUCE_CLIENT") && hrc
          .getHostName().equals(host2)) {
          clientWithHostDown = hrc;
        }
      }
    }
    Assert.assertNull(clientWithHostDown);

    Assert.assertEquals(State.STARTED, clusters.getCluster(cluster1).
      getService("MAPREDUCE").getServiceComponent("TASKTRACKER").
      getServiceComponentHost(host1).getState());
    Assert.assertEquals(State.STARTED, clusters.getCluster(cluster1).
      getService("HDFS").getServiceComponent("NAMENODE").
      getServiceComponentHost(host1).getState());
    Assert.assertEquals(State.STARTED, clusters.getCluster(cluster1).
      getService("HDFS").getServiceComponent("DATANODE").
      getServiceComponentHost(host1).getState());
  }
Create a cluster with a service, and verify that the request tasks have the correct output log and error log paths.
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java