HADOOP-9431 TestSecurityUtil#testLocalHostNameForNullOrWild on systems where hostname contains capital letters (Chris Nauroth via sanjay)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1460181 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sanjay Radia 2013-03-23 16:07:48 +00:00
parent 0f4cad57b8
commit 1186572389
2 changed files with 5 additions and 1 deletions

View File

@ -355,6 +355,9 @@ Trunk (Unreleased)
HADOOP-9405. TestGridmixSummary#testExecutionSummarizer is broken. (Andrew
Wang via atm)
HADOOP-9431 TestSecurityUtil#testLocalHostNameForNullOrWild on systems where hostname
contains capital letters (Chris Nauroth via sanjay)
OPTIMIZATIONS
HADOOP-7761. Improve the performance of raw comparisons. (todd)

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.Locale;
import javax.security.auth.kerberos.KerberosPrincipal;
@ -112,7 +113,7 @@ public class TestSecurityUtil {
@Test
public void testLocalHostNameForNullOrWild() throws Exception {
String local = SecurityUtil.getLocalHostName();
String local = SecurityUtil.getLocalHostName().toLowerCase(Locale.US);
assertEquals("hdfs/" + local + "@REALM",
SecurityUtil.getServerPrincipal("hdfs/_HOST@REALM", (String)null));
assertEquals("hdfs/" + local + "@REALM",