hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r601920 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/ShellCommand.java src/java/org/apache/hadoop/security/UnixUserGroupInformation.java src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
Date Thu, 06 Dec 2007 23:51:01 GMT
Author: dhruba
Date: Thu Dec  6 15:51:00 2007
New Revision: 601920

URL: http://svn.apache.org/viewvc?rev=601920&view=rev
Log:
HADOOP-2368.  Fix unit tests on Windows.
(Tsz Wo (Nicholas), SZE via dhruba)


Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ShellCommand.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=601920&r1=601919&r2=601920&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Dec  6 15:51:00 2007
@@ -208,6 +208,9 @@
     HADOOP-2349.  Improve code layout in file system transaction logging code.
     (Tsz Wo (Nicholas), SZE via dhruba)
 
+    HADOOP-2368.  Fix unit tests on Windows.
+    (Tsz Wo (Nicholas), SZE via dhruba)
+
 Branch 0.15 (unreleased)
 
   BUG FIXES

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ShellCommand.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ShellCommand.java?rev=601920&r1=601919&r2=601920&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ShellCommand.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/ShellCommand.java Thu Dec  6 15:51:00
2007
@@ -26,7 +26,9 @@
   /** a Unix command to get the current user's name */
   public final static String USER_NAME_COMMAND = "whoami";
   /** a Unix command to get the current user's groups list */
-  public static final String GROUPS_COMMAND = "groups";
+  public static String[] getGROUPS_COMMAND() {
+    return new String[]{"bash", "-c", "groups"};
+  }
   /** a Unix command to set permission */
   public static final String SET_PERMISSION_COMMAND = "chmod";
   /** a Unix command to set owner */

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java?rev=601920&r1=601919&r2=601920&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
(original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/security/UnixUserGroupInformation.java
Thu Dec  6 15:51:00 2007
@@ -303,7 +303,7 @@
    * @throws IOException if encounter any error when running the command
    */
   private static String[] getUnixGroups() throws IOException {
-    return executeShellCommand(new String[]{ShellCommand.GROUPS_COMMAND});
+    return executeShellCommand(ShellCommand.getGROUPS_COMMAND());
   }
   
   /* Execute a command and return the result as an array of Strings */

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java?rev=601920&r1=601919&r2=601920&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystemPermission.java Thu
Dec  6 15:51:00 2007
@@ -140,7 +140,7 @@
 
   static List<String> getGroups() throws IOException {
     List<String> a = new ArrayList<String>();
-    String s = ShellCommand.execCommand(ShellCommand.GROUPS_COMMAND);
+    String s = ShellCommand.execCommand(ShellCommand.getGROUPS_COMMAND());
     for(StringTokenizer t = new StringTokenizer(s); t.hasMoreTokens(); ) {
       a.add(t.nextToken());
     }



Mime
View raw message