hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077470 - /hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java
Date Fri, 04 Mar 2011 04:18:18 GMT
Author: omalley
Date: Fri Mar  4 04:18:18 2011
New Revision: 1077470

URL: http://svn.apache.org/viewvc?rev=1077470&view=rev
Log:
commit 619ed4b364fb4ede1fb2e3d4f8f74466f78ddf95
Author: Iyappan Srinivasan <iyappans@yahoo-inc.com>
Date:   Tue May 18 08:06:40 2010 +0000

    MAPREDUCE-1677 from https://issues.apache.org/jira/secure/attachment/12444390/TestDistributedCachePrivateFile.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java?rev=1077470&r1=1077469&r2=1077470&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/system/java/org/apache/hadoop/mapred/TestDistributedCachePrivateFile.java
Fri Mar  4 04:18:18 2011
@@ -123,6 +123,10 @@ public class TestDistributedCachePrivate
     Configuration conf = new Configuration(cluster.getConf());
     JTProtocol wovenClient = cluster.getJTClient().getProxy();
 
+    String jobTrackerUserName = wovenClient.getDaemonUser();
+
+    LOG.info("jobTrackerUserName is :" + jobTrackerUserName);
+
     //This counter will check for count of a loop,
     //which might become infinite.
     int count = 0;
@@ -224,8 +228,16 @@ public class TestDistributedCachePrivate
               fileStatusMapredLocalDirUserName.getPath();
           FsPermission fsPermMapredLocalDirUserName =
               fileStatusMapredLocalDirUserName.getPermission();
-          Assert.assertTrue("Directory Permission is not 700",
-            fsPermMapredLocalDirUserName.equals(new FsPermission("700")));
+          //If userName of Jobtracker is same as username
+          //of jobSubmission, then the permissions are 770.
+          //Otherwise 570
+          if ( userName.compareTo(jobTrackerUserName) == 0 ) {
+            Assert.assertTrue("Directory Permission is not 770",
+              fsPermMapredLocalDirUserName.equals(new FsPermission("770")));
+          } else {
+            Assert.assertTrue("Directory Permission is not 570",
+              fsPermMapredLocalDirUserName.equals(new FsPermission("570")));
+          }
 
           //Get file status of all the directories 
           //and files under that path.
@@ -245,8 +257,16 @@ public class TestDistributedCachePrivate
               distributedFileCount++;
               String filename = path.getName();
               FsPermission fsPerm = fileStatus.getPermission();
-              Assert.assertTrue("File Permission is not 777",
-                fsPerm.equals(new FsPermission("777")));
+              //If userName of Jobtracker is same as username
+              //of jobSubmission, then the permissions are 770.
+              //Otherwise 570
+              if ( userName.compareTo(jobTrackerUserName) == 0 ) {
+                Assert.assertTrue("File Permission is not 770",
+                  fsPerm.equals(new FsPermission("770")));
+              } else {
+                Assert.assertTrue("File Permission is not 570",
+                  fsPerm.equals(new FsPermission("570")));
+              }
             }
           }
         }



Mime
View raw message