|
@@ -184,6 +184,8 @@ public class TestEncryptionZones {
|
|
testRootDir = new File(testRoot).getAbsoluteFile();
|
|
testRootDir = new File(testRoot).getAbsoluteFile();
|
|
conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
|
conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH,
|
|
getKeyProviderURI());
|
|
getKeyProviderURI());
|
|
|
|
+ conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_SNAPSHOT_CAPTURE_OPENFILES,
|
|
|
|
+ true);
|
|
conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, true);
|
|
conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, true);
|
|
// Lower the batch size for testing
|
|
// Lower the batch size for testing
|
|
conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES,
|
|
conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES,
|
|
@@ -1389,6 +1391,14 @@ public class TestEncryptionZones {
|
|
assertEquals("Got unexpected ez path", zone.toString(),
|
|
assertEquals("Got unexpected ez path", zone.toString(),
|
|
dfsAdmin.getEncryptionZoneForPath(snap1Zone).getPath().toString());
|
|
dfsAdmin.getEncryptionZoneForPath(snap1Zone).getPath().toString());
|
|
|
|
|
|
|
|
+ // Append the file
|
|
|
|
+ DFSTestUtil.appendFile(fs, zoneFile, len);
|
|
|
|
+ // Verify file content in the snapshot
|
|
|
|
+ final Path snapshottedZoneFile = new Path(
|
|
|
|
+ snap1.toString() + "/" + zone.getName() + "/" + zoneFile.getName());
|
|
|
|
+ assertEquals("Contents of snapshotted file have changed unexpectedly",
|
|
|
|
+ contents, DFSTestUtil.readFile(fs, snapshottedZoneFile));
|
|
|
|
+
|
|
// Now delete the encryption zone, recreate the dir, and take another
|
|
// Now delete the encryption zone, recreate the dir, and take another
|
|
// snapshot
|
|
// snapshot
|
|
fsWrapper.delete(zone, true);
|
|
fsWrapper.delete(zone, true);
|
|
@@ -1441,8 +1451,6 @@ public class TestEncryptionZones {
|
|
assertEquals("Unexpected ez key", TEST_KEY2, listZone.getKeyName());
|
|
assertEquals("Unexpected ez key", TEST_KEY2, listZone.getKeyName());
|
|
|
|
|
|
// Verify contents of the snapshotted file
|
|
// Verify contents of the snapshotted file
|
|
- final Path snapshottedZoneFile = new Path(
|
|
|
|
- snap1.toString() + "/" + zone.getName() + "/" + zoneFile.getName());
|
|
|
|
assertEquals("Contents of snapshotted file have changed unexpectedly",
|
|
assertEquals("Contents of snapshotted file have changed unexpectedly",
|
|
contents, DFSTestUtil.readFile(fs, snapshottedZoneFile));
|
|
contents, DFSTestUtil.readFile(fs, snapshottedZoneFile));
|
|
|
|
|