|
@@ -150,7 +150,8 @@ public class TestEncryptionZones {
|
|
|
// Set up java key store
|
|
|
String testRoot = fsHelper.getTestRootDir();
|
|
|
testRootDir = new File(testRoot).getAbsoluteFile();
|
|
|
- conf.set(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, getKeyProviderURI());
|
|
|
+ conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
|
|
+ getKeyProviderURI());
|
|
|
conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, true);
|
|
|
// Lower the batch size for testing
|
|
|
conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES,
|
|
@@ -845,9 +846,9 @@ public class TestEncryptionZones {
|
|
|
// Check KeyProvider state
|
|
|
// Flushing the KP on the NN, since it caches, and init a test one
|
|
|
cluster.getNamesystem().getProvider().flush();
|
|
|
- KeyProvider provider = KeyProviderFactory
|
|
|
- .get(new URI(conf.getTrimmed(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI)),
|
|
|
- conf);
|
|
|
+ KeyProvider provider = KeyProviderFactory.get(new URI(conf.getTrimmed(
|
|
|
+ CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH)),
|
|
|
+ conf);
|
|
|
List<String> keys = provider.getKeys();
|
|
|
assertEquals("Expected NN to have created one key per zone", 1,
|
|
|
keys.size());
|
|
@@ -931,7 +932,8 @@ public class TestEncryptionZones {
|
|
|
public void testCreateEZWithNoProvider() throws Exception {
|
|
|
// Unset the key provider and make sure EZ ops don't work
|
|
|
final Configuration clusterConf = cluster.getConfiguration(0);
|
|
|
- clusterConf.unset(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI);
|
|
|
+ clusterConf
|
|
|
+ .unset(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH);
|
|
|
cluster.restartNameNode(true);
|
|
|
cluster.waitActive();
|
|
|
final Path zone1 = new Path("/zone1");
|
|
@@ -943,8 +945,9 @@ public class TestEncryptionZones {
|
|
|
assertExceptionContains("since no key provider is available", e);
|
|
|
}
|
|
|
final Path jksPath = new Path(testRootDir.toString(), "test.jks");
|
|
|
- clusterConf.set(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI,
|
|
|
- JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri()
|
|
|
+ clusterConf
|
|
|
+ .set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
|
|
+ JavaKeyStoreProvider.SCHEME_NAME + "://file" + jksPath.toUri()
|
|
|
);
|
|
|
// Try listing EZs as well
|
|
|
assertNumZones(0);
|