accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject accumulo git commit: ACCUMULO-4651 Fix PermissionsIT
Date Wed, 14 Jun 2017 21:05:32 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 3efff9b96 -> 606cacee0


ACCUMULO-4651 Fix PermissionsIT

Add permission checks for new GET_SUMMARIES table permission.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/606cacee
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/606cacee
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/606cacee

Branch: refs/heads/master
Commit: 606cacee016af1927e299163ae508d3c4662efac
Parents: 3efff9b
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Jun 14 17:03:33 2017 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Jun 14 17:03:33 2017 -0400

----------------------------------------------------------------------
 .../accumulo/test/functional/PermissionsIT.java     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/606cacee/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
index 7bf52ee..4207665 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -44,6 +44,7 @@ import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.client.summary.Summary;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -55,6 +56,7 @@ import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.harness.AccumuloClusterHarness;
 import org.apache.accumulo.test.categories.MiniClusterOnlyTests;
 import org.apache.hadoop.io.Text;
+import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
@@ -640,6 +642,15 @@ public class PermissionsIT extends AccumuloClusterHarness {
             throw e;
         }
         break;
+      case GET_SUMMARIES:
+        try {
+          test_user_conn.tableOperations().summaries(tableName).retrieve();
+          throw new IllegalStateException("User should not be able to get table summaries");
+        } catch (AccumuloSecurityException e) {
+          if (e.getSecurityErrorCode() != SecurityErrorCode.PERMISSION_DENIED)
+            throw e;
+        }
+        break;
       default:
         throw new IllegalArgumentException("Unrecognized table Permission: " + perm);
     }
@@ -680,6 +691,11 @@ public class PermissionsIT extends AccumuloClusterHarness {
       case GRANT:
         test_user_conn.securityOperations().grantTablePermission(getAdminPrincipal(), tableName,
TablePermission.GRANT);
         break;
+      case GET_SUMMARIES:
+        List<Summary> summaries = test_user_conn.tableOperations().summaries(tableName).retrieve();
+        // just make sure it's not blocked by permissions, the actual summaries are tested
in SummaryIT
+        Assert.assertTrue(summaries.isEmpty());
+        break;
       default:
         throw new IllegalArgumentException("Unrecognized table Permission: " + perm);
     }


Mime
View raw message