hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1033668 - in /hadoop/mapreduce/trunk: CHANGES.txt src/test/mapred/org/apache/hadoop/mapred/TestSubmitJob.java
Date Wed, 10 Nov 2010 19:39:28 GMT
Author: tomwhite
Date: Wed Nov 10 19:39:28 2010
New Revision: 1033668

URL: http://svn.apache.org/viewvc?rev=1033668&view=rev
Log:
MAPREDUCE-2034. TestSubmitJob triggers NPE instead of permissions error. Contributed by Todd
Lipcon.

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

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1033668&r1=1033667&r2=1033668&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Nov 10 19:39:28 2010
@@ -383,6 +383,9 @@ Trunk (unreleased changes)
     MAPREDUCE-2179. Fix RaidBlockSender compilation failure. (Ramkumar Vadali
     via schen)
 
+    MAPREDUCE-2034. TestSubmitJob triggers NPE instead of permissions error.
+    (Todd Lipcon via tomwhite)
+
 Release 0.21.1 - Unreleased
 
   NEW FEATURES

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestSubmitJob.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestSubmitJob.java?rev=1033668&r1=1033667&r2=1033668&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestSubmitJob.java (original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestSubmitJob.java Wed
Nov 10 19:39:28 2010
@@ -259,31 +259,30 @@ public class TestSubmitJob extends TestC
         getDFSClient(conf_other, user2);
 
       // try accessing mapred.system.dir/jobid/*
-      boolean failed = false;
       try {
-        Path path = new Path(new URI(jt.getSystemDir()).getPath());
+        String path = new URI(jt.getSystemDir()).getPath();
         LOG.info("Try listing the mapred-system-dir as the user (" 
                  + user2.getUserName() + ")");
-        client.getListing(
-            path.toString(), HdfsFileStatus.EMPTY_NAME, false);
+        client.getListing(path, HdfsFileStatus.EMPTY_NAME, false);
+        fail("JobTracker system dir is accessible to others");
       } catch (IOException ioe) {
-        failed = true;
+        assertTrue(ioe.toString(),
+          ioe.toString().contains("Permission denied"));
       }
-      assertTrue("JobTracker system dir is accessible to others", failed);
       // try accessing ~/.staging/jobid/*
-      failed = false;
       JobInProgress jip = jt.getJob(id);
       Path jobSubmitDirpath = 
         new Path(jip.getJobConf().get("mapreduce.job.dir"));
       try {
         LOG.info("Try accessing the job folder for job " + id + " as the user (" 
                  + user2.getUserName() + ")");
-        client.getListing(
-            jobSubmitDirpath.toString(), HdfsFileStatus.EMPTY_NAME, false);
+        client.getListing(jobSubmitDirpath.toUri().getPath(),
+          HdfsFileStatus.EMPTY_NAME, false);
+        fail("User's staging folder is accessible to others");
       } catch (IOException ioe) {
-        failed = true;
+        assertTrue(ioe.toString(),
+          ioe.toString().contains("Permission denied"));
       }
-      assertTrue("User's staging folder is accessible to others", failed);
       UtilsForTests.signalTasks(dfs, fs, true, mapSignalFile.toString(), 
       reduceSignalFile.toString());
       // wait for job to be done



Mime
View raw message