Browse Source

HDFS-7061. Add test to verify encryption zone creation after NameNode restart without saving namespace. Contributed by Stephen Chu.

(cherry picked from commit fc741b5d78e7e006355e17b1b5839f502e37261b)
Andrew Wang 10 years ago
parent
commit
dd3e28d434

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -197,6 +197,9 @@ Release 2.6.0 - UNRELEASED
     HDFS-6482. Use block ID-based block layout on datanodes (James Thomas via
     Colin Patrick McCabe)
 
+    HDFS-7061. Add test to verify encryption zone creation after NameNode
+    restart without saving namespace. (Stephen Chu via wang)
+
   OPTIMIZATIONS
 
     HDFS-6690. Deduplicate xattr names in memory. (wang)

+ 10 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java

@@ -338,6 +338,16 @@ public class TestEncryptionZones {
     cluster.restartNameNode(true);
     assertNumZones(numZones);
     assertZonePresent(null, zone1.toString());
+
+    // Verify newly added ez is present after restarting the NameNode
+    // without persisting the namespace.
+    Path nonpersistZone = new Path("/nonpersistZone");
+    fsWrapper.mkdir(nonpersistZone, FsPermission.getDirDefault(), false);
+    dfsAdmin.createEncryptionZone(nonpersistZone, TEST_KEY);
+    numZones++;
+    cluster.restartNameNode(true);
+    assertNumZones(numZones);
+    assertZonePresent(null, nonpersistZone.toString());
   }
 
   /**