You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by bh...@apache.org on 2019/11/06 05:29:58 UTC

[hadoop-ozone] branch master updated: HDDS-2064. Add tests for incorrect OM HA config when node ID or RPC address is not configured (#119)

This is an automated email from the ASF dual-hosted git repository.

bharat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 21e5761  HDDS-2064. Add tests for incorrect OM HA config when node ID or RPC address is not configured (#119)
21e5761 is described below

commit 21e57618e20bb2c4898a4b7c42c53c29e1a4d69b
Author: Siyao Meng <50...@users.noreply.github.com>
AuthorDate: Tue Nov 5 21:29:48 2019 -0800

    HDDS-2064. Add tests for incorrect OM HA config when node ID or RPC address is not configured (#119)
---
 .../ozone/om/TestOzoneManagerConfiguration.java    | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
index 2491124..bb1fb15 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
@@ -281,6 +281,57 @@ public class TestOzoneManagerConfiguration {
   }
 
   /**
+   * A configuration with an empty node list while service ID is configured.
+   * Cluster should fail to start during config check.
+   * @throws Exception
+   */
+  @Test
+  public void testNoOMNodes() throws Exception {
+    String omServiceId = "service1";
+    conf.set(OMConfigKeys.OZONE_OM_SERVICE_IDS_KEY, omServiceId);
+    // Deliberately skip OZONE_OM_NODES_KEY and OZONE_OM_ADDRESS_KEY config
+
+    try {
+      startCluster();
+      Assert.fail("Should have failed to start the cluster!");
+    } catch (OzoneIllegalArgumentException e) {
+      // Expect error message
+      Assert.assertTrue(e.getMessage().contains(
+          "List of OM Node ID's should be specified"));
+    }
+  }
+
+  /**
+   * A configuration with no OM addresses while service ID is configured.
+   * Cluster should fail to start during config check.
+   * @throws Exception
+   */
+  @Test
+  public void testNoOMAddrs() throws Exception {
+    String omServiceId = "service1";
+
+    String omNode1Id = "omNode1";
+    String omNode2Id = "omNode2";
+    String omNode3Id = "omNode3";
+    String omNodesKeyValue = omNode1Id + "," + omNode2Id + "," + omNode3Id;
+    String omNodesKey = OmUtils.addKeySuffixes(
+        OMConfigKeys.OZONE_OM_NODES_KEY, omServiceId);
+
+    conf.set(OMConfigKeys.OZONE_OM_SERVICE_IDS_KEY, omServiceId);
+    conf.set(omNodesKey, omNodesKeyValue);
+    // Deliberately skip OZONE_OM_ADDRESS_KEY config
+
+    try {
+      startCluster();
+      Assert.fail("Should have failed to start the cluster!");
+    } catch (OzoneIllegalArgumentException e) {
+      // Expect error message
+      Assert.assertTrue(e.getMessage().contains(
+          "OM Rpc Address should be set for all node"));
+    }
+  }
+
+  /**
    * Test multiple OM service configuration.
    */
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org