Преглед на файлове

HDFS-10814. Add assertion for getNumEncryptionZones when no EZ is created. Contributed by Vinitha Reddy Gankidi.

(cherry picked from commit 4bd45f54eedd449a98a90540698c6ceb47454fec)
Zhe Zhang преди 8 години
родител
ревизия
4c00ac8159
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestEncryptionZones.java

@@ -326,7 +326,9 @@ public class TestEncryptionZones {
   public void testBasicOperations() throws Exception {
 
     int numZones = 0;
-
+    /* Number of EZs should be 0 if no EZ is created */
+    assertEquals("Unexpected number of encryption zones!", numZones,
+        cluster.getNamesystem().getNumEncryptionZones());
     /* Test failure of create EZ on a directory that doesn't exist. */
     final Path zoneParent = new Path("/zones");
     final Path zone1 = new Path(zoneParent, "zone1");