public class SecureTestEnvironment extends Object
SecureTestEnvironment
to handle MiniKDC lifecycle. This class can be used to
start/stop MiniKDC and create secure configurations for MiniDFSCluster and MiniYarn.
If you use this class in your project, please make sure to add a dependency to hadoop-minikdc, e.g. in your pom.xml:
... <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minikdc</artifactId> <version>${minikdc.version}</version> <scope>compile</scope> </dependency> ... </dependencies> ... <build> <plugins> <!-- https://issues.apache.org/jira/browse/DIRSHARED-134 Required to pull the Mini-KDC transitive dependency --> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>3.0.1</version> <inherited>true</inherited> <extensions>true</extensions> </plugin> ...
Modifier and Type | Field and Description |
---|---|
static String |
HOST_NAME |
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
SecureTestEnvironment() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanup() |
static Map<String,org.apache.flink.test.util.TestingSecurityContext.ClientSecurityConfiguration> |
getClientSecurityConfigurationMap() |
static String |
getHadoopServicePrincipal() |
static String |
getRealm() |
static String |
getTestKeytab() |
static Configuration |
populateFlinkSecureConfigurations(Configuration flinkConf) |
static void |
prepare(File tempFolder,
String... additionalPrincipals) |
protected static final org.slf4j.Logger LOG
public static final String HOST_NAME
public static void cleanup()
public static Configuration populateFlinkSecureConfigurations(@Nullable Configuration flinkConf)
public static Map<String,org.apache.flink.test.util.TestingSecurityContext.ClientSecurityConfiguration> getClientSecurityConfigurationMap()
public static String getRealm()
public static String getTestKeytab()
public static String getHadoopServicePrincipal()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.