From 97efc24a0e46f243d1903ca762ccc8f1971c9213 Mon Sep 17 00:00:00 2001
From: Todd Lipcon <todd@cloudera.com>
Date: Tue, 19 Jan 2010 18:58:06 -0800
Subject: [PATCH] HDFS-908. Fix TestDistributedFileSystem on nodes with strange local DNS

---
 .../hadoop/hdfs/TestDistributedFileSystem.java     |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
index dd9767b..764b104 100644
--- a/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
+++ b/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
@@ -130,9 +130,14 @@ public class TestDistributedFileSystem extends junit.framework.TestCase {
 
     final MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
     final FileSystem hdfs = cluster.getFileSystem();
-    final String hftpuri = "hftp://" + conf.get("dfs.http.address");
+
+    final String hftpuri = "hftp://127.0.0.1:" +
+      cluster.getNameNode().getHttpAddress().getPort();
+
     System.out.println("hftpuri=" + hftpuri);
     final FileSystem hftp = new Path(hftpuri).getFileSystem(conf);
+    System.out.println("hftpuri back=" + hftp.getUri());
+    assertEquals(hftp.getUri().toString(), hftpuri.toString());
 
     final String dir = "/filechecksum";
     final int block_size = 1024;
-- 
1.6.0.4

