Class TestCoprocessorWhitelistMasterObserver
java.lang.Object
org.apache.hadoop.hbase.security.access.SecureTestUtil
org.apache.hadoop.hbase.security.access.TestCoprocessorWhitelistMasterObserver
Performs coprocessor loads for various paths and malformed strings
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.security.access.SecureTestUtil
SecureTestUtil.AccessTestAction, SecureTestUtil.MasterSyncObserver
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final org.slf4j.Logger
private static final byte[]
private static final org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
negativeTestCase
(String[] whitelistedPaths, String coprocessorPath) Test a table modification adding a coprocessor path which is whitelisted.private static void
positiveTestCase
(String[] whitelistedPaths, String coprocessorPath) Test a table modification adding a coprocessor path which is not whitelisted.void
void
Test a table modification adding a coprocessor path which is whitelisted.void
Test a table creation including a coprocessor path which is on the classpath.void
Test a table creation including a coprocessor path which is not whitelisted.void
Test a table modification adding a coprocessor path which is whitelisted.void
Test a table modification adding a coprocessor path which is whitelisted.void
Test a table creation including a coprocessor path which is not whitelisted.void
Test a table modification adding a coprocessor path which is whitelisted.void
Test a table modification adding a coprocessor path which is whitelisted.void
Test a table modification adding a coprocessor path which is not whitelisted.Methods inherited from class org.apache.hadoop.hbase.security.access.SecureTestUtil
checkGlobalPerms, checkTablePerms, checkTablePerms, configureSuperuser, convertToNamespace, createNamespace, createTable, createTable, createTable, createTable, createTable, createTable, createTable, deleteNamespace, deleteTable, deleteTable, enableSecurity, grantGlobal, grantGlobal, grantGlobalUsingAccessControlClient, grantOnNamespace, grantOnNamespace, grantOnNamespaceUsingAccessControlClient, grantOnTable, grantOnTable, grantOnTableUsingAccessControlClient, revokeFromNamespace, revokeFromNamespace, revokeFromNamespaceUsingAccessControlClient, revokeFromTable, revokeFromTable, revokeFromTableUsingAccessControlClient, revokeGlobal, revokeGlobal, revokeGlobalUsingAccessControlClient, verifyAllowed, verifyAllowed, verifyAllowed, verifyConfiguration, verifyDenied, verifyDenied, verifyIfEmptyList, verifyIfNull
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
TEST_TABLE
-
TEST_FAMILY
-
-
Constructor Details
-
TestCoprocessorWhitelistMasterObserver
-
-
Method Details
-
tearDownTestCoprocessorWhitelistMasterObserver
- Throws:
Exception
-
positiveTestCase
private static void positiveTestCase(String[] whitelistedPaths, String coprocessorPath) throws Exception Test a table modification adding a coprocessor path which is not whitelisted.- Parameters:
whitelistedPaths
- A String array of paths to add in for the whitelisting configurationcoprocessorPath
- A String to use as the path for a mock coprocessor- Throws:
Exception
- should be thrown and caught to show coprocessor is working as desired
-
negativeTestCase
private static void negativeTestCase(String[] whitelistedPaths, String coprocessorPath) throws Exception Test a table modification adding a coprocessor path which is whitelisted. The coprocessor should be added to the table descriptor successfully.- Parameters:
whitelistedPaths
- A String array of paths to add in for the whitelisting configurationcoprocessorPath
- A String to use as the path for a mock coprocessor- Throws:
Exception
-
testSubstringNonWhitelisted
Test a table modification adding a coprocessor path which is not whitelisted.- Throws:
Exception
- should be thrown and caught to show coprocessor is working as desired
-
testDifferentFileSystemNonWhitelisted
Test a table creation including a coprocessor path which is not whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testSchemeAndDirectorywhitelisted
Test a table modification adding a coprocessor path which is whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testSchemeWhitelisted
Test a table modification adding a coprocessor path which is whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testDFSNameWhitelistedWorks
Test a table modification adding a coprocessor path which is whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testDFSNameNotWhitelistedFails
Test a table modification adding a coprocessor path which is whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testBlanketWhitelist
Test a table modification adding a coprocessor path which is whitelisted. Coprocessor should be added to table descriptor. Table is disabled to avoid an IOException due to the added coprocessor not actually existing on disk.- Throws:
Exception
-
testCreationNonWhitelistedCoprocessorPath
Test a table creation including a coprocessor path which is not whitelisted. Table will not be created due to the offending coprocessor.- Throws:
Exception
-
testCreationClasspathCoprocessor
Test a table creation including a coprocessor path which is on the classpath. Table will be created with the coprocessor.- Throws:
Exception
-