You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sh...@apache.org on 2013/09/05 00:18:11 UTC

git commit: SENTRY-5: Normalize the usernames used in the end to end tests (Sravya Tirukkovalur via Shreepadma Venugopalan)

Updated Branches:
  refs/heads/master 7539491cc -> 4bfd2dc89


SENTRY-5: Normalize the usernames used in the end to end tests (Sravya Tirukkovalur via Shreepadma Venugopalan)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/4bfd2dc8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/4bfd2dc8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/4bfd2dc8

Branch: refs/heads/master
Commit: 4bfd2dc89b7c7947a6456e4e01710681b21c1093
Parents: 7539491
Author: Shreepadma Venugopalan <sh...@cloudera.com>
Authored: Wed Sep 4 15:16:27 2013 -0700
Committer: Shreepadma Venugopalan <sh...@cloudera.com>
Committed: Wed Sep 4 15:16:27 2013 -0700

----------------------------------------------------------------------
 .../apache/sentry/tests/e2e/TestCrossDbOps.java | 44 ++++++-------
 .../tests/e2e/TestPerDBConfiguration.java       | 32 ++++-----
 .../e2e/TestPrivilegesAtDatabaseScope.java      | 68 ++++++++++----------
 .../tests/e2e/TestPrivilegesAtTableScope.java   | 46 ++++++-------
 .../tests/e2e/TestRuntimeMetadataRetrieval.java | 10 +--
 .../apache/sentry/tests/e2e/TestSandboxOps.java | 32 ++++-----
 .../e2e/TestSentryOnFailureHookLoading.java     |  6 +-
 7 files changed, 119 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestCrossDbOps.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestCrossDbOps.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestCrossDbOps.java
index c619bb0..891b7c2 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestCrossDbOps.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestCrossDbOps.java
@@ -69,9 +69,9 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
 
   /*
    * Admin creates DB_1, DB2, tables (tab_1 ) and (tab_2, tab_3) in DB_1 and
-   * DB_2 respectively. User user_1 has select on DB_1.tab_1, insert on
-   * DB2.tab_2 User user_2 has select on DB2.tab_3 Test show database and show
-   * tables for both user_1 and user_2
+   * DB_2 respectively. User user1 has select on DB_1.tab_1, insert on
+   * DB2.tab_2 User user2 has select on DB2.tab_3 Test show database and show
+   * tables for both user1 and user2
    */
   @Test
   public void testShowDatabasesAndShowTables() throws Exception {
@@ -196,9 +196,9 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
 
   /*
    * Admin creates DB_1, DB2, tables (tab_1 ) and (tab_2, tab_3) in DB_1 and
-   * DB_2 respectively. User user_1 has select on DB_1.tab_1, insert on
-   * DB2.tab_2 User user_2 has select on DB2.tab_3 Test show database and show
-   * tables for both user_1 and user_2
+   * DB_2 respectively. User user1 has select on DB_1.tab_1, insert on
+   * DB2.tab_2 User user2 has select on DB2.tab_3 Test show database and show
+   * tables for both user1 and user2
    */
   @Test
   public void testJDBCGetSchemasAndGetTables() throws Exception {
@@ -359,10 +359,10 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
   }
 
   /**
-   * 2.8 admin user create two database, DB_1, DB_2 admin grant all to USER_1,
-   * USER_2 on DB_1, admin grant all to USER_1's group, USER_2's group on DB_2
-   * positive test case: USER_1, USER_2 has ALL privilege on both DB_1 and DB_2
-   * negative test case: USER_1, USER_2 don't have ALL privilege on SERVER
+   * 2.8 admin user create two database, DB_1, DB_2 admin grant all to USER1,
+   * USER2 on DB_1, admin grant all to user1's group, user2's group on DB_2
+   * positive test case: user1, user2 has ALL privilege on both DB_1 and DB_2
+   * negative test case: user1, user2 don't have ALL privilege on SERVER
    */
   @Test
   public void testDbPrivileges() throws Exception {
@@ -424,8 +424,8 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
 
   /**
    * Test Case 2.14 admin user create a new database DB_1 create TABLE_1 in DB_1
-   * admin user grant INSERT to USER_1's group on TABLE_1 negative test case:
-   * USER_1 try to do following on TABLE_1 will fail: --explain --analyze
+   * admin user grant INSERT to user1's group on TABLE_1 negative test case:
+   * user1 try to do following on TABLE_1 will fail: --explain --analyze
    * --describe --describe function --show columns --show table status --show
    * table properties --show create table --show partitions --show indexes
    * --select * from TABLE_1.
@@ -462,8 +462,8 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
 
   /**
    * Test Case 2.16 admin user create a new database DB_1 create TABLE_1 and
-   * TABLE_2 (same schema) in DB_1 admin user grant SELECT, INSERT to USER_1's
-   * group on TABLE_2 negative test case: USER_1 try to do following on TABLE_1
+   * TABLE_2 (same schema) in DB_1 admin user grant SELECT, INSERT to user1's
+   * group on TABLE_2 negative test case: user1 try to do following on TABLE_1
    * will fail: --insert overwrite TABLE_2 select * from TABLE_1
    */
   @Test
@@ -582,13 +582,13 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
   /**
    * Steps: 1. admin user create databases, DB_1 and DB_2, no table or other
    * object in database
-   * 2. admin grant all to USER_1's group on DB_1 and DB_2
+   * 2. admin grant all to user1's group on DB_1 and DB_2
    * positive test case:
-   *  a)USER_1 has the privilege to create table, load data,
+   *  a)user1 has the privilege to create table, load data,
    *   drop table, create view, insert more data on both databases
-   * b) USER_1 can switch between DB_1 and DB_2 without exception
+   * b) user1 can switch between DB_1 and DB_2 without exception
    * negative test case:
-   * c) USER_1 cannot drop database
+   * c) user1 cannot drop database
    */
   @Test
   public void testSandboxOpt9() throws Exception {
@@ -656,13 +656,13 @@ public class TestCrossDbOps extends AbstractTestWithStaticLocalFS {
   /**
    * Steps: 1. admin user create databases, DB_1 and DB_2, no table or other
    * object in database positive test case:
-   * d) USER_1 has the privilege to create view on tables in DB_1 negative test case:
-   * e) USER_1 cannot create view in DB_1 that select from tables in DB_2
+   * d) user1 has the privilege to create view on tables in DB_1 negative test case:
+   * e) user1 cannot create view in DB_1 that select from tables in DB_2
    *  with no select privilege 2.
    * positive test case:
-   * f) USER_1 has the privilege to create view to select from DB_1.tb_1
+   * f) user1 has the privilege to create view to select from DB_1.tb_1
    *  and DB_2.tb_2 negative test case:
-   * g) USER_1 cannot create view to select from DB_1.tb_1 and DB_2.tb_3
+   * g) user1 cannot create view to select from DB_1.tb_1 and DB_2.tb_3
    */
   @Test
   public void testCrossDbViewOperations() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPerDBConfiguration.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPerDBConfiguration.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPerDBConfiguration.java
index e265f3d..b0523ab 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPerDBConfiguration.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPerDBConfiguration.java
@@ -79,8 +79,8 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
         // users: users -> groups
         "[users]",
         "hive = admin",
-        "user_1 = user_group1",
-        "user_2 = user_group2",
+        "user1 = user_group1",
+        "user2 = user_group2",
         "[databases]",
         "db2 = " + db2PolicyFile.getPath(),
     };
@@ -115,7 +115,7 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db1");
     // test user1 can execute query on tbl1
@@ -129,7 +129,7 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
 
     // test per-db file for db2
 
-    connection = context.createConnection("user_2", "password");
+    connection = context.createConnection("user2", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db2");
     // test user2 can execute query on tbl2
@@ -190,10 +190,10 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
         // users: users -> groups
         "[users]",
         "hive = admin",
-        "user_1 = user_group1",
-        "user_2 = user_group2",
-        "user_3 = user_group3",
-        "user_4 = user_group4",
+        "user1 = user_group1",
+        "user2 = user_group2",
+        "user3 = user_group3",
+        "user4 = user_group4",
         "[databases]",
         "db2 = " + db2PolicyFile.getPath(),
         "db3 = " + db3PolicyFile.getPath(),
@@ -260,14 +260,14 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db1");
     // test user1 can execute query on tbl1
     verifyCount(statement, "SELECT COUNT(*) FROM tbl1");
     connection.close();
 
-    connection = context.createConnection("user_2", "password");
+    connection = context.createConnection("user2", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db2");
     // test user1 can execute query on tbl1
@@ -275,14 +275,14 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
     connection.close();
 
     // verify no access to db3 due to badly formatted rule in db3 policy file
-    connection = context.createConnection("user_3", "password");
+    connection = context.createConnection("user3", "password");
     statement = context.createStatement(connection);
     context.assertAuthzException(statement, "USE db3");
     // test user1 can execute query on tbl1
     context.assertAuthzException(statement, "SELECT COUNT(*) FROM db3.tbl3");
     connection.close();
 
-    connection = context.createConnection("user_4", "password");
+    connection = context.createConnection("user4", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db4");
     // test user1 can execute query on tbl1
@@ -328,8 +328,8 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
         // users: users -> groups
         "[users]",
         "hive = admin",
-        "user_1 = user_group1",
-        "user_2 = user_group2",
+        "user1 = user_group1",
+        "user2 = user_group2",
         "[databases]",
         "db2 = " + db2PolicyFile.getPath(),
     };
@@ -369,7 +369,7 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db1");
     // test user1 can execute query on tbl1
@@ -382,7 +382,7 @@ public class TestPerDBConfiguration extends AbstractTestWithStaticLocalFS {
     connection.close();
 
     // test per-db file for db2
-    connection = context.createConnection("user_2", "password");
+    connection = context.createConnection("user2", "password");
     statement = context.createStatement(connection);
     statement.execute("USE db2");
     // test user2 can execute query on tbl2

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtDatabaseScope.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtDatabaseScope.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtDatabaseScope.java
index 91adf8e..7330d4a 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtDatabaseScope.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtDatabaseScope.java
@@ -60,7 +60,7 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
   }
 
   /* Admin creates database DB_1
-   * Admin grants ALL to USER_GROUP of which USER_1 is a member.
+   * Admin grants ALL to USER_GROUP of which user1 is a member.
    */
   @Test
   public void testAllPrivilege() throws Exception {
@@ -89,8 +89,8 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
-    context.append("user_2 = user_group2");
+    context.append("user1 = user_group1");
+    context.append("user2 = user_group2");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -102,7 +102,7 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);  
     // test user can create table
     statement.execute("CREATE TABLE DB_1.TAB_1(A STRING)");
@@ -180,7 +180,7 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
   }
 
   /* Admin creates database DB_1, creates table TAB_1, loads data into it
-   * Admin grants ALL to USER_GROUP of which USER_1 is a member.
+   * Admin grants ALL to USER_GROUP of which user1 is a member.
    */
   @Test
   public void testAllPrivilegeOnObjectOwnedByAdmin() throws Exception {
@@ -212,8 +212,8 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
-    context.append("user_2 = user_group2");
+    context.append("user1 = user_group1");
+    context.append("user2 = user_group2");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -231,7 +231,7 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     // test user can switch db
     statement.execute("USE DB_1");
@@ -287,7 +287,7 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     statement.close();
     connection.close();
 
-    connection = context.createConnection("user_2", "password");
+    connection = context.createConnection("user2", "password");
     statement = context.createStatement(connection);
     try {
       statement.execute("CREATE EXTERNAL TABLE EXT_TAB_1(A STRING) STORED AS TEXTFILE LOCATION 'file:"+
@@ -338,9 +338,9 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
-    context.append("user_2 = user_group2");
-    context.append("user_3 = user_group3");
+    context.append("user1 = user_group1");
+    context.append("user2 = user_group2");
+    context.append("user3 = user_group3");
 
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
@@ -355,30 +355,30 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     statement.execute("CREATE TABLE TAB_2(A STRING)");
     context.close();
 
-    // user_1 should be able to connect db_1
-    connection = context.createConnection("user_1", "hive");
+    // user1 should be able to connect db_1
+    connection = context.createConnection("user1", "hive");
     statement = context.createStatement(connection);
     statement.execute("use DB_1");
     context.close();
 
-    // user_2 should not be able to connect db_1
-    connection = context.createConnection("user_2", "hive");
+    // user2 should not be able to connect db_1
+    connection = context.createConnection("user2", "hive");
     statement = context.createStatement(connection);
     try {
       statement.execute("use DB_1");
-      assertFalse("User_2 shouldn't be able switch to db_1", true);
+      assertFalse("user2 shouldn't be able switch to db_1", true);
     } catch (SQLException e) {
       context.verifyAuthzException(e);
     }
     statement.execute("use DB_2");
     context.close();
 
-    // user_3 who is not listed in policy file should not be able to connect db_2
-    connection = context.createConnection("user_3", "hive");
+    // user3 who is not listed in policy file should not be able to connect db_2
+    connection = context.createConnection("user3", "hive");
     statement = context.createStatement(connection);
     try {
       statement.execute("use DB_2");
-      assertFalse("User_3 shouldn't be able switch to db_2", true);
+      assertFalse("user3 shouldn't be able switch to db_2", true);
     } catch (SQLException e) {
       context.verifyAuthzException(e);
     }
@@ -410,26 +410,26 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
-    context.append("user_2 = user_group2");
-    context.append("user_3 = user_group3");
+    context.append("user1 = user_group1");
+    context.append("user2 = user_group2");
+    context.append("user3 = user_group3");
 
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_1", "hive");
+    connection = context.createConnection("user1", "hive");
     statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_2", "hive");
+    connection = context.createConnection("user2", "hive");
     statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_3", "hive");
+    connection = context.createConnection("user3", "hive");
     statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
@@ -463,31 +463,31 @@ public class TestPrivilegesAtDatabaseScope extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
-    context.append("user_2 = user_group2");
-    context.append("user_3 = user_group3");
+    context.append("user1 = user_group1");
+    context.append("user2 = user_group2");
+    context.append("user3 = user_group3");
 
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_1", "hive");
+    connection = context.createConnection("user1", "hive");
     statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_2", "hive");
+    connection = context.createConnection("user2", "hive");
     statement = context.createStatement(connection);
     statement.execute("use default");
     context.close();
 
-    connection = context.createConnection("user_3", "hive");
+    connection = context.createConnection("user3", "hive");
     statement = context.createStatement(connection);
     try {
-      // user_3 doesn't have any implicit permission for default
+      // user3 doesn't have any implicit permission for default
       statement.execute("use default");
-      assertFalse("User_3 shouldn't be able switch to default", true);
+      assertFalse("user3 shouldn't be able switch to default", true);
     } catch (SQLException e) {
       context.verifyAuthzException(e);
     }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtTableScope.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtTableScope.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtTableScope.java
index 3da96a0..21bc846 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtTableScope.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestPrivilegesAtTableScope.java
@@ -62,7 +62,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, loads data into
    * TAB_1, TAB_2 Admin grants SELECT on TAB_1, TAB_2, INSERT on TAB_1 to
-   * USER_GROUP of which USER_1 is a member.
+   * USER_GROUP of which user1 is a member.
    */
   @Test
   public void testInsertAndSelect() throws Exception {
@@ -89,7 +89,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -106,7 +106,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can insert
@@ -142,8 +142,8 @@ public class TestPrivilegesAtTableScope
     statement.close();
     connection.close();
 
-    // negative test: connect as user_1 and try to recreate tab_1
-    connection = context.createConnection("user_1", "password");
+    // negative test: connect as user1 and try to recreate tab_1
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     try {
@@ -168,7 +168,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, loads data into
    * TAB_1, TAB_2. Admin grants INSERT on TAB_1, SELECT on TAB_2 to USER_GROUP
-   * of which USER_1 is a member.
+   * of which user1 is a member.
    */
   @Test
   public void testInsert() throws Exception {
@@ -194,7 +194,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -212,7 +212,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can execute insert on table
@@ -264,7 +264,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, loads data into
    * TAB_1, TAB_2. Admin grants SELECT on TAB_1, TAB_2 to USER_GROUP of which
-   * USER_1 is a member.
+   * user1 is a member.
    */
   @Test
   public void testSelect() throws Exception {
@@ -290,7 +290,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -309,7 +309,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can execute query on table
@@ -361,7 +361,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, VIEW_1 on TAB_1
    * loads data into TAB_1, TAB_2. Admin grants SELECT on TAB_1,TAB_2 to
-   * USER_GROUP of which USER_1 is a member.
+   * USER_GROUP of which user1 is a member.
    */
   @Test
   public void testTableViewJoin() throws Exception {
@@ -386,7 +386,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -407,7 +407,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can execute query TAB_1 JOIN TAB_2
@@ -446,7 +446,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, VIEW_1 on TAB_1
    * loads data into TAB_1, TAB_2. Admin grants SELECT on TAB_2 to USER_GROUP of
-   * which USER_1 is a member.
+   * which user1 is a member.
    */
   @Test
   public void testTableViewJoin2() throws Exception {
@@ -473,7 +473,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -494,7 +494,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can execute query on TAB_2
@@ -541,7 +541,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, VIEW_1 on TAB_1
    * loads data into TAB_1, TAB_2. Admin grants SELECT on TAB_2, VIEW_1 to
-   * USER_GROUP of which USER_1 is a member.
+   * USER_GROUP of which user1 is a member.
    */
   @Test
   public void testTableViewJoin3() throws Exception {
@@ -567,7 +567,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -588,7 +588,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
     // test user can execute query on TAB_2
@@ -651,7 +651,7 @@ public class TestPrivilegesAtTableScope
   /*
    * Admin creates database DB_1, table TAB_1, TAB_2 in DB_1, VIEW_1 on TAB_1
    * loads data into TAB_1, TAB_2. Admin grants SELECT on TAB_1, VIEW_1 to
-   * USER_GROUP of which USER_1 is a member.
+   * USER_GROUP of which user1 is a member.
    */
   @Test
   public void testTableViewJoin4() throws Exception {
@@ -677,7 +677,7 @@ public class TestPrivilegesAtTableScope
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group");
+    context.append("user1 = user_group");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -698,7 +698,7 @@ public class TestPrivilegesAtTableScope
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
     statement.execute("USE DB_1");
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestRuntimeMetadataRetrieval.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestRuntimeMetadataRetrieval.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestRuntimeMetadataRetrieval.java
index 27871a1..437ca03 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestRuntimeMetadataRetrieval.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestRuntimeMetadataRetrieval.java
@@ -66,7 +66,7 @@ public class TestRuntimeMetadataRetrieval
   /**
    * Steps: 1. admin create db_1 and db_1.tb_1
    *        2. admin should see all tables
-   *        3. user_1 should only see the tables it has any level of privilege
+   *        3. user1 should only see the tables it has any level of privilege
    */
   @Test
   public void testShowTables1() throws Exception {
@@ -120,7 +120,7 @@ public class TestRuntimeMetadataRetrieval
   /**
    * Steps: 1. admin create db_1 and tables
    * 2. admin should see all tables
-   * 3. user_1 should only see the all tables with db level privilege
+   * 3. user1 should only see the all tables with db level privilege
    */
   @Test
   public void testShowTables2() throws Exception {
@@ -168,7 +168,7 @@ public class TestRuntimeMetadataRetrieval
   /**
    * Steps: 1. admin create db_1 and db_1.tb_1
    *        2. admin should see all tables
-   *        3. user_1 should only see the tables he/she has any level of privilege
+   *        3. user1 should only see the tables he/she has any level of privilege
    */
   @Test
   public void testShowTables3() throws Exception {
@@ -218,7 +218,7 @@ public class TestRuntimeMetadataRetrieval
   /**
    * Steps: 1. admin create db_1 and db_1.tb_1
    *        2. admin should see all tables
-   *        3. user_1 should only see the tables with db level privilege
+   *        3. user1 should only see the tables with db level privilege
    */
   @Test
   public void testShowTables4() throws Exception {
@@ -265,7 +265,7 @@ public class TestRuntimeMetadataRetrieval
 
   /**
    * Steps: 1. admin creates tables in default db
-   *        2. user_1 shouldn't see any table when he/she doesn't have any privilege on default
+   *        2. user1 shouldn't see any table when he/she doesn't have any privilege on default
    */
   @Test
   public void testShowTables5() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSandboxOps.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSandboxOps.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSandboxOps.java
index 6d77a85..c5901b9 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSandboxOps.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSandboxOps.java
@@ -137,8 +137,8 @@ public class TestSandboxOps  extends AbstractTestWithStaticDFS {
 
   /**
    * Test Case 2.16 admin user create a new database DB_1 create TABLE_1 and
-   * TABLE_2 (same schema) in DB_1 admin user grant SELECT, INSERT to USER_1's
-   * group on TABLE_2 negative test case: USER_1 try to do following on TABLE_1
+   * TABLE_2 (same schema) in DB_1 admin user grant SELECT, INSERT to user1's
+   * group on TABLE_2 negative test case: user1 try to do following on TABLE_1
    * will fail: --insert overwrite TABLE_2 select * from TABLE_1
    */
   @Test
@@ -248,25 +248,25 @@ public class TestSandboxOps  extends AbstractTestWithStaticDFS {
    * Steps:
    * 1. admin user create databases, DB_1 and DB_2, no table or other
    * object in database
-   * 2. admin grant all to USER_1's group on DB_1 and DB_2
+   * 2. admin grant all to user1's group on DB_1 and DB_2
    *   positive test case:
-   *     a)USER_1 has the privilege to create table, load data,
+   *     a)user1 has the privilege to create table, load data,
    *     drop table, create view, insert more data on both databases
-   *     b) USER_1 can switch between DB_1 and DB_2 without
+   *     b) user1 can switch between DB_1 and DB_2 without
    *     exception negative test case:
-   *     c) USER_1 cannot drop database
+   *     c) user1 cannot drop database
    * 3. admin remove all to group1 on DB_2
    *   positive test case:
-   *     d) USER_1 has the privilege to create view on tables in DB_1
+   *     d) user1 has the privilege to create view on tables in DB_1
    *   negative test case:
-   *     e) USER_1 cannot create view on tables in DB_1 that select
+   *     e) user1 cannot create view on tables in DB_1 that select
    *     from tables in DB_2
    * 4. admin grant select to group1 on DB_2.ta_2
    *   positive test case:
-   *     f) USER_1 has the privilege to create view to select from
+   *     f) user1 has the privilege to create view to select from
    *     DB_1.tb_1 and DB_2.tb_2
    *   negative test case:
-   *     g) USER_1 cannot create view to select from DB_1.tb_1
+   *     g) user1 cannot create view to select from DB_1.tb_1
    *     and DB_2.tb_3
    * @throws Exception
    */
@@ -334,12 +334,12 @@ public class TestSandboxOps  extends AbstractTestWithStaticDFS {
    * 1. admin user create a new database DB_1
    * 2. admin create TABLE_1 in DB_1
    * 3. admin create INDEX_1 for COLUMN_1 in TABLE_1 in DB_1
-   * 4. admin user grant INSERT and SELECT to USER_1's group on TABLE_1
+   * 4. admin user grant INSERT and SELECT to user1's group on TABLE_1
    *
    *   negative test case:
-   *     a) USER_1 try to SELECT * FROM TABLE_1 WHERE COLUMN_1 == ...
+   *     a) user1 try to SELECT * FROM TABLE_1 WHERE COLUMN_1 == ...
    *     should NOT work
-   *     b) USER_1 should not be able to check the list of view or
+   *     b) user1 should not be able to check the list of view or
    *     index in DB_1
    * @throws Exception
    */
@@ -557,8 +557,8 @@ public class TestSandboxOps  extends AbstractTestWithStaticDFS {
         // users: users -> groups
         "[users]",
         "hive = admin",
-        "user_1 = user_group1",
-        "user_2 = user_group2",
+        "user1 = user_group1",
+        "user2 = user_group2",
         "[databases]",
         "db2 = " + dfsBaseDir.toUri().toString() + "/" + db2PolicyFile.getName()
     };
@@ -595,7 +595,7 @@ public class TestSandboxOps  extends AbstractTestWithStaticDFS {
 
     // test per-db file for db2
 
-    connection = context.createConnection("user_2", "password");
+    connection = context.createConnection("user2", "password");
     statement = context.createStatement(connection);
     // test user2 can use db2
     statement.execute("USE db2");

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4bfd2dc8/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSentryOnFailureHookLoading.java
----------------------------------------------------------------------
diff --git a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSentryOnFailureHookLoading.java b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSentryOnFailureHookLoading.java
index 139d43f..b16d00a 100644
--- a/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSentryOnFailureHookLoading.java
+++ b/sentry-tests/src/test/java/org/apache/sentry/tests/e2e/TestSentryOnFailureHookLoading.java
@@ -56,7 +56,7 @@ public class TestSentryOnFailureHookLoading extends AbstractTestWithHiveServer {
   }
 
   /* Admin creates database DB_2
-   * USER_1 tries to drop DB_2, but it has permissions for DB_1.
+   * user1 tries to drop DB_2, but it has permissions for DB_1.
    */
   @Test
   public void testOnFailureHookLoading() throws Exception {
@@ -94,7 +94,7 @@ public class TestSentryOnFailureHookLoading extends AbstractTestWithHiveServer {
     // users: users -> groups
     context.append("[users]");
     context.append("hive = admin");
-    context.append("user_1 = user_group1");
+    context.append("user1 = user_group1");
     // setup db objects needed by the test
     Connection connection = context.createConnection("hive", "hive");
     Statement statement = context.createStatement(connection);
@@ -106,7 +106,7 @@ public class TestSentryOnFailureHookLoading extends AbstractTestWithHiveServer {
     connection.close();
 
     // test execution
-    connection = context.createConnection("user_1", "password");
+    connection = context.createConnection("user1", "password");
     statement = context.createStatement(connection);
 
     //negative test case: user can't drop another user's database