@Test (timeout=15000)
public void testLocalhostReverseLookup() {

  // 127.0.0.1 -> localhost reverse resolution does not happen on Windows.
  Assume.assumeTrue(!Shell.WINDOWS);
  // Make sure when config FS_DEFAULT_NAME_KEY using IP address,
  // it will automatically convert it to hostname
  HdfsConfiguration conf = new HdfsConfiguration();
  conf.set(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY, "hdfs://127.0.0.1:8020");
  Collection<URI> uris = DFSUtil.getNameServiceUris(conf);
  assertEquals(1, uris.size());
  for (URI uri : uris) {
    assertThat(uri.getHost(), not("127.0.0.1"));
  }
}