You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2014/04/21 22:10:13 UTC

[1/4] git commit: ACCUMULO-2697 Look for serious findbug issues in the build

Repository: accumulo
Updated Branches:
  refs/heads/master 3086472f4 -> 36a97ac01


ACCUMULO-2697 Look for serious findbug issues in the build


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

Branch: refs/heads/master
Commit: e4b08b17ff0f42db6ba64f79cd277a918fe6fc23
Parents: b383cc5
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 21 12:18:59 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 21 15:16:26 2014 -0400

----------------------------------------------------------------------
 core/pom.xml                               |  7 +++++
 core/src/main/findbugs/exclude-filter.xml  | 36 +++++++++++++++++++++++++
 pom.xml                                    | 24 +++++++++++++++++
 proxy/pom.xml                              | 13 +++++++++
 proxy/src/main/findbugs/exclude-filter.xml | 21 +++++++++++++++
 trace/pom.xml                              | 13 +++++++++
 trace/src/main/findbugs/exclude-filter.xml | 21 +++++++++++++++
 7 files changed, 135 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index dbb924d..2509435 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -167,6 +167,13 @@
             </excludes>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <configuration>
+            <excludeFilterFile>src/main/findbugs/exclude-filter.xml</excludeFilterFile>
+          </configuration>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/core/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/core/src/main/findbugs/exclude-filter.xml b/core/src/main/findbugs/exclude-filter.xml
new file mode 100644
index 0000000..88b7922
--- /dev/null
+++ b/core/src/main/findbugs/exclude-filter.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<FindBugsFilter>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.client\.impl\.thrift\..*" />
+    </Match>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.data\.thrift\..*" />
+    </Match>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.gc\.thrift\..*" />
+    </Match>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.master\.thrift\..*" />
+    </Match>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.security\.thrift\..*" />
+    </Match>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.core\.tabletserver\.thrift\..*" />
+    </Match>
+</FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f109643..d321c55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -452,6 +452,18 @@
     <pluginManagement>
       <plugins>
         <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <version>2.5.3</version>
+          <configuration>
+            <xmlOutput>true</xmlOutput>
+            <effort>Max</effort>
+            <failOnError>true</failOnError>
+            <includeTests>true</includeTests>
+            <maxRank>1</maxRank>
+          </configuration>
+        </plugin>
+        <plugin>
           <groupId>com.google.code.sortpom</groupId>
           <artifactId>maven-sortpom-plugin</artifactId>
           <version>2.3.0</version>
@@ -815,6 +827,18 @@
         </executions>
       </plugin>
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>run-findbugs</id>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-scm-publish-plugin</artifactId>
         <executions>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/proxy/pom.xml
----------------------------------------------------------------------
diff --git a/proxy/pom.xml b/proxy/pom.xml
index a994e53..d1e0ebb 100644
--- a/proxy/pom.xml
+++ b/proxy/pom.xml
@@ -87,6 +87,19 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <configuration>
+            <excludeFilterFile>src/main/findbugs/exclude-filter.xml</excludeFilterFile>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
   <profiles>
     <profile>
       <id>thrift</id>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/proxy/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/proxy/src/main/findbugs/exclude-filter.xml b/proxy/src/main/findbugs/exclude-filter.xml
new file mode 100644
index 0000000..97cf1ef
--- /dev/null
+++ b/proxy/src/main/findbugs/exclude-filter.xml
@@ -0,0 +1,21 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<FindBugsFilter>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.proxy\.thrift\..*" />
+    </Match>
+</FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/trace/pom.xml
----------------------------------------------------------------------
diff --git a/trace/pom.xml b/trace/pom.xml
index 8cd6969..0c34dfa 100644
--- a/trace/pom.xml
+++ b/trace/pom.xml
@@ -53,6 +53,19 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <configuration>
+            <excludeFilterFile>src/main/findbugs/exclude-filter.xml</excludeFilterFile>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
   <profiles>
     <profile>
       <id>thrift</id>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/e4b08b17/trace/src/main/findbugs/exclude-filter.xml
----------------------------------------------------------------------
diff --git a/trace/src/main/findbugs/exclude-filter.xml b/trace/src/main/findbugs/exclude-filter.xml
new file mode 100644
index 0000000..408a32c
--- /dev/null
+++ b/trace/src/main/findbugs/exclude-filter.xml
@@ -0,0 +1,21 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<FindBugsFilter>
+    <Match>
+        <Class name="~org\.apache\.accumulo\.trace\.thrift\..*" />
+    </Match>
+</FindBugsFilter>


[3/4] git commit: ACCUMULO-2171 Include ShellServerIT in minimal/sunny testing

Posted by ct...@apache.org.
ACCUMULO-2171 Include ShellServerIT in minimal/sunny testing


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

Branch: refs/heads/master
Commit: 6ea1ead4e97ca98fbca4dccf2eb70a58301a5c19
Parents: d275090
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 21 15:24:37 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 21 15:27:53 2014 -0400

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/6ea1ead4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d321c55..133e08e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1061,7 +1061,7 @@
       <id>sunny</id>
       <properties>
         <failIfNoTests>false</failIfNoTests>
-        <it.test>ReadWriteIT,SimpleProxyIT,ExamplesIT</it.test>
+        <it.test>ReadWriteIT,SimpleProxyIT,ExamplesIT,ShellServerIT</it.test>
       </properties>
     </profile>
     <profile>


[4/4] git commit: Merge branch '1.6.0-SNAPSHOT'

Posted by ct...@apache.org.
Merge branch '1.6.0-SNAPSHOT'

Conflicts:
	server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java


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

Branch: refs/heads/master
Commit: 36a97ac019165804c2ce27984c9cc15f854ae874
Parents: 3086472 6ea1ead
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 21 16:10:14 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 21 16:10:14 2014 -0400

----------------------------------------------------------------------
 core/pom.xml                                    |   7 +
 core/src/main/findbugs/exclude-filter.xml       |  36 +++++
 pom.xml                                         |  26 +++-
 proxy/pom.xml                                   |  13 ++
 proxy/src/main/findbugs/exclude-filter.xml      |  21 +++
 .../server/security/SecurityOperation.java      |   8 +-
 .../server/security/SystemCredentials.java      |  51 ++++---
 .../server/security/SystemCredentialsIT.java    | 148 +++++++++++++++++++
 trace/pom.xml                                   |  13 ++
 trace/src/main/findbugs/exclude-filter.xml      |  21 +++
 10 files changed, 313 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/core/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/proxy/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
index d99f104,b5d7aba..63528a3
--- a/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
@@@ -91,8 -89,9 +90,9 @@@ public final class SystemCredentials ex
      private SystemToken(byte[] systemPassword) {
        super(systemPassword);
      }
-     
-     private static SystemToken get() {
+ 
+     private static SystemToken get(Instance instance) {
 -      byte[] instanceIdBytes = instance.getInstanceID().getBytes(Constants.UTF8);
++      byte[] instanceIdBytes = instance.getInstanceID().getBytes(StandardCharsets.UTF_8);
        byte[] confChecksum;
        MessageDigest md;
        try {
@@@ -100,11 -99,11 +100,11 @@@
        } catch (NoSuchAlgorithmException e) {
          throw new RuntimeException("Failed to compute configuration checksum", e);
        }
-       
+ 
        // seed the config with the version and instance id, so at least it's not empty
 -      md.update(ServerConstants.WIRE_VERSION.toString().getBytes(Constants.UTF8));
 +      md.update(ServerConstants.WIRE_VERSION.toString().getBytes(StandardCharsets.UTF_8));
-       md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes(StandardCharsets.UTF_8));
-       
+       md.update(instanceIdBytes);
+ 
        for (Entry<String,String> entry : ServerConfiguration.getSiteConfiguration()) {
          // only include instance properties
          if (entry.getKey().startsWith(Property.INSTANCE_PREFIX.toString())) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/36a97ac0/trace/pom.xml
----------------------------------------------------------------------


[2/4] git commit: ACCUMULO-2700 Fix system credentials checks and add a test

Posted by ct...@apache.org.
ACCUMULO-2700 Fix system credentials checks and add a test


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

Branch: refs/heads/master
Commit: d27509084ff45cef892c5735ee8fb559cd61dc0c
Parents: e4b08b1
Author: Christopher Tubbs <ct...@apache.org>
Authored: Mon Apr 21 15:14:05 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Mon Apr 21 15:27:53 2014 -0400

----------------------------------------------------------------------
 .../server/security/SecurityOperation.java      |   8 +-
 .../server/security/SystemCredentials.java      |  51 ++++---
 .../server/security/SystemCredentialsIT.java    | 148 +++++++++++++++++++
 3 files changed, 177 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d2750908/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
index f8b1702..c2a7001 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
@@ -154,11 +154,11 @@ public class SecurityOperation {
     if (!credentials.getInstanceId().equals(HdfsZooInstance.getInstance().getInstanceID()))
       throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.INVALID_INSTANCEID);
 
+    AuthenticationToken token = AuthenticationTokenSerializer.deserialize(credentials.getTokenClassName(), credentials.getToken());
     if (isSystemUser(credentials)) {
-      authenticateSystemUser(credentials);
+      authenticateSystemUserToken(credentials, token);
     } else {
       try {
-        AuthenticationToken token = AuthenticationTokenSerializer.deserialize(credentials.getTokenClassName(), credentials.getToken());
         if (!authenticator.authenticateUser(credentials.getPrincipal(), token)) {
           throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_CREDENTIALS);
         }
@@ -169,8 +169,8 @@ public class SecurityOperation {
     }
   }
 
-  private void authenticateSystemUser(TCredentials credentials) throws ThriftSecurityException {
-    if (SystemCredentials.get().getToken().equals(credentials.getToken()))
+  private void authenticateSystemUserToken(TCredentials credentials, AuthenticationToken token) throws ThriftSecurityException {
+    if (!SystemCredentials.get().getToken().equals(token))
       throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_CREDENTIALS);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d2750908/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java b/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
index 9b4931d..b5d7aba 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
@@ -43,55 +43,55 @@ import org.apache.hadoop.io.Writable;
  * @since 1.6.0
  */
 public final class SystemCredentials extends Credentials {
-  
+
   private static final SecurityPermission SYSTEM_CREDENTIALS_PERMISSION = new SecurityPermission("systemCredentialsPermission");
-  
+
   private static SystemCredentials SYSTEM_CREDS = null;
   private static final String SYSTEM_PRINCIPAL = "!SYSTEM";
-  private static final SystemToken SYSTEM_TOKEN = SystemToken.get();
-  
+
   private final TCredentials AS_THRIFT;
-  
-  private SystemCredentials() {
-    super(SYSTEM_PRINCIPAL, SYSTEM_TOKEN);
-    AS_THRIFT = super.toThrift(HdfsZooInstance.getInstance());
+
+  SystemCredentials(Instance instance) {
+    super(SYSTEM_PRINCIPAL, SystemToken.get(instance));
+    AS_THRIFT = super.toThrift(instance);
   }
-  
+
   public static SystemCredentials get() {
     SecurityManager sm = System.getSecurityManager();
     if (sm != null) {
       sm.checkPermission(SYSTEM_CREDENTIALS_PERMISSION);
     }
     if (SYSTEM_CREDS == null) {
-      SYSTEM_CREDS = new SystemCredentials();
+      SYSTEM_CREDS = new SystemCredentials(HdfsZooInstance.getInstance());
     }
     return SYSTEM_CREDS;
   }
-  
+
   @Override
   public TCredentials toThrift(Instance instance) {
     if (!AS_THRIFT.getInstanceId().equals(instance.getInstanceID()))
       throw new IllegalArgumentException("Unexpected instance used for " + SystemCredentials.class.getSimpleName() + ": " + instance.getInstanceID());
     return AS_THRIFT;
   }
-  
+
   /**
    * An {@link AuthenticationToken} type for Accumulo servers for inter-server communication.
    * 
    * @since 1.6.0
    */
   public static final class SystemToken extends PasswordToken {
-    
+
     /**
      * A Constructor for {@link Writable}.
      */
     public SystemToken() {}
-    
+
     private SystemToken(byte[] systemPassword) {
       super(systemPassword);
     }
-    
-    private static SystemToken get() {
+
+    private static SystemToken get(Instance instance) {
+      byte[] instanceIdBytes = instance.getInstanceID().getBytes(Constants.UTF8);
       byte[] confChecksum;
       MessageDigest md;
       try {
@@ -99,11 +99,11 @@ public final class SystemCredentials extends Credentials {
       } catch (NoSuchAlgorithmException e) {
         throw new RuntimeException("Failed to compute configuration checksum", e);
       }
-      
+
       // seed the config with the version and instance id, so at least it's not empty
       md.update(ServerConstants.WIRE_VERSION.toString().getBytes(Constants.UTF8));
-      md.update(HdfsZooInstance.getInstance().getInstanceID().getBytes(Constants.UTF8));
-      
+      md.update(instanceIdBytes);
+
       for (Entry<String,String> entry : ServerConfiguration.getSiteConfiguration()) {
         // only include instance properties
         if (entry.getKey().startsWith(Property.INSTANCE_PREFIX.toString())) {
@@ -112,16 +112,15 @@ public final class SystemCredentials extends Credentials {
         }
       }
       confChecksum = md.digest();
-      
+
       int wireVersion = ServerConstants.WIRE_VERSION;
-      byte[] inst = HdfsZooInstance.getInstance().getInstanceID().getBytes(Constants.UTF8);
-      
-      ByteArrayOutputStream bytes = new ByteArrayOutputStream(3 * (Integer.SIZE / Byte.SIZE) + inst.length + confChecksum.length);
+
+      ByteArrayOutputStream bytes = new ByteArrayOutputStream(3 * (Integer.SIZE / Byte.SIZE) + instanceIdBytes.length + confChecksum.length);
       DataOutputStream out = new DataOutputStream(bytes);
       try {
         out.write(wireVersion * -1);
-        out.write(inst.length);
-        out.write(inst);
+        out.write(instanceIdBytes.length);
+        out.write(instanceIdBytes);
         out.write(confChecksum.length);
         out.write(confChecksum);
       } catch (IOException e) {
@@ -131,5 +130,5 @@ public final class SystemCredentials extends Credentials {
       return new SystemToken(Base64.encodeBase64(bytes.toByteArray()));
     }
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d2750908/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java b/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
new file mode 100644
index 0000000..f5296c0
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.server.security;
+
+import static org.junit.Assert.assertEquals;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.security.SecurityErrorCode;
+import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.metadata.RootTable;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.Credentials;
+import org.apache.accumulo.server.client.HdfsZooInstance;
+import org.apache.accumulo.test.functional.ConfigurableMacIT;
+import org.junit.Test;
+
+public class SystemCredentialsIT extends ConfigurableMacIT {
+
+  private static final int FAIL_CODE = 7;
+
+  @Override
+  protected int defaultTimeoutSeconds() {
+    return 1 * 60;
+  }
+
+  @Test
+  public void testSystemCredentials() throws Exception {
+    assertEquals(0, exec(SystemCredentialsIT.class, "good", getCluster().getZooKeepers()).waitFor());
+    assertEquals(FAIL_CODE, exec(SystemCredentialsIT.class, "bad", getCluster().getZooKeepers()).waitFor());
+  }
+
+  public static void main(final String[] args) throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+    Credentials creds = null;
+    if (args.length < 2)
+      throw new RuntimeException("Incorrect usage; expected to be run by test only");
+    if (args[0].equals("bad")) {
+      creds = new SystemCredentials(new Instance() {
+
+        @Deprecated
+        @Override
+        public void setConfiguration(AccumuloConfiguration conf) {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public int getZooKeepersSessionTimeOut() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public String getZooKeepers() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public String getRootTabletLocation() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public List<String> getMasterLocations() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public String getInstanceName() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public String getInstanceID() {
+          return SystemCredentials.class.getName();
+        }
+
+        @Override
+        public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
+          throw new UnsupportedOperationException();
+        }
+
+        @Deprecated
+        @Override
+        public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
+          throw new UnsupportedOperationException();
+        }
+
+        @Deprecated
+        @Override
+        public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
+          throw new UnsupportedOperationException();
+        }
+
+        @Deprecated
+        @Override
+        public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
+          throw new UnsupportedOperationException();
+        }
+
+        @Deprecated
+        @Override
+        public AccumuloConfiguration getConfiguration() {
+          throw new UnsupportedOperationException();
+        }
+      });
+    } else if (args[0].equals("good")) {
+      creds = SystemCredentials.get();
+    }
+    Instance instance = HdfsZooInstance.getInstance();
+    Connector conn = instance.getConnector(creds.getPrincipal(), creds.getToken());
+    try {
+      Scanner scan = conn.createScanner(RootTable.NAME, Authorizations.EMPTY);
+      for (Entry<Key,Value> e : scan) {
+        e.hashCode();
+      }
+    } catch (RuntimeException e) {
+      // catch the runtime exception from the scanner iterator
+      if (e.getCause() instanceof AccumuloSecurityException && ((AccumuloSecurityException) e.getCause()).getSecurityErrorCode() == SecurityErrorCode.BAD_CREDENTIALS) {
+          e.printStackTrace(System.err);
+          System.exit(FAIL_CODE);
+      }
+    }
+  }
+}