Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 57DED180B9 for ; Thu, 7 Jan 2016 00:38:48 +0000 (UTC) Received: (qmail 76187 invoked by uid 500); 7 Jan 2016 00:38:48 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 76150 invoked by uid 500); 7 Jan 2016 00:38:48 -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 76139 invoked by uid 99); 7 Jan 2016 00:38:48 -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; Thu, 07 Jan 2016 00:38:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0F741DFDC7; Thu, 7 Jan 2016 00:38:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaoki@apache.org To: commits@ambari.apache.org Date: Thu, 07 Jan 2016 00:38:48 -0000 Message-Id: <92dff31137b54e62b7af69bb6943479c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/4] ambari git commit: AMBARI-14301: Co-locate HAWQSEGMENT on hosts that have DATANODE component (lavjain via jaoki) Repository: ambari Updated Branches: refs/heads/branch-2.2 8715004ac -> d45c16b12 http://git-wip-us.apache.org/repos/asf/ambari/blob/d45c16b1/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py index 7d95d24..baf3180 100644 --- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py @@ -155,7 +155,7 @@ class TestHDP23StackAdvisor(TestCase): def test_createComponentLayoutRecommendations_pxf_co_locate_with_namenode_or_datanode(self): """ Test that PXF gets recommended on same host group which has NAMENODE or DATANODE""" - services = self.load_json("services-pxf-hdfs.json") + services = self.load_json("services-hawq-pxf-hdfs.json") hosts = self.load_json("hosts-3-hosts.json") recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts) @@ -165,6 +165,19 @@ class TestHDP23StackAdvisor(TestCase): self.assertTrue("PXF" in component_names) + def test_hawqsegmentDatanode(self): + """ Test that HAWQSegment gets recommended on same host group which has DATANODE""" + + services = self.load_json("services-hawq-pxf-hdfs.json") + hosts = self.load_json("hosts-3-hosts.json") + recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts) + + for hostgroup in recommendations["blueprint"]["host_groups"]: + component_names = [component["name"] for component in hostgroup["components"]] + if 'DATANODE' in component_names: + self.assertTrue('HAWQSEGMENT' in component_names) + + def fqdn_mock_result(value=None): return 'c6401.ambari.apache.org' if value is None else value