Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED57AEBCD for ; Wed, 9 Jan 2013 07:46:15 +0000 (UTC) Received: (qmail 2771 invoked by uid 500); 9 Jan 2013 07:46:15 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 2638 invoked by uid 500); 9 Jan 2013 07:46:15 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 2618 invoked by uid 99); 9 Jan 2013 07:46:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 07:46:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jan 2013 07:46:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D4E2823888E7 for ; Wed, 9 Jan 2013 07:45:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1430720 - in /hadoop/common/branches/branch-1-win: CHANGES.branch-1-win.txt src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java Date: Wed, 09 Jan 2013 07:45:53 -0000 To: common-commits@hadoop.apache.org From: suresh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130109074553.D4E2823888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: suresh Date: Wed Jan 9 07:45:53 2013 New Revision: 1430720 URL: http://svn.apache.org/viewvc?rev=1430720&view=rev Log: HADOOP-9191. Merge change 1430717 from branch-1 Modified: hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java Modified: hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt?rev=1430720&r1=1430719&r2=1430720&view=diff ============================================================================== --- hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt (original) +++ hadoop/common/branches/branch-1-win/CHANGES.branch-1-win.txt Wed Jan 9 07:45:53 2013 @@ -334,3 +334,6 @@ Branch-hadoop-1-win (branched from branc MAPREDUCE-4915. TestShuffleExceptionCount fails with open JDK7. (Brandon Li via suresh) + + HADOOP-9191. TestAccessControlList and TestJobHistoryConfig fail with + JDK7. (Arpit Agarwal via suresh) Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java?rev=1430720&r1=1430719&r2=1430720&view=diff ============================================================================== --- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java (original) +++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobHistoryConfig.java Wed Jan 9 07:45:53 2013 @@ -74,6 +74,7 @@ public class TestJobHistoryConfig extend if (mdfs != null) { try { mdfs.shutdown(); + mdfs = null; } catch (Exception e) { } } @@ -93,35 +94,42 @@ public class TestJobHistoryConfig extend } public void testJobHistoryLogging() throws Exception { - JobConf conf = new JobConf(); - setUpCluster(conf); - conf.setMapperClass(MapperClass.class); - conf.setReducerClass(IdentityReducer.class); - conf.setNumReduceTasks(0); - JobClient jc = new JobClient(conf); - conf.set("hadoop.job.history.location", "/hadoop/history"); - conf = MiniMRCluster.configureJobConf(conf, namenode, 0, 0, null); - FileSystem inFs = inDir.getFileSystem(conf); - if (!inFs.mkdirs(inDir)) { - throw new IOException("Mkdirs failed to create " + inDir.toString()); - } - FileInputFormat.setInputPaths(conf, inDir); - FileOutputFormat.setOutputPath(conf, outDir); - conf.setSpeculativeExecution(false); - conf.setJobName("test"); - conf.setUser("testuser"); - conf.setQueueName("default"); - String TEST_ROOT_DIR = new Path(System.getProperty("test.build.data", - "/tmp")).toString().replace(' ', '+'); - JobTracker jt = JobTracker.startTracker(conf); - assertTrue(jt != null); - JobInProgress jip = new JobInProgress(new JobID("jt", 1), - new JobConf(conf), jt); - assertTrue(jip != null); - jip.jobFile = "testfile"; - String historyFile = JobHistory.getHistoryFilePath(jip.getJobID()); - JobHistory.JobInfo.logSubmitted(jip.getJobID(), jip.getJobConf(), - jip.jobFile, jip.startTime); + try { + JobConf conf = new JobConf(); + setUpCluster(conf); + conf.setMapperClass(MapperClass.class); + conf.setReducerClass(IdentityReducer.class); + conf.setNumReduceTasks(0); + JobClient jc = new JobClient(conf); + conf.set("hadoop.job.history.location", "/hadoop/history"); + conf = MiniMRCluster.configureJobConf(conf, namenode, 0, 0, null); + FileSystem inFs = inDir.getFileSystem(conf); + if (!inFs.mkdirs(inDir)) { + throw new IOException("Mkdirs failed to create " + inDir.toString()); + } + FileInputFormat.setInputPaths(conf, inDir); + FileOutputFormat.setOutputPath(conf, outDir); + conf.setSpeculativeExecution(false); + conf.setJobName("test"); + conf.setUser("testuser"); + conf.setQueueName("default"); + String TEST_ROOT_DIR = new Path(System.getProperty("test.build.data", + "/tmp")).toString().replace(' ', '+'); + JobTracker jt = JobTracker.startTracker(conf); + assertTrue(jt != null); + JobInProgress jip = new JobInProgress(new JobID("jt", 1), + new JobConf(conf), jt); + assertTrue(jip != null); + jip.jobFile = "testfile"; + String historyFile = JobHistory.getHistoryFilePath(jip.getJobID()); + JobHistory.JobInfo.logSubmitted(jip.getJobID(), jip.getJobConf(), + jip.jobFile, jip.startTime); + } finally { + if (mdfs != null) { + mdfs.shutdown(); + mdfs = null; + } + } } /** Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java?rev=1430720&r1=1430719&r2=1430720&view=diff ============================================================================== --- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java (original) +++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/security/authorize/TestAccessControlList.java Wed Jan 9 07:45:53 2013 @@ -32,10 +32,9 @@ import junit.framework.TestCase; public class TestAccessControlList extends TestCase { - /** - * test the netgroups (groups in ACL rules that start with @), - */ - public void testNetgroups() throws Exception { + private static Groups testGroups = null; + + public void setUp() { // set the config for Groups (test mapping class) // we rely on hardcoded groups and netgroups in // ShellBasedUnixGroupsMappingTestWrapper @@ -43,8 +42,18 @@ public class TestAccessControlList exten conf.set("hadoop.security.group.mapping", "org.apache.hadoop.security.ShellBasedUnixGroupsNetgroupMappingTestWrapper"); - Groups groups = Groups.getUserToGroupsMappingService(conf); + // Ensure that Groups.GROUPS is initialized first. + testGroups = Groups.getUserToGroupsMappingService(conf); + } + + public void tearDown() { + testGroups = null; + } + /** + * test the netgroups (groups in ACL rules that start with @), + */ + public void testNetgroups() throws Exception { AccessControlList acl; // create these ACLs to populate groups cache @@ -53,12 +62,12 @@ public class TestAccessControlList exten acl = new AccessControlList(" somegroups,@somenetgroup"); // no user // check that the netgroups are working - List elvisGroups = groups.getGroups("elvis"); + List elvisGroups = testGroups.getGroups("elvis"); assertTrue(elvisGroups.contains("@lasVegas")); // refresh cache - not testing this directly but if the results are ok // after the refresh that means it worked fine (very likely) - groups.refresh(); + testGroups.refresh(); // create an ACL with netgroups (@xxx) acl = new AccessControlList("ja ratpack,@lasVegas");