[
https://issues.apache.org/jira/browse/HBASE-11057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14059072#comment-14059072
]
Andrew Purtell commented on HBASE-11057:
----------------------------------------
Instead of copy-paste, use SecureTestUtil#enableSecurity
{code}
@@ -51,6 +52,28 @@ public class TestShell {
TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250);
TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6);
TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY,
false);
+ TEST_UTIL.getConfiguration().set("hadoop.security.authorization", "false");
+ TEST_UTIL.getConfiguration().set("hadoop.security.authentication",
"simple");
+ TEST_UTIL.getConfiguration().set("hbase.coprocessor.master.classes",
+ "org.apache.hadoop.hbase.security.access.AccessController");
+ TEST_UTIL.getConfiguration().set("hbase.coprocessor.region.classes",
+
"org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.AccessController");
+ TEST_UTIL.getConfiguration().set("hbase.rpc.engine",
+ "org.apache.hadoop.hbase.ipc.SecureRpcEngine");
+ String currentUser = User.getCurrent().getName();
+ StringBuffer sb = new StringBuffer();
+ sb.append("admin,");
+ sb.append(currentUser);
+ // Assumes we won't ever have a minicluster with more than 5 slaves
+ for (int i = 0; i < 5; i++) {
+ sb.append(',');
+ sb.append(currentUser);
+ sb.append(".hfs.");
+ sb.append(i);
+ }
+ TEST_UTIL.getConfiguration().set("hbase.superuser", sb.toString());
+ // Need HFile V3 for tags for security features
+ TEST_UTIL.getConfiguration().setInt(HFile.FORMAT_VERSION_KEY, 3);
TEST_UTIL.startMiniCluster();
{code}
> Improve TestShell coverage of grant and revoke comamnds
> -------------------------------------------------------
>
> Key: HBASE-11057
> URL: https://issues.apache.org/jira/browse/HBASE-11057
> Project: HBase
> Issue Type: Test
> Reporter: Andrew Purtell
> Assignee: Srikanth Srungarapu
> Priority: Minor
> Fix For: 0.99.0, 0.98.5
>
> Attachments: HBASE-11057.patch
>
>
> The TestShell coverage of grant and revoke commands doesn't seem sufficient
> to catch a botch that prevented global grants. Also cover the alternative
> grant syntax introduced in HBASE-11001.
--
This message was sent by Atlassian JIRA
(v6.2#6252)