Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8B15F200BF4 for ; Fri, 2 Dec 2016 04:18:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 89EAD160B29; Fri, 2 Dec 2016 03:18:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DA474160B2A for ; Fri, 2 Dec 2016 04:18:18 +0100 (CET) Received: (qmail 47329 invoked by uid 500); 2 Dec 2016 03:18:16 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 43738 invoked by uid 99); 2 Dec 2016 03:18:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2016 03:18:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7524AF2132; Fri, 2 Dec 2016 03:18:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: asuresh@apache.org To: common-commits@hadoop.apache.org Date: Fri, 02 Dec 2016 03:18:34 -0000 Message-Id: <368a58396e86405496fb28c6758611fc@git.apache.org> In-Reply-To: <877728ae9fcb42ea87243bd921e446d3@git.apache.org> References: <877728ae9fcb42ea87243bd921e446d3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/24] hadoop git commit: HDFS-11132. Allow AccessControlException in contract tests when getFileStatus on subdirectory of existing files. Contributed by Vishwajeet Dusane archived-at: Fri, 02 Dec 2016 03:18:19 -0000 HDFS-11132. Allow AccessControlException in contract tests when getFileStatus on subdirectory of existing files. Contributed by Vishwajeet Dusane Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/19f373a4 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/19f373a4 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/19f373a4 Branch: refs/heads/YARN-5085 Commit: 19f373a46b2abb7a575f7884a9c7443b8ed67cd3 Parents: 96c5749 Author: Mingliang Liu Authored: Thu Dec 1 12:54:03 2016 -0800 Committer: Mingliang Liu Committed: Thu Dec 1 12:54:28 2016 -0800 ---------------------------------------------------------------------- .../fs/FileContextMainOperationsBaseTest.java | 21 ++++++++++++++++---- .../hadoop/fs/FileSystemContractBaseTest.java | 17 ++++++++++++++-- 2 files changed, 32 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/19f373a4/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java index 5f9151a..2b3ab2a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileContextMainOperationsBaseTest.java @@ -29,6 +29,7 @@ import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.fs.Options.CreateOpts; import org.apache.hadoop.fs.Options.Rename; import org.apache.hadoop.fs.permission.FsPermission; +import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.test.GenericTestUtils; import org.junit.After; import org.junit.Assert; @@ -251,8 +252,14 @@ public abstract class FileContextMainOperationsBaseTest { } catch (IOException e) { // expected } - Assert.assertFalse(exists(fc, testSubDir)); - + + try { + Assert.assertFalse(exists(fc, testSubDir)); + } catch (AccessControlException e) { + // Expected : HDFS-11132 Checks on paths under file may be rejected by + // file missing execute permission. + } + Path testDeepSubDir = getTestRootPath(fc, "test/hadoop/file/deep/sub/dir"); try { fc.mkdir(testDeepSubDir, FsPermission.getDefault(), true); @@ -260,8 +267,14 @@ public abstract class FileContextMainOperationsBaseTest { } catch (IOException e) { // expected } - Assert.assertFalse(exists(fc, testDeepSubDir)); - + + try { + Assert.assertFalse(exists(fc, testDeepSubDir)); + } catch (AccessControlException e) { + // Expected : HDFS-11132 Checks on paths under file may be rejected by + // file missing execute permission. + } + } @Test http://git-wip-us.apache.org/repos/asf/hadoop/blob/19f373a4/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java index bbd7336..6247959 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/FileSystemContractBaseTest.java @@ -28,6 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.permission.FsPermission; +import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.util.StringUtils; /** @@ -158,7 +159,13 @@ public abstract class FileSystemContractBaseTest extends TestCase { } catch (IOException e) { // expected } - assertFalse(fs.exists(testSubDir)); + + try { + assertFalse(fs.exists(testSubDir)); + } catch (AccessControlException e) { + // Expected : HDFS-11132 Checks on paths under file may be rejected by + // file missing execute permission. + } Path testDeepSubDir = path("/test/hadoop/file/deep/sub/dir"); try { @@ -167,7 +174,13 @@ public abstract class FileSystemContractBaseTest extends TestCase { } catch (IOException e) { // expected } - assertFalse(fs.exists(testDeepSubDir)); + + try { + assertFalse(fs.exists(testDeepSubDir)); + } catch (AccessControlException e) { + // Expected : HDFS-11132 Checks on paths under file may be rejected by + // file missing execute permission. + } } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org