From 8377b4238abcd646fbba58f2378c017102df44c6 Mon Sep 17 00:00:00 2001
From: Todd Lipcon <todd@cloudera.com>
Date: Fri, 22 Jan 2010 11:45:35 -0800
Subject: [PATCH] HDFS-908 v2: Fix TestDistributedFileSystem hftp URI checking

The previous patch fixed some systems but broke others.
---
 .../hadoop/hdfs/TestDistributedFileSystem.java     |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
index 764b104..a30257b 100644
--- a/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
+++ b/src/test/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
@@ -131,13 +131,11 @@ 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://127.0.0.1:" +
-      cluster.getNameNode().getHttpAddress().getPort();
+    String hftpuri = "hftp://" + conf.get("dfs.http.address");
 
     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());
+    hftpuri = hftp.getUri().toString();
 
     final String dir = "/filechecksum";
     final int block_size = 1024;
-- 
1.6.0.4

