Search in sources :

Example 6 with TestingKdc

use of org.apache.accumulo.harness.TestingKdc in project accumulo by apache.

the class KerberosIT method startKdc.

@BeforeClass
public static void startKdc() throws Exception {
    kdc = new TestingKdc();
    kdc.start();
    krbEnabledForITs = System.getProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION);
    if (null == krbEnabledForITs || !Boolean.parseBoolean(krbEnabledForITs)) {
        System.setProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION, "true");
    }
    rootUser = kdc.getRootUser();
}
Also used : TestingKdc(org.apache.accumulo.harness.TestingKdc) BeforeClass(org.junit.BeforeClass)

Example 7 with TestingKdc

use of org.apache.accumulo.harness.TestingKdc in project accumulo by apache.

the class KerberosProxyIT method startKdc.

@BeforeClass
public static void startKdc() throws Exception {
    kdc = new TestingKdc();
    kdc.start();
    krbEnabledForITs = System.getProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION);
    if (null == krbEnabledForITs || !Boolean.parseBoolean(krbEnabledForITs)) {
        System.setProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION, "true");
    }
    // Create a principal+keytab for the proxy
    proxyKeytab = new File(kdc.getKeytabDir(), "proxy.keytab");
    hostname = InetAddress.getLocalHost().getCanonicalHostName();
    // Set the primary because the client needs to know it
    proxyPrimary = "proxy";
    // Qualify with an instance
    proxyPrincipal = proxyPrimary + "/" + hostname;
    kdc.createPrincipal(proxyKeytab, proxyPrincipal);
    // Tack on the realm too
    proxyPrincipal = kdc.qualifyUser(proxyPrincipal);
}
Also used : TestingKdc(org.apache.accumulo.harness.TestingKdc) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 8 with TestingKdc

use of org.apache.accumulo.harness.TestingKdc in project accumulo by apache.

the class KerberosRenewalIT method startKdc.

@BeforeClass
public static void startKdc() throws Exception {
    // 30s renewal time window
    kdc = new TestingKdc(TestingKdc.computeKdcDir(), TestingKdc.computeKeytabDir(), TICKET_LIFETIME);
    kdc.start();
    krbEnabledForITs = System.getProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION);
    if (null == krbEnabledForITs || !Boolean.parseBoolean(krbEnabledForITs)) {
        System.setProperty(MiniClusterHarness.USE_KERBEROS_FOR_IT_OPTION, "true");
    }
    rootUser = kdc.getRootUser();
}
Also used : TestingKdc(org.apache.accumulo.harness.TestingKdc) BeforeClass(org.junit.BeforeClass)

Aggregations

TestingKdc (org.apache.accumulo.harness.TestingKdc)8 BeforeClass (org.junit.BeforeClass)6 File (java.io.File)2 ClusterUser (org.apache.accumulo.cluster.ClusterUser)2 Properties (java.util.Properties)1 ClientConfiguration (org.apache.accumulo.core.client.ClientConfiguration)1 Connector (org.apache.accumulo.core.client.Connector)1 Instance (org.apache.accumulo.core.client.Instance)1 KerberosToken (org.apache.accumulo.core.client.security.tokens.KerberosToken)1 PasswordToken (org.apache.accumulo.core.client.security.tokens.PasswordToken)1 DefaultConfiguration (org.apache.accumulo.core.conf.DefaultConfiguration)1 Client (org.apache.accumulo.proxy.thrift.AccumuloProxy.Client)1 Configuration (org.apache.hadoop.conf.Configuration)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1 Before (org.junit.Before)1