hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r938805 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobACLsManager.java src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java
Date Wed, 28 Apr 2010 07:21:08 GMT
Author: vinodkv
Date: Wed Apr 28 07:21:07 2010
New Revision: 938805

URL: http://svn.apache.org/viewvc?rev=938805&view=rev
Log:
MAPREDUCE-1727. TestJobACLs fails after HADOOP-6686. Contributed by Ravi Gummadi.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobACLsManager.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=938805&r1=938804&r2=938805&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Apr 28 07:21:07 2010
@@ -608,6 +608,8 @@ Trunk (unreleased changes)
     MAPREDUCE-1657. After task logs directory is deleted, tasklog servlet 
     displays wrong error message about job ACLs. (Ravi Gummadi via vinodkv)
 
+    MAPREDUCE-1727. TestJobACLs fails after HADOOP-6686. (Ravi Gummadi via vinodkv)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobACLsManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobACLsManager.java?rev=938805&r1=938804&r2=938805&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobACLsManager.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobACLsManager.java Wed Apr 28
07:21:07 2010
@@ -33,6 +33,8 @@ public abstract class JobACLsManager {
 
   static final Log LOG = LogFactory.getLog(JobACLsManager.class);
 
+  public static final String UNAUTHORIZED_JOB_ACCESS_ERROR =
+      " is not authorized for performing the operation ";
   protected abstract boolean isJobLevelAuthorizationEnabled();
 
   protected abstract boolean isSuperUserOrSuperGroup(
@@ -140,7 +142,7 @@ public abstract class JobACLsManager {
     }
 
     throw new AccessControlException(callerUGI
-        + " is not authorized for performing the operation "
+        + UNAUTHORIZED_JOB_ACCESS_ERROR
         + jobOperation.toString() + " on " + jobId + ". "
         + jobOperation.toString()
         + " Access control list configured for this job : "

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java?rev=938805&r1=938804&r2=938805&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/TestJobACLs.java Wed
Apr 28 07:21:07 2010
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.JobACLsManager;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.MiniMRCluster;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
@@ -221,7 +222,8 @@ public class TestJobACLs {
           myJob.getCounters();
           fail("AccessControlException expected..");
         } catch (IOException ioe) {
-          assertTrue(ioe.getMessage().contains("AccessControlException"));
+          assertTrue(ioe.getMessage().contains(
+              JobACLsManager.UNAUTHORIZED_JOB_ACCESS_ERROR + JobACL.VIEW_JOB));
         } catch (InterruptedException e) {
           fail("Exception .. interrupted.." + e);
         }
@@ -231,7 +233,8 @@ public class TestJobACLs {
           myJob.getTaskReports(TaskType.JOB_SETUP);
           fail("AccessControlException expected..");
         } catch (IOException ioe) {
-          assertTrue(ioe.getMessage().contains("AccessControlException"));
+          assertTrue(ioe.getMessage().contains(
+              JobACLsManager.UNAUTHORIZED_JOB_ACCESS_ERROR + JobACL.VIEW_JOB));
         } catch (InterruptedException e) {
           fail("Exception .. interrupted.." + e);
         }
@@ -334,7 +337,8 @@ public class TestJobACLs {
           myJob.killJob();
           fail("AccessControlException expected..");
         } catch (IOException ioe) {
-          assertTrue(ioe.getMessage().contains("AccessControlException"));
+          assertTrue(ioe.getMessage().contains(
+            JobACLsManager.UNAUTHORIZED_JOB_ACCESS_ERROR + JobACL.MODIFY_JOB));
         } catch (InterruptedException e) {
           fail("Exception .. interrupted.." + e);
         }
@@ -344,7 +348,8 @@ public class TestJobACLs {
           myJob.setPriority(JobPriority.HIGH);
           fail("AccessControlException expected..");
         } catch (IOException ioe) {
-          assertTrue(ioe.getMessage().contains("AccessControlException"));
+          assertTrue(ioe.getMessage().contains(
+            JobACLsManager.UNAUTHORIZED_JOB_ACCESS_ERROR + JobACL.MODIFY_JOB));
         } catch (InterruptedException e) {
           fail("Exception .. interrupted.." + e);
         }
@@ -407,7 +412,8 @@ public class TestJobACLs {
           myJob.getCounters();
           fail("AccessControlException expected..");
         } catch (IOException ioe) {
-          assertTrue(ioe.getMessage().contains("AccessControlException"));
+          assertTrue(ioe.getMessage().contains(
+              JobACLsManager.UNAUTHORIZED_JOB_ACCESS_ERROR + JobACL.VIEW_JOB));
         } catch (InterruptedException e) {
           fail("Exception .. interrupted.." + e);
         }



Mime
View raw message