@Test
public void testSuccessfulBaseCase() throws Exception {

  removeStandbyNameDirs();
  // skip the first NN, its up
  for (int index = 1; index < maxNNCount; index++) {
    try {
      cluster.restartNameNode(index);
      fail("Did not throw");
    } catch (IOException ioe) {
      GenericTestUtils.assertExceptionContains(
          "storage directory does not exist or is not accessible", ioe);
    }
    int expectedCheckpointTxId = (int)NameNodeAdapter.getNamesystem(nn0)
        .getFSImage().getMostRecentCheckpointTxId();
    int rc = BootstrapStandby.run(new String[] { "-nonInteractive" },
        cluster.getConfiguration(index));
    assertEquals(0, rc);
    // Should have copied over the namespace from the active
    FSImageTestUtil.assertNNHasCheckpoints(cluster, index,
        ImmutableList.of(expectedCheckpointTxId));
  }
  // We should now be able to start the standbys successfully.
  restartNameNodesFromIndex(1);
}