Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BDF44200B4B for ; Wed, 6 Jul 2016 08:38:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BCC11160A64; Wed, 6 Jul 2016 06:38:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 22A6E160A73 for ; Wed, 6 Jul 2016 08:38:32 +0200 (CEST) Received: (qmail 41007 invoked by uid 500); 6 Jul 2016 06:38:32 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 40165 invoked by uid 99); 6 Jul 2016 06:38:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2016 06:38:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E5C60EAD93; Wed, 6 Jul 2016 06:38:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mithmatt@apache.org To: commits@ambari.apache.org Date: Wed, 06 Jul 2016 06:38:42 -0000 Message-Id: In-Reply-To: <1873e2e8dcff4fe8906a915743e2909f@git.apache.org> References: <1873e2e8dcff4fe8906a915743e2909f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [14/17] ambari git commit: AMBARI-16647: Move service advisor tests for HAWQ and PXF (Lav Jain via mithmatt) archived-at: Wed, 06 Jul 2016 06:38:35 -0000 http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/common-services/configs/services-nohawq-3-hosts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/common-services/configs/services-nohawq-3-hosts.json b/ambari-server/src/test/python/common-services/configs/services-nohawq-3-hosts.json new file mode 100644 index 0000000..58a5f2c --- /dev/null +++ b/ambari-server/src/test/python/common-services/configs/services-nohawq-3-hosts.json @@ -0,0 +1,160 @@ +{ + "href" : "/api/v1/stacks/HDP/versions/2.3/?fields=Versions/stack_name,Versions/stack_version,Versions/parent_stack_version,services/StackServices/service_name,services/StackServices/service_version,services/components/StackServiceComponents,services/components/dependencies,services/components/auto_deploy,services/configurations/StackConfigurations/property_depends_on,services/configurations/dependencies/StackConfigurationDependency/dependency_name,services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type&services/StackServices/service_name.in(HDFS,ZOOKEEPER)", + "Versions" : { + "parent_stack_version" : "2.2", + "stack_name" : "HDP", + "stack_version" : "2.3", + "stack_hierarchy" : { + "stack_name" : "HDP", + "stack_versions" : [ "2.2", "2.1", "2.0.6" ] + } + }, + "services" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS", + "StackServices" : { + "service_name" : "HDFS", + "service_version" : "2.7.1.2.3", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/DATANODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "DATANODE", + "custom_commands" : [ ], + "display_name" : "DataNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/HDFS_CLIENT", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "CLIENT", + "component_name" : "HDFS_CLIENT", + "custom_commands" : [ ], + "display_name" : "HDFS Client", + "is_client" : true, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "JOURNALNODE", + "custom_commands" : [ ], + "display_name" : "JournalNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "JOURNALNODE", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1-2", + "component_category" : "MASTER", + "component_name" : "NAMENODE", + "custom_commands" : [ "DECOMMISSION", "REBALANCEHDFS" ], + "display_name" : "NameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "NFS_GATEWAY", + "custom_commands" : [ ], + "display_name" : "NFSGateway", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "NFS_GATEWAY", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/SECONDARY_NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "SECONDARY_NAMENODE", + "custom_commands" : [ ], + "display_name" : "SNameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/ZKFC", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "ZKFC", + "custom_commands" : [ ], + "display_name" : "ZKFailoverController", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ ] + } ] + } ], + "configurations" : { } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/common-services/configs/services-normal-hawq-3-hosts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/common-services/configs/services-normal-hawq-3-hosts.json b/ambari-server/src/test/python/common-services/configs/services-normal-hawq-3-hosts.json new file mode 100644 index 0000000..b896a71 --- /dev/null +++ b/ambari-server/src/test/python/common-services/configs/services-normal-hawq-3-hosts.json @@ -0,0 +1,521 @@ +{ + "href" : "/api/v1/stacks/HDP/versions/2.3/?fields=Versions/stack_name,Versions/stack_version,Versions/parent_stack_version,services/StackServices/service_name,services/StackServices/service_version,services/components/StackServiceComponents,services/components/dependencies,services/components/auto_deploy,services/configurations/StackConfigurations/property_depends_on,services/configurations/dependencies/StackConfigurationDependency/dependency_name,services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type&services/StackServices/service_name.in(HDFS,ZOOKEEPER,HAWQ)", + "Versions" : { + "parent_stack_version" : "2.2", + "stack_name" : "HDP", + "stack_version" : "2.3", + "stack_hierarchy" : { + "stack_name" : "HDP", + "stack_versions" : [ "2.2", "2.1", "2.0.6" ] + } + }, + "services" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ", + "StackServices" : { + "service_name" : "HAWQ", + "service_version" : "2.0", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "HAWQMASTER", + "custom_commands" : [ ], + "display_name" : "HAWQ Master", + "is_client" : false, + "is_master" : true, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "HAWQMASTER", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER/dependencies/NAMENODE", + "Dependencies" : { + "component_name" : "NAMENODE", + "dependent_component_name" : "HAWQMASTER", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSEGMENT", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "HAWQSEGMENT", + "custom_commands" : [ ], + "display_name" : "HAWQ Segment", + "is_client" : false, + "is_master" : false, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSEGMENT/dependencies/DATANODE", + "Dependencies" : { + "component_name" : "DATANODE", + "dependent_component_name" : "HAWQSEGMENT", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSTANDBY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0-1", + "component_category" : "MASTER", + "component_name" : "HAWQSTANDBY", + "custom_commands" : [ ], + "display_name" : "HAWQ Standby Master", + "is_client" : false, + "is_master" : true, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSTANDBY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "HAWQSTANDBY", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + } ], + "configurations" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/content", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "content", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-check-env.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_dfs_url", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_dfs_url", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_address_host", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_address_host", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_address_port", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_address_port", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_temp_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_temp_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cgroup_hierarchy_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cgroup_hierarchy_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cgroup_mount_point", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cgroup_mount_point", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cleanup_period", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cleanup_period", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cpu_enable", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cpu_enable", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cpu_weight", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cpu_weight", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_vcore_pcore_ratio", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_vcore_pcore_ratio", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_nvcore_limit_perseg", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_nvcore_limit_perseg", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_memory_limit_perseg", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_memory_limit_perseg", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_resourcemanager_server_type", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_resourcemanager_server_type", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_app_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_app_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_queue_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_queue_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_address", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_address", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_scheduler_address", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_scheduler_address", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_address_port", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_address_port", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_temp_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_temp_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_standby_address_host", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_standby_address_host", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/default_segment_num", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "default_segment_num", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS", + "StackServices" : { + "service_name" : "HDFS", + "service_version" : "2.7.1.2.3", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/DATANODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "DATANODE", + "custom_commands" : [ ], + "display_name" : "DataNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/HDFS_CLIENT", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "CLIENT", + "component_name" : "HDFS_CLIENT", + "custom_commands" : [ ], + "display_name" : "HDFS Client", + "is_client" : true, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "JOURNALNODE", + "custom_commands" : [ ], + "display_name" : "JournalNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "JOURNALNODE", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1-2", + "component_category" : "MASTER", + "component_name" : "NAMENODE", + "custom_commands" : [ "DECOMMISSION", "REBALANCEHDFS" ], + "display_name" : "NameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "NFS_GATEWAY", + "custom_commands" : [ ], + "display_name" : "NFSGateway", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "NFS_GATEWAY", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/SECONDARY_NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "SECONDARY_NAMENODE", + "custom_commands" : [ ], + "display_name" : "SNameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/ZKFC", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "ZKFC", + "custom_commands" : [ ], + "display_name" : "ZKFailoverController", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + } ] + } ], + "configurations" : { } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/common-services/configs/services-normal-nohawq-3-hosts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/common-services/configs/services-normal-nohawq-3-hosts.json b/ambari-server/src/test/python/common-services/configs/services-normal-nohawq-3-hosts.json new file mode 100644 index 0000000..675aacb --- /dev/null +++ b/ambari-server/src/test/python/common-services/configs/services-normal-nohawq-3-hosts.json @@ -0,0 +1,160 @@ +{ + "href" : "/api/v1/stacks/HDP/versions/2.3/?fields=Versions/stack_name,Versions/stack_version,Versions/parent_stack_version,services/StackServices/service_name,services/StackServices/service_version,services/components/StackServiceComponents,services/components/dependencies,services/components/auto_deploy,services/configurations/StackConfigurations/property_depends_on,services/configurations/dependencies/StackConfigurationDependency/dependency_name,services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type&services/StackServices/service_name.in(HDFS,ZOOKEEPER)", + "Versions" : { + "parent_stack_version" : "2.2", + "stack_name" : "HDP", + "stack_version" : "2.3", + "stack_hierarchy" : { + "stack_name" : "HDP", + "stack_versions" : [ "2.2", "2.1", "2.0.6" ] + } + }, + "services" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS", + "StackServices" : { + "service_name" : "HDFS", + "service_version" : "2.7.1.2.3", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/DATANODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "DATANODE", + "custom_commands" : [ ], + "display_name" : "DataNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/HDFS_CLIENT", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "CLIENT", + "component_name" : "HDFS_CLIENT", + "custom_commands" : [ ], + "display_name" : "HDFS Client", + "is_client" : true, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "JOURNALNODE", + "custom_commands" : [ ], + "display_name" : "JournalNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "JOURNALNODE", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1-2", + "component_category" : "MASTER", + "component_name" : "NAMENODE", + "custom_commands" : [ "DECOMMISSION", "REBALANCEHDFS" ], + "display_name" : "NameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "NFS_GATEWAY", + "custom_commands" : [ ], + "display_name" : "NFSGateway", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "NFS_GATEWAY", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/SECONDARY_NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "SECONDARY_NAMENODE", + "custom_commands" : [ ], + "display_name" : "SNameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/ZKFC", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "ZKFC", + "custom_commands" : [ ], + "display_name" : "ZKFailoverController", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + } ] + } ], + "configurations" : { } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/common-services/configs/services-standby_ambari_colo-3-hosts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/common-services/configs/services-standby_ambari_colo-3-hosts.json b/ambari-server/src/test/python/common-services/configs/services-standby_ambari_colo-3-hosts.json new file mode 100644 index 0000000..489d4df --- /dev/null +++ b/ambari-server/src/test/python/common-services/configs/services-standby_ambari_colo-3-hosts.json @@ -0,0 +1,510 @@ +{ + "href" : "/api/v1/stacks/HDP/versions/2.3/?fields=Versions/stack_name,Versions/stack_version,Versions/parent_stack_version,services/StackServices/service_name,services/StackServices/service_version,services/components/StackServiceComponents,services/components/dependencies,services/components/auto_deploy,services/configurations/StackConfigurations/property_depends_on,services/configurations/dependencies/StackConfigurationDependency/dependency_name,services/configurations/dependencies/StackConfigurationDependency/dependency_type,services/configurations/StackConfigurations/type&services/StackServices/service_name.in(HDFS,ZOOKEEPER,HAWQ)", + "Versions" : { + "parent_stack_version" : "2.2", + "stack_name" : "HDP", + "stack_version" : "2.3", + "stack_hierarchy" : { + "stack_name" : "HDP", + "stack_versions" : [ "2.2", "2.1", "2.0.6" ] + } + }, + "services" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ", + "StackServices" : { + "service_name" : "HAWQ", + "service_version" : "2.0", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "HAWQMASTER", + "custom_commands" : [ ], + "display_name" : "HAWQ Master", + "is_client" : false, + "is_master" : true, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "HAWQMASTER", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQMASTER/dependencies/NAMENODE", + "Dependencies" : { + "component_name" : "NAMENODE", + "dependent_component_name" : "HAWQMASTER", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSEGMENT", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "HAWQSEGMENT", + "custom_commands" : [ ], + "display_name" : "HAWQ Segment", + "is_client" : false, + "is_master" : false, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSEGMENT/dependencies/DATANODE", + "Dependencies" : { + "component_name" : "DATANODE", + "dependent_component_name" : "HAWQSEGMENT", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSTANDBY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0-1", + "component_category" : "MASTER", + "component_name" : "HAWQSTANDBY", + "custom_commands" : [ ], + "display_name" : "HAWQ Standby Master", + "is_client" : false, + "is_master" : true, + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/components/HAWQSTANDBY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "HAWQSTANDBY", + "dependent_service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + } ], + "configurations" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/content", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "content", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-check-env.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_dfs_url", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_dfs_url", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_address_host", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_address_host", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_address_port", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_address_port", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_master_temp_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_master_temp_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cgroup_hierarchy_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cgroup_hierarchy_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cgroup_mount_point", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cgroup_mount_point", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cpu_weight", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cpu_weight", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cpu_enable", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cpu_enable", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_cpu_weight", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_cpu_weight", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_re_vcore_pcore_ratio", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_re_vcore_pcore_ratio", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_nvcore_limit_perseg", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_nvcore_limit_perseg", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_memory_limit_perseg", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_memory_limit_perseg", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_resourcemanager_server_type", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_resourcemanager_server_type", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_app_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_app_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_queue_name", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_queue_name", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_address", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_address", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_rm_yarn_scheduler_address", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_rm_yarn_scheduler_address", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_address_port", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_address_port", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_segment_temp_directory", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_segment_temp_directory", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HAWQ/configurations/hawq_standby_address_host", + "StackConfigurations" : { + "property_depends_on" : [ ], + "property_name" : "hawq_standby_address_host", + "service_name" : "HAWQ", + "stack_name" : "HDP", + "stack_version" : "2.3", + "type" : "hawq-site.xml" + }, + "dependencies" : [ ] + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS", + "StackServices" : { + "service_name" : "HDFS", + "service_version" : "2.7.1.2.3", + "stack_name" : "HDP", + "stack_version" : "2.3" + }, + "components" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/DATANODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "SLAVE", + "component_name" : "DATANODE", + "custom_commands" : [ ], + "display_name" : "DataNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/HDFS_CLIENT", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1+", + "component_category" : "CLIENT", + "component_name" : "HDFS_CLIENT", + "custom_commands" : [ ], + "display_name" : "HDFS Client", + "is_client" : true, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "JOURNALNODE", + "custom_commands" : [ ], + "display_name" : "JournalNode", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/JOURNALNODE/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "JOURNALNODE", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1-2", + "component_category" : "MASTER", + "component_name" : "NAMENODE", + "custom_commands" : [ "DECOMMISSION", "REBALANCEHDFS" ], + "display_name" : "NameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6401.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "NFS_GATEWAY", + "custom_commands" : [ ], + "display_name" : "NFSGateway", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ ] + }, + "dependencies" : [ { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/NFS_GATEWAY/dependencies/HDFS_CLIENT", + "Dependencies" : { + "component_name" : "HDFS_CLIENT", + "dependent_component_name" : "NFS_GATEWAY", + "dependent_service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3" + } + } ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/SECONDARY_NAMENODE", + "StackServiceComponents" : { + "advertise_version" : true, + "cardinality" : "1", + "component_category" : "MASTER", + "component_name" : "SECONDARY_NAMENODE", + "custom_commands" : [ ], + "display_name" : "SNameNode", + "is_client" : false, + "is_master" : true, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6402.ambari.apache.org" ] + }, + "dependencies" : [ ] + }, { + "href" : "/api/v1/stacks/HDP/versions/2.3/services/HDFS/components/ZKFC", + "StackServiceComponents" : { + "advertise_version" : false, + "cardinality" : "0+", + "component_category" : "SLAVE", + "component_name" : "ZKFC", + "custom_commands" : [ ], + "display_name" : "ZKFailoverController", + "is_client" : false, + "is_master" : false, + "service_name" : "HDFS", + "stack_name" : "HDP", + "stack_version" : "2.3", + "hostnames" : [ "c6403.ambari.apache.org" ] + }, + "dependencies" : [ ] + } ] + } ], + "configurations" : { } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_component_status.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_component_status.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_component_status.py deleted file mode 100644 index b2e1d4d..0000000 --- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_component_status.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python - -''' -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -''' - -# System imports -import os -import sys - -from mock.mock import patch - -# Local imports -from stacks.utils.RMFTestCase import * - -COMMON_SERVICES_ALERTS_DIR = "HAWQ/2.0.0/package/alerts" - -file_path = os.path.dirname(os.path.abspath(__file__)) -file_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(file_path))))) -file_path = os.path.join(file_path, "main", "resources", "common-services", COMMON_SERVICES_ALERTS_DIR) - -WORKING_CONFIGS = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_segment_address_port}}": "40000", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - -class TestAlertComponentStatus(RMFTestCase): - - def setUp(self): - """ - Import the class under test. - Because the class is present in a different folder, append its dir to the system path. - Also, shorten the import name and make it a global so the test functions can access it. - :return: - """ - sys.path.append(file_path) - global alert_component_status - import alert_component_status - - def test_missing_configs(self): - """ - Check that the status is UNKNOWN when configs are missing. - """ - configs = None - [status, messages] = alert_component_status.execute(configurations=configs) - self.assertEqual(status, alert_component_status.RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'There were no configurations supplied to the script.') - - @patch("alert_component_status.is_component_running") - def test_hawq_master_ok(self, is_component_running_mock): - """ - Test that the status is OK when HAWQ Master is up - """ - # Mock calls - is_component_running_mock.return_value = True - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'master'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Master is running') - - @patch("alert_component_status.is_component_running") - def test_hawq_master_critical(self, is_component_running_mock): - """ - Test that the status is CRITICIAL when HAWQ Master is down - """ - # Mock calls - is_component_running_mock.return_value = False - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'master'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_CRITICAL) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Master is not running') - - @patch("alert_component_status.is_component_running") - def test_hawq_standby_ok(self, is_component_running_mock): - """ - Test that the status is OK when HAWQ Standby is up - """ - # Mock calls - is_component_running_mock.return_value = True - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'standby'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Standby is running') - - @patch("alert_component_status.is_component_running") - def test_hawq_standby_critical(self, is_component_running_mock): - """ - Test that the status is CRITICIAL when HAWQ Standby is down - """ - # Mock calls - is_component_running_mock.return_value = False - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'standby'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_CRITICAL) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Standby is not running') - - @patch("alert_component_status.is_component_running") - def test_hawq_segment_ok(self, is_component_running_mock): - """ - Test that the status is OK when HAWQ Segment is up - """ - # Mock calls - is_component_running_mock.return_value = True - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'segment'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Segment is running') - - @patch("alert_component_status.is_component_running") - def test_hawq_segment_critical(self, is_component_running_mock): - """ - Test that the status is CRITICIAL when HAWQ Segment is down - """ - # Mock calls - is_component_running_mock.return_value = False - - [status, messages] = alert_component_status.execute(configurations=WORKING_CONFIGS, parameters={'component_name': 'segment'}) - self.assertEqual(status, alert_component_status.RESULT_STATE_CRITICAL) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Segment is not running') http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_segment_registration_status.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_segment_registration_status.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_segment_registration_status.py deleted file mode 100644 index 6bb5930..0000000 --- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_segment_registration_status.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python - -''' -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -''' - -# System imports -import os -import sys -from resource_management.core.shell import call -from mock.mock import patch - -# Local imports -from stacks.utils.RMFTestCase import * - -COMMON_SERVICES_ALERTS_DIR = "HAWQ/2.0.0/package/alerts" - -file_path = os.path.dirname(os.path.abspath(__file__)) -file_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(file_path))))) -file_path = os.path.join(file_path, "main", "resources", "common-services", COMMON_SERVICES_ALERTS_DIR) - -RESULT_STATE_OK = 'OK' -RESULT_STATE_WARNING = 'WARNING' -RESULT_STATE_UNKNOWN = 'UNKNOWN' -RESULT_STATE_SKIPPED = 'SKIPPED' - -class TestAlertRegistrationStatus(RMFTestCase): - - HOST_LIST_A = ['HOST1','HOST2','HOST3','HOST4'] - HOST_LIST_B = ['HOST1','HOST3','HOST5','HOST4'] - HOST_LIST_C = ['HOST1','HOST2','HOST3'] - - def setUp(self): - """ - Import the class under test. - Because the class is present in a different folder, append its dir to the system path. - Also, shorten the import name and make it a global so the test functions can access it. - :return: - """ - sys.path.append(file_path) - global alert_segment_registration_status - import alert_segment_registration_status - - def test_missing_configs(self): - """ - Check if the status is UNKNOWN when configs are missing. - """ - configs = None - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'There were no configurations supplied to the script.') - - @patch("os.path.isfile", return_value=False) - def test_missing_slave_file(self, os_path_file_mock): - """ - Check if the status is SKIPPED when slaves file is missing. - """ - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_SKIPPED) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'Slaves file is not present in /usr/local/hawq/etc') - - @patch("alert_segment_registration_status.get_segment_list_db") - @patch("alert_segment_registration_status.get_segment_list_ambari") - @patch("os.path.isfile", return_value=True) - def test_successful_registration_status(self, os_path_isfile_mock, get_segment_list_ambari_mock, get_segment_list_db_mock): - """ - Check if the status is OK if no difference in registration segment number and slaves count. - """ - get_segment_list_ambari_mock.return_value=self.HOST_LIST_A - get_segment_list_db_mock.return_value=self.HOST_LIST_A - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'All HAWQ Segments are registered.') - - @patch("alert_segment_registration_status.get_segment_list_db") - @patch("alert_segment_registration_status.get_segment_list_ambari") - @patch("os.path.isfile", return_value=True) - def test_unsuccessful_registration_status_plural(self, os_path_isfile_mock, get_segment_list_ambari_mock, get_segment_list_db_mock): - """ - Check if the status is WARNING if a difference is present in registration segment number and slaves count. - """ - get_segment_list_ambari_mock.return_value=self.HOST_LIST_A - get_segment_list_db_mock.return_value=self.HOST_LIST_B - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_WARNING) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], '2 HAWQ Segments are not registered with HAWQ Master. Try restarting HAWQ service if a segment has been added/removed. Check the log file in /var/log/ambari-agent/ambari-alerts.log for more details on unregistered hosts.') - - @patch("alert_segment_registration_status.get_segment_list_db") - @patch("alert_segment_registration_status.get_segment_list_ambari") - @patch("os.path.isfile", return_value=True) - def test_unsuccessful_registration_status(self, os_path_isfile_mock, get_segment_list_ambari_mock, get_segment_list_db_mock): - """ - Check if the status is WARNING if a difference is present in registration segment number and slaves count. - """ - get_segment_list_ambari_mock.return_value=self.HOST_LIST_A - get_segment_list_db_mock.return_value=self.HOST_LIST_C - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_WARNING) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], '1 HAWQ Segment is not registered with HAWQ Master. Try restarting HAWQ service if a segment has been added/removed. Check the log file in /var/log/ambari-agent/ambari-alerts.log for more details on unregistered hosts.') - - @patch("alert_segment_registration_status.get_segment_list_db") - @patch("alert_segment_registration_status.get_segment_list_ambari") - @patch("os.path.isfile", return_value=True) - def test_exception_registration_status(self, os_path_isfile_mock, get_segment_list_ambari_mock, get_segment_list_db_mock): - """ - Check if the status is UNKNOWN if an exception is thrown when finding registration segment number and slaves count. - """ - get_segment_list_ambari_mock.return_value=self.HOST_LIST_A - get_segment_list_db_mock.side_effect=Exception("Exception raised to fail") - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQ Segments Registration Status cannot be determined.') - - @patch("alert_segment_registration_status.get_segment_list_db") - @patch("alert_segment_registration_status.get_segment_list_ambari") - @patch("os.path.isfile", return_value=True) - def test_unsuccessful_empty_db_registration_status(self, os_path_isfile_mock, get_segment_list_ambari_mock, get_segment_list_db_mock): - """ - Check if the status is WARNING if a difference is present in registration segment number and slaves count. - """ - get_segment_list_ambari_mock.return_value=[] - get_segment_list_db_mock.return_value=self.HOST_LIST_C - configs={ - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - [status, messages] = alert_segment_registration_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_WARNING) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], '3 HAWQ Segments are not registered with HAWQ Master. Try restarting HAWQ service if a segment has been added/removed. Check the log file in /var/log/ambari-agent/ambari-alerts.log for more details on unregistered hosts.') - http://git-wip-us.apache.org/repos/asf/ambari/blob/de5110ec/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_sync_status.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_sync_status.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_sync_status.py deleted file mode 100644 index fd4f474..0000000 --- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_alert_sync_status.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python - -''' -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -''' - -# System imports -import os -import sys - -from mock.mock import patch - -# Local imports -from stacks.utils.RMFTestCase import * - -COMMON_SERVICES_ALERTS_DIR = "HAWQ/2.0.0/package/alerts" - -file_path = os.path.dirname(os.path.abspath(__file__)) -file_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(file_path))))) -file_path = os.path.join(file_path, "main", "resources", "common-services", COMMON_SERVICES_ALERTS_DIR) - -RESULT_STATE_OK = 'OK' -RESULT_STATE_WARNING = 'WARNING' -RESULT_STATE_UNKNOWN = 'UNKNOWN' -RESULT_STATE_SKIPPED = 'SKIPPED' - -class TestAlertSyncStatus(RMFTestCase): - - def setUp(self): - """ - Import the class under test. - Because the class is present in a different folder, append its dir to the system path. - Also, shorten the import name and make it a global so the test functions can access it. - :return: - """ - sys.path.append(file_path) - global alert_sync_status - import alert_sync_status - - def test_missing_configs(self): - """ - Check that the status is UNKNOWN when configs are missing. - """ - configs = None - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'There were no configurations supplied to the script.') - - - @patch("alert_sync_status.get_sync_status") - def test_no_standby_state(self, get_sync_status_mock): - """ - Test that the status is SKIPPED when HAWQSTANDBY is not in configurations - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432" - } - - # Mock calls - get_sync_status_mock.return_value = 'Not Configured' - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_SKIPPED) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQSTANDBY is not installed.') - - - @patch("alert_sync_status.get_sync_status") - def test_synchronized_state(self, get_sync_status_mock): - """ - Test that the status is OK when HAWQSTANDBY is 'Synchronized' with HAWQMASTER - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = ('Synchronized', "") - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQSTANDBY is in sync with HAWQMASTER.') - - - @patch("alert_sync_status.get_sync_status") - def test_synchronizing_state(self, get_sync_status_mock): - """ - Test that the status is OK when HAWQSTANDBY is 'Synchronizing' with HAWQMASTER - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = ('Synchronizing', "") - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_OK) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQSTANDBY is in sync with HAWQMASTER.') - - - @patch("alert_sync_status.get_sync_status") - def test_not_synchronized_state(self, get_sync_status_mock): - """ - Test that the status is WARNING when HAWQSTANDBY is 'Noe Synchronized' with HAWQMASTER - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = ('Not Synchronized', "ERROR_MESSAGE") - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_WARNING) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'HAWQSTANDBY is not in sync with HAWQMASTER. ERROR: ERROR_MESSAGE') - - - @patch("alert_sync_status.get_sync_status") - def test_none_state(self, get_sync_status_mock): - """ - Test that the status is UNKNOWN when HAWQMASTER returns summary_state as 'None' - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = 'None' - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'Sync status cannot be determined.') - - - @patch("alert_sync_status.get_sync_status") - def test_not_configured_state(self, get_sync_status_mock): - """ - Test that the status is UNKNOWN when HAWQMASTER returns summary_state as 'Not Configured' - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = 'Not Configured' - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'Sync status cannot be determined.') - - - @patch("alert_sync_status.get_sync_status") - def test_unknown_state(self, get_sync_status_mock): - """ - Test that the status is UNKNOWN when HAWQMASTER returns summary_state as 'Unknown' - """ - configs = { - "{{hawq-site/hawq_master_address_port}}": "5432", - "{{hawq-site/hawq_standby_address_host}}": "c6402.ambari.apache.org" - } - - # Mock calls - get_sync_status_mock.return_value = 'Unknown' - - [status, messages] = alert_sync_status.execute(configurations=configs) - self.assertEqual(status, RESULT_STATE_UNKNOWN) - self.assertTrue(messages is not None and len(messages) == 1) - self.assertEqual(messages[0], 'Sync status cannot be determined.')