hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r893415 - in /hadoop/mapreduce/branches/branch-0.21: CHANGES.txt src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
Date Wed, 23 Dec 2009 07:23:53 GMT
Author: yhemanth
Date: Wed Dec 23 07:23:52 2009
New Revision: 893415

URL: http://svn.apache.org/viewvc?rev=893415&view=rev
Log:
Merge -c 893414 from trunk to branch 0.21 to fix MAPREDUCE-1301.

Modified:
    hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
    hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java

Modified: hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/CHANGES.txt?rev=893415&r1=893414&r2=893415&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.21/CHANGES.txt Wed Dec 23 07:23:52 2009
@@ -896,3 +896,7 @@
 
     MAPREDUCE-1241. Use a default queue configuration in JobTracker when
     mapred-queues.xml is unavailable. (Todd Lipcon via cdouglas)
+
+    MAPREDUCE-1301. Fix set up of permission checking script used in 
+    localization tests. (Amareshwari Sriramadasu via yhemanth)
+    

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java?rev=893415&r1=893414&r2=893415&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
Wed Dec 23 07:23:52 2009
@@ -55,7 +55,8 @@
  */
 public class TestTaskTrackerLocalization extends TestCase {
 
-  private File TEST_ROOT_DIR;
+  private static File TEST_ROOT_DIR = 
+    new File(System.getProperty("test.build.data", "/tmp"));
   private File ROOT_MAPRED_LOCAL_DIR;
   private File HADOOP_LOG_DIR;
   private static File PERMISSION_SCRIPT_DIR;
@@ -170,18 +171,14 @@
 
     tracker.setLocalizer(new Localizer(tracker.localFs, localDirs,
         taskController));
-    setupPermissionScriptDir(TEST_ROOT_DIR);
   }
 
   /**
-   * Method to setup the permission script which would be used by the 
+   * static block setting up the permission script which would be used by the 
    * checkFilePermissions
-   * 
-   * @param rootDir
-   * @throws FileNotFoundException
    */
-  static void setupPermissionScriptDir(File rootDir) throws FileNotFoundException {
-    PERMISSION_SCRIPT_DIR = new File(rootDir, "permission_script_dir");
+  static {
+    PERMISSION_SCRIPT_DIR = new File(TEST_ROOT_DIR, "permission_script_dir");
     PERMISSION_SCRIPT_FILE = new File(PERMISSION_SCRIPT_DIR, "getperms.sh");
     
     if(PERMISSION_SCRIPT_FILE.exists()) {
@@ -194,9 +191,13 @@
     
     PERMISSION_SCRIPT_DIR.mkdir();
     
-    PrintWriter writer = new PrintWriter(PERMISSION_SCRIPT_FILE);
-    writer.write(PERMISSION_SCRIPT_CONTENT);
-    writer.close();
+    try {
+      PrintWriter writer = new PrintWriter(PERMISSION_SCRIPT_FILE);
+      writer.write(PERMISSION_SCRIPT_CONTENT);
+      writer.close();
+    } catch (FileNotFoundException fe) {
+      fail();
+    }
     PERMISSION_SCRIPT_FILE.setExecutable(true, true);
   }
 

Modified: hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java?rev=893415&r1=893414&r2=893415&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
(original)
+++ hadoop/mapreduce/branches/branch-0.21/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
Wed Dec 23 07:23:52 2009
@@ -59,9 +59,6 @@
                 .getSimpleName()).getAbsolutePath();
 
     super.setUp();
-    //set up for the permission checker script
-    TestTaskTrackerLocalization.setupPermissionScriptDir(new File(
-        TEST_ROOT_DIR));
     
     taskController = new MyLinuxTaskController();
     String path =



Mime
View raw message