Repository: ambari
Updated Branches:
  refs/heads/trunk 746e90d1d -> c96a9e417


http://git-wip-us.apache.org/repos/asf/ambari/blob/c96a9e41/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 67ac25f..aa7688b 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
@@ -152,6 +152,19 @@ class TestHDP23StackAdvisor(TestCase):
     self.assertFalse('HAWQSEGMENT' in recommendedComponents)
 
 
+  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")
+    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 "NAMENODE" in component_names or "DATANODE" in component_names:
+        self.assertTrue("PXF" in component_names)
+
+
   def fqdn_mock_result(value=None):
       return 'c6401.ambari.apache.org' if value is None else value
 

Reply via email to