hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r893414 - in /hadoop/mapreduce/trunk: 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:21:49 GMT
Author: yhemanth
Date: Wed Dec 23 07:21:48 2009
New Revision: 893414

URL: http://svn.apache.org/viewvc?rev=893414&view=rev
Log:
MAPREDUCE-1301. Fix set up of permission checking script used in localization tests. Contributed
by Amareshwari Sriramadasu.

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

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=893414&r1=893413&r2=893414&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed Dec 23 07:21:48 2009
@@ -1064,3 +1064,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/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java?rev=893414&r1=893413&r2=893414&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java
Wed Dec 23 07:21:48 2009
@@ -58,7 +58,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;
@@ -178,18 +179,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()) {
@@ -202,9 +199,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/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java?rev=893414&r1=893413&r2=893414&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestTrackerDistributedCacheManagerWithLinuxTaskController.java
Wed Dec 23 07:21:48 2009
@@ -57,9 +57,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