accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/3] accumulo git commit: ACCUMULO-3599 Some user cleanup in tests.
Date Sat, 14 Mar 2015 20:12:37 GMT
ACCUMULO-3599 Some user cleanup in tests.

Only nuke users that the test actually uses.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/374fa8e6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/374fa8e6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/374fa8e6

Branch: refs/heads/master
Commit: 374fa8e60ad90bd62f3ff9df60cee0bcf8569ff3
Parents: c4bdf34
Author: Josh Elser <elserj@apache.org>
Authored: Fri Mar 13 20:04:21 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Mar 13 20:46:43 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/test/ConditionalWriterIT.java     |  8 +++-----
 .../apache/accumulo/test/functional/PermissionsIT.java    | 10 ++++++++--
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/374fa8e6/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 7ca4d72..e77b876 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -119,11 +119,9 @@ public class ConditionalWriterIT extends AccumuloClusterIT {
   public void deleteUsers() throws Exception {
     Connector conn = getConnector();
     Set<String> users = conn.securityOperations().listLocalUsers();
-    for (int i = 0; i < 5; i++) {
-      ClusterUser user = getUser(i);
-      if (users.contains(user.getPrincipal())) {
-        conn.securityOperations().dropLocalUser(user.getPrincipal());
-      }
+    ClusterUser user = getUser(0);
+    if (users.contains(user.getPrincipal())) {
+      conn.securityOperations().dropLocalUser(user.getPrincipal());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/374fa8e6/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
index d3021f1..807f020 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/PermissionsIT.java
@@ -70,8 +70,14 @@ public class PermissionsIT extends AccumuloClusterIT {
   }
 
   @Before
-  public void limitToMini() {
+  public void limitToMini() throws Exception {
     Assume.assumeTrue(ClusterType.MINI == getClusterType());
+    Connector c = getConnector();
+    Set<String> users = c.securityOperations().listLocalUsers();
+    ClusterUser user = getUser(0);
+    if (users.contains(user.getPrincipal())) {
+      c.securityOperations().dropLocalUser(user.getPrincipal());
+    }
   }
 
   private void loginAs(ClusterUser user) throws IOException {
@@ -499,7 +505,7 @@ public class PermissionsIT extends AccumuloClusterIT {
   @Test
   public void tablePermissionTest() throws Exception {
     // create the test user
-    ClusterUser testUser = getUser(1), rootUser = getAdminUser();
+    ClusterUser testUser = getUser(0), rootUser = getAdminUser();
 
     String principal = testUser.getPrincipal();
     AuthenticationToken token = testUser.getToken();


Mime
View raw message