Search in sources :

Example 1 with TestShell

use of org.apache.accumulo.test.ShellServerIT.TestShell in project accumulo by apache.

the class ShellConfigIT method experimentalPropTest.

@Test
public void experimentalPropTest() throws Exception {
    // ensure experimental props do not show up in config output unless set
    AuthenticationToken token = getAdminToken();
    File clientConfFile = null;
    switch(getClusterType()) {
        case MINI:
            MiniAccumuloClusterImpl mac = (MiniAccumuloClusterImpl) getCluster();
            clientConfFile = mac.getConfig().getClientConfFile();
            break;
        case STANDALONE:
            StandaloneAccumuloClusterConfiguration standaloneConf = (StandaloneAccumuloClusterConfiguration) getClusterConfiguration();
            clientConfFile = standaloneConf.getClientConfFile();
            break;
        default:
            Assert.fail("Unknown cluster type");
    }
    Assert.assertNotNull(clientConfFile);
    TestShell ts = null;
    if (token instanceof PasswordToken) {
        String passwd = new String(((PasswordToken) token).getPassword(), UTF_8);
        ts = new TestShell(getAdminPrincipal(), passwd, getCluster().getInstanceName(), getCluster().getZooKeepers(), clientConfFile);
    } else if (token instanceof KerberosToken) {
        ts = new TestShell(getAdminPrincipal(), null, getCluster().getInstanceName(), getCluster().getZooKeepers(), clientConfFile);
    } else {
        Assert.fail("Unknown token type");
    }
    assertTrue(Property.CRYPTO_CIPHER_KEY_ALGORITHM_NAME.isExperimental());
    String configOutput = ts.exec("config");
    assertTrue(configOutput.contains(PerTableVolumeChooser.TABLE_VOLUME_CHOOSER));
    assertFalse(configOutput.contains(Property.CRYPTO_CIPHER_KEY_ALGORITHM_NAME.getKey()));
}
Also used : TestShell(org.apache.accumulo.test.ShellServerIT.TestShell) PasswordToken(org.apache.accumulo.core.client.security.tokens.PasswordToken) AuthenticationToken(org.apache.accumulo.core.client.security.tokens.AuthenticationToken) StandaloneAccumuloClusterConfiguration(org.apache.accumulo.harness.conf.StandaloneAccumuloClusterConfiguration) KerberosToken(org.apache.accumulo.core.client.security.tokens.KerberosToken) MiniAccumuloClusterImpl(org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 AuthenticationToken (org.apache.accumulo.core.client.security.tokens.AuthenticationToken)1 KerberosToken (org.apache.accumulo.core.client.security.tokens.KerberosToken)1 PasswordToken (org.apache.accumulo.core.client.security.tokens.PasswordToken)1 StandaloneAccumuloClusterConfiguration (org.apache.accumulo.harness.conf.StandaloneAccumuloClusterConfiguration)1 MiniAccumuloClusterImpl (org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl)1 TestShell (org.apache.accumulo.test.ShellServerIT.TestShell)1 Test (org.junit.Test)1