HBase
  1. HBase
  2. HBASE-11057

Improve TestShell coverage of grant and revoke comamnds

    Details

    • Type: Test Test
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.99.0, 0.98.4, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      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.

      1. HBASE-11057.patch
        3 kB
        Srikanth Srungarapu
      2. HBASE-11057_v2.patch
        5 kB
        Srikanth Srungarapu

        Activity

        Hide
        Enis Soztutar added a comment -

        Closing this issue after 0.99.0 release.

        Show
        Enis Soztutar added a comment - Closing this issue after 0.99.0 release.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in HBase-0.98-on-Hadoop-1.1 #369 (See https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/369/)
        HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev d1b5ccef5bf066e77c14d41d3971734afc8340cb)

        • hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java
        • hbase-shell/src/test/ruby/hbase/security_admin_test.rb
        • hbase-shell/src/test/ruby/test_helper.rb
        Show
        Hudson added a comment - SUCCESS: Integrated in HBase-0.98-on-Hadoop-1.1 #369 (See https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/369/ ) HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev d1b5ccef5bf066e77c14d41d3971734afc8340cb) hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java hbase-shell/src/test/ruby/hbase/security_admin_test.rb hbase-shell/src/test/ruby/test_helper.rb
        Hide
        Hudson added a comment -

        FAILURE: Integrated in HBase-1.0 #31 (See https://builds.apache.org/job/HBase-1.0/31/)
        HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev 6f2a969649baaf28d155879b2285706c2013366a)

        • hbase-shell/src/test/ruby/hbase/security_admin_test.rb
        • hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java
        • hbase-shell/src/test/ruby/test_helper.rb
        Show
        Hudson added a comment - FAILURE: Integrated in HBase-1.0 #31 (See https://builds.apache.org/job/HBase-1.0/31/ ) HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev 6f2a969649baaf28d155879b2285706c2013366a) hbase-shell/src/test/ruby/hbase/security_admin_test.rb hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java hbase-shell/src/test/ruby/test_helper.rb
        Hide
        Hudson added a comment -

        FAILURE: Integrated in HBase-TRUNK #5290 (See https://builds.apache.org/job/HBase-TRUNK/5290/)
        HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev dba294576e996002faf66be7d3f983a2067763fb)

        • hbase-shell/src/test/ruby/hbase/security_admin_test.rb
        • hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java
        • hbase-shell/src/test/ruby/test_helper.rb
        Show
        Hudson added a comment - FAILURE: Integrated in HBase-TRUNK #5290 (See https://builds.apache.org/job/HBase-TRUNK/5290/ ) HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev dba294576e996002faf66be7d3f983a2067763fb) hbase-shell/src/test/ruby/hbase/security_admin_test.rb hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java hbase-shell/src/test/ruby/test_helper.rb
        Hide
        Hudson added a comment -

        FAILURE: Integrated in HBase-0.98 #389 (See https://builds.apache.org/job/HBase-0.98/389/)
        HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev d1b5ccef5bf066e77c14d41d3971734afc8340cb)

        • hbase-shell/src/test/ruby/hbase/security_admin_test.rb
        • hbase-shell/src/test/ruby/test_helper.rb
        • hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java
        Show
        Hudson added a comment - FAILURE: Integrated in HBase-0.98 #389 (See https://builds.apache.org/job/HBase-0.98/389/ ) HBASE-11057 Improve TestShell coverage of grant and revoke comamnds (Srikanth Srungarapu) (apurtell: rev d1b5ccef5bf066e77c14d41d3971734afc8340cb) hbase-shell/src/test/ruby/hbase/security_admin_test.rb hbase-shell/src/test/ruby/test_helper.rb hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShell.java
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12655303/HBASE-11057_v2.patch
        against trunk revision .
        ATTACHMENT ID: 12655303

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 12 new or modified tests.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        -1 findbugs. The patch appears to introduce 4 new Findbugs (version 2.0.3) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 lineLengths. The patch does not introduce lines longer than 100

        +1 site. The mvn site goal succeeds with this patch.

        +1 core tests. The patch passed unit tests in .

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-thrift.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-examples.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-client.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-server.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-protocol.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12655303/HBASE-11057_v2.patch against trunk revision . ATTACHMENT ID: 12655303 +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 12 new or modified tests. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. -1 findbugs . The patch appears to introduce 4 new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 lineLengths . The patch does not introduce lines longer than 100 +1 site . The mvn site goal succeeds with this patch. +1 core tests . The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-thrift.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-examples.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-client.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-server.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//artifact/patchprocess/newPatchFindbugsWarningshbase-protocol.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/10041//console This message is automatically generated.
        Hide
        Andrew Purtell added a comment -

        Committed to 0.98+. Thanks for the patch Srikanth Srungarapu

        Show
        Andrew Purtell added a comment - Committed to 0.98+. Thanks for the patch Srikanth Srungarapu
        Hide
        Enis Soztutar added a comment -

        +1.

        Show
        Enis Soztutar added a comment - +1.
        Hide
        Andrew Purtell added a comment -

        Looks good.

        Submitting patch for HadoopQA. Will try the test locally. If it's stable over multiple runs will commit to 0.98+. Ping Enis Soztutar

        Show
        Andrew Purtell added a comment - Looks good. Submitting patch for HadoopQA. Will try the test locally. If it's stable over multiple runs will commit to 0.98+. Ping Enis Soztutar
        Hide
        Srikanth Srungarapu added a comment -

        Made amends as per provided feedback.

        Show
        Srikanth Srungarapu added a comment - Made amends as per provided feedback.
        Hide
        Andrew Purtell added a comment -

        Instead of copy-paste, use SecureTestUtil#enableSecurity

        @@ -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();
        
        Show
        Andrew Purtell added a comment - Instead of copy-paste, use SecureTestUtil#enableSecurity @@ -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();
        Hide
        Srikanth Srungarapu added a comment -

        Attaching a patch, which checks the validity of grant and revoke by probing user_permissions method. I couldn't extend the same logic to alternate grant syntax, as the permissions are being stored as tags in cells instead of acl table itself. Any suggestions for extending/altering this logic to verifying alternate grant syntax would be highly appreciated.

        Show
        Srikanth Srungarapu added a comment - Attaching a patch, which checks the validity of grant and revoke by probing user_permissions method. I couldn't extend the same logic to alternate grant syntax, as the permissions are being stored as tags in cells instead of acl table itself. Any suggestions for extending/altering this logic to verifying alternate grant syntax would be highly appreciated.
        Hide
        Srikanth Srungarapu added a comment -

        Andrew Purtell Can you please let me know if it is okay for me to pick this up?

        Show
        Srikanth Srungarapu added a comment - Andrew Purtell Can you please let me know if it is okay for me to pick this up?

          People

          • Assignee:
            Srikanth Srungarapu
            Reporter:
            Andrew Purtell
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development