You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by ak...@apache.org on 2017/03/11 02:11:00 UTC
sentry git commit: SENTRY-1405: Add test for "show grant role on all
" command in V2 (Ke, Jia via Dapeng Sun)
Repository: sentry
Updated Branches:
refs/heads/sentry-ha-redesign c8de9a907 -> c34ce7298
SENTRY-1405: Add test for "show grant role on all " command in V2 (Ke, Jia via Dapeng Sun)
Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/c34ce729
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/c34ce729
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/c34ce729
Branch: refs/heads/sentry-ha-redesign
Commit: c34ce7298b8cba046c82c8be3561f9d60f2bc468
Parents: c8de9a9
Author: Alexander Kolbasov <ak...@cloudera.com>
Authored: Fri Mar 10 18:10:54 2017 -0800
Committer: Alexander Kolbasov <ak...@cloudera.com>
Committed: Fri Mar 10 18:10:54 2017 -0800
----------------------------------------------------------------------
.../e2e/dbprovider/TestDatabaseProvider.java | 24 ++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/sentry/blob/c34ce729/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
index 8cfd0d0..4a55b5d 100644
--- a/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
+++ b/sentry-tests/sentry-tests-hive-v2/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestDatabaseProvider.java
@@ -2188,4 +2188,28 @@ public class TestDatabaseProvider extends AbstractTestWithStaticConfiguration {
statement.close();
connection.close();
}
+
+ @Test
+ public void testShowGrantOnALL() throws Exception {
+
+ // setup db objects needed by the test
+ Connection connection = context.createConnection(ADMIN1);
+ Statement statement = context.createStatement(connection);
+ statement.execute("DROP DATABASE IF EXISTS db_1 CASCADE");
+ statement.execute("DROP DATABASE IF EXISTS db_2 CASCADE");
+ statement.execute("CREATE DATABASE db_1");
+ statement.execute("CREATE ROLE group1_role");
+ statement.execute("GRANT ALL ON DATABASE db_1 TO ROLE group1_role");
+ statement.execute("grant select on database db_1 to role group1_role");
+ ResultSet res = statement.executeQuery("show grant role group1_role on all");
+ List<String> returnedResult = new ArrayList<String>();
+ List<String> expectedResult = new ArrayList<String>();
+ expectedResult.add("db_1");
+ while (res.next()) {
+ returnedResult.add(res.getString(1).trim());
+ }
+ validateReturnedResult(expectedResult, returnedResult);
+ connection.close();
+ }
}
+