int startReconfiguration(final String nodeType, final String address)
      throws IOException, InterruptedException {
    return startReconfigurationUtil(nodeType, address, System.out, System.err);
  }
@Test
  public void testAllDatanodesReconfig()
      throws IOException, InterruptedException, TimeoutException {
    ReconfigurationUtil reconfigurationUtil = mock(ReconfigurationUtil.class);
    cluster.getDataNodes().get(0).setReconfigurationUtil(reconfigurationUtil);
    cluster.getDataNodes().get(1).setReconfigurationUtil(reconfigurationUtil);

    List<ReconfigurationUtil.PropertyChange> changes = new ArrayList<>();
    changes.add(new ReconfigurationUtil.PropertyChange(
        DFS_DATANODE_PEER_STATS_ENABLED_KEY, "true",
        datanode.getConf().get(DFS_DATANODE_PEER_STATS_ENABLED_KEY)));
    when(reconfigurationUtil.parseChangedProperties(any(Configuration.class),
        any(Configuration.class))).thenReturn(changes);

    int result = admin.startReconfiguration("datanode", "livenodes");
    Assertions.assertThat(result).isEqualTo(0);
    final List<String> outsForStartReconf = new ArrayList<>();
    final List<String> errsForStartReconf = new ArrayList<>();
    reconfigurationOutErrFormatter("startReconfiguration", "datanode",
        "livenodes", outsForStartReconf, errsForStartReconf);
    String started = "Started reconfiguration task on node";
    String starting =
        "Starting of reconfiguration task successful on 2 nodes, failed on 0 nodes.";
    Assertions.assertThat(outsForStartReconf).hasSize(3);
    Assertions.assertThat(errsForStartReconf).hasSize(0);
    Assertions.assertThat(outsForStartReconf.get(0)).startsWith(started);
    Assertions.assertThat(outsForStartReconf.get(1)).startsWith(started);
    Assertions.assertThat(outsForStartReconf.get(2)).startsWith(starting);

    Thread.sleep(1000);
    final List<String> outs = new ArrayList<>();
    final List<String> errs = new ArrayList<>();
    awaitReconfigurationFinished("datanode", "livenodes", outs, errs);
    Assertions.assertThat(outs).hasSize(9);
    Assertions.assertThat(errs).hasSize(0);
    LOG.info("dfsadmin -status -livenodes output:");
    outs.forEach(s -> LOG.info("{}", s));
    Assertions.assertThat(outs.get(0)).startsWith("Reconfiguring status for node");

    String success = "SUCCESS: Changed property dfs.datanode.peer.stats.enabled";
    String from = "\tFrom: \"false\"";
    String to = "\tTo: \"true\"";
    String retrieval =
        "Retrieval of reconfiguration status successful on 2 nodes, failed on 0 nodes.";

    Assertions.assertThat(outs.subList(1, 5)).containsSubsequence(success, from, to);
    Assertions.assertThat(outs.subList(5, 9)).containsSubsequence(success, from, to, retrieval);
  }