hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1393914 - in /hadoop/common/branches/branch-1-win: CHANGES.branch-1-win.txt src/test/org/apache/hadoop/security/TestUserGroupInformation.java
Date Thu, 04 Oct 2012 04:58:34 GMT
Author: suresh
Date: Thu Oct  4 04:58:34 2012
New Revision: 1393914

URL: http://svn.apache.org/viewvc?rev=1393914&view=rev
Log:
HADOOP-8879. TestUserGroupInformation fails on Windows when run as Administrator. Contributed
by Bikas Saha.

Modified:
    hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/TestUserGroupInformation.java

Modified: hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt?rev=1393914&r1=1393913&r2=1393914&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt (original)
+++ hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt Thu Oct  4 04:58:34 2012
@@ -146,3 +146,6 @@ BUG FIXES
 
     MAPREDUCE-4567. WindowsResourceCalculatorPlugin has NPE.
     (Bikas Saha via suresh)
+
+    HADOOP-8879. TestUserGroupInformation fails on Windows when run as
+    Administrator. (Bikas Saha via suresh)

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/TestUserGroupInformation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/TestUserGroupInformation.java?rev=1393914&r1=1393913&r2=1393914&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/TestUserGroupInformation.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/TestUserGroupInformation.java
Thu Oct  4 04:58:34 2012
@@ -119,6 +119,8 @@ public class TestUserGroupInformation {
       if (sp != -1) {
         userName = userName.substring(sp + 1);
       }
+      // user names are case insensitive on Windows. Make consistent
+      userName = userName.toLowerCase();
     }
     // get the groups
     pp = Runtime.getRuntime().exec(Shell.WINDOWS ?
@@ -134,7 +136,12 @@ public class TestUserGroupInformation {
     }
     
     final UserGroupInformation login = UserGroupInformation.getCurrentUser();
-    assertEquals(userName, login.getShortUserName());
+    String loginUserName = login.getShortUserName();
+    if(Shell.WINDOWS) {
+      // user names are case insensitive on Windows. Make consistent
+      loginUserName = loginUserName.toLowerCase();
+    }
+    assertEquals(userName, loginUserName);
 
     String[] gi = login.getGroupNames();
     assertEquals(groups.size(), gi.length);



Mime
View raw message