From dd3e28d434e32c2c312856a987883b056c28b8ae Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Sun, 14 Sep 2014 23:48:24 -0700 Subject: [PATCH] HDFS-7061. Add test to verify encryption zone creation after NameNode restart without saving namespace. Contributed by Stephen Chu. (cherry picked from commit fc741b5d78e7e006355e17b1b5839f502e37261b) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/TestEncryptionZones.java | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 8ac8dc3f8b3..7a42ea97e18 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java index db3c085fe12..b3bf5d9a37b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java +++ b/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()); } /**