hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [42/50] [abbrv] hadoop git commit: HADOOP-15793. ABFS: Skip unsupported test cases when non namespace enabled in ITestAzureBlobFileSystemAuthorization Contributed by Yuan Gao.
Date Tue, 02 Oct 2018 21:40:42 GMT
HADOOP-15793. ABFS: Skip unsupported test cases when non namespace enabled in ITestAzureBlobFileSystemAuthorization
Contributed by Yuan Gao.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/43bc9848
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/43bc9848
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/43bc9848

Branch: refs/heads/HDFS-13532
Commit: 43bc9848914cee5e03a9965eb2165f42efb2c35d
Parents: 5689355
Author: Steve Loughran <stevel@apache.org>
Authored: Tue Oct 2 11:37:28 2018 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Tue Oct 2 11:37:28 2018 +0100

----------------------------------------------------------------------
 .../ITestAzureBlobFileSystemAuthorization.java    | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/43bc9848/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java
b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java
index 37ab825..1705516 100644
--- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java
+++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java
@@ -35,6 +35,7 @@ import static org.apache.hadoop.fs.azurebfs.utils.AclTestHelpers.aclEntry;
 import static org.apache.hadoop.fs.permission.AclEntryScope.ACCESS;
 import static org.apache.hadoop.fs.permission.AclEntryType.GROUP;
 import static org.apache.hadoop.test.LambdaTestUtils.intercept;
+import static org.junit.Assume.assumeTrue;
 
 /**
  * Test Perform Authorization Check operation
@@ -202,6 +203,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetOwnerAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     fs.setOwner(TEST_WRITE_ONLY_FILE_PATH_0, "testUser", "testGroup");
   }
@@ -209,6 +211,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetOwnerUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     intercept(AbfsAuthorizationException.class,
         ()-> {
@@ -219,6 +222,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetPermissionAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     fs.setPermission(TEST_WRITE_ONLY_FILE_PATH_0, new FsPermission(FsAction.ALL, FsAction.NONE,
FsAction.NONE));
   }
@@ -226,6 +230,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetPermissionUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     intercept(AbfsAuthorizationException.class,
         ()-> {
@@ -236,6 +241,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testModifyAclEntriesAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     fs.modifyAclEntries(TEST_WRITE_ONLY_FILE_PATH_0, aclSpec);
@@ -244,6 +250,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testModifyAclEntriesUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     intercept(AbfsAuthorizationException.class,
@@ -255,15 +262,16 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testRemoveAclEntriesAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
-    //fs.modifyAclEntries(TEST_WRITE_ONLY_FILE_PATH_0, aclSpec);
     fs.removeAclEntries(TEST_WRITE_ONLY_FILE_PATH_0, aclSpec);
   }
 
   @Test
   public void testRemoveAclEntriesUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     intercept(AbfsAuthorizationException.class,
@@ -275,6 +283,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testRemoveDefaultAclAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     fs.removeDefaultAcl(TEST_WRITE_ONLY_FILE_PATH_0);
   }
@@ -282,6 +291,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testRemoveDefaultAclUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     intercept(AbfsAuthorizationException.class,
         ()-> {
@@ -292,6 +302,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testRemoveAclAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     fs.removeAcl(TEST_WRITE_ONLY_FILE_PATH_0);
   }
@@ -299,6 +310,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testRemoveAclUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     intercept(AbfsAuthorizationException.class,
         ()-> {
@@ -309,6 +321,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetAclAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     fs.setAcl(TEST_WRITE_ONLY_FILE_PATH_0, aclSpec);
@@ -317,6 +330,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testSetAclUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     intercept(AbfsAuthorizationException.class,
@@ -328,6 +342,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testGetAclStatusAuthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_THEN_READ_ONLY_PATH).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     fs.getAclStatus(TEST_WRITE_THEN_READ_ONLY_PATH);
@@ -336,6 +351,7 @@ public class ITestAzureBlobFileSystemAuthorization extends AbstractAbfsIntegrati
   @Test
   public void testGetAclStatusUnauthorized() throws Exception {
     final AzureBlobFileSystem fs = getFileSystem();
+    assumeTrue("This test case only runs when namespace is enabled", fs.getIsNamespaceEnabeld());
     fs.create(TEST_WRITE_ONLY_FILE_PATH_0).close();
     List<AclEntry> aclSpec = Arrays.asList(aclEntry(ACCESS, GROUP, "bar", FsAction.ALL));
     intercept(AbfsAuthorizationException.class,


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message