Explorar o código

AMBARI-16171. Changes to Phoenix QueryServer Kerberos configuration - test fixes (Josh Elser via srimanth)

Srimanth Gunturi %!s(int64=9) %!d(string=hai) anos
pai
achega
d4cce20903

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py

@@ -228,8 +228,8 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
   def get_phoenix_query_server_hosts(self, services, hosts):
     if len(hosts['items']) > 0:
       phoenix_query_server_hosts = self.getHostsWithComponent("HBASE", "PHOENIX_QUERY_SERVER", services, hosts)
-      assert (phoenix_query_server_hosts is not None), "Information about PHOENIX_QUERY_SERVER not found in cluster."
-      host_names = []
+      if phoenix_query_server_hosts is None:
+        return []
       return [host['Hosts']['host_name'] for host in phoenix_query_server_hosts]
 
   def recommendHIVEConfigurations(self, configurations, clusterData, services, hosts):

+ 17 - 1
ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py

@@ -5112,7 +5112,7 @@ class TestHDP25StackAdvisor(TestCase):
 
 
 
-def test_recommendAtlasConfigurations(self):
+  def test_recommendAtlasConfigurations(self):
     self.maxDiff = None
     configurations = {
       "application-properties": {
@@ -5285,6 +5285,11 @@ def test_recommendAtlasConfigurations(self):
             }
           ]
         },
+        {
+          "StackServices": {
+            "service_name": "KERBEROS",
+          },
+        },
       ],
       "configurations": configurations,
       "changed-configurations": [ ]
@@ -5404,6 +5409,11 @@ def test_recommendAtlasConfigurations(self):
             }
           ]
         },
+        {
+          "StackServices": {
+            "service_name": "KERBEROS",
+          },
+        },
       ],
       "configurations": configurations,
       "changed-configurations": [ ]
@@ -5455,6 +5465,7 @@ def test_recommendAtlasConfigurations(self):
 
     self.assertTrue('core-site' in configurations)
     self.assertTrue('properties' in configurations['core-site'])
+    self.assertTrue('hadoop.proxyuser.HTTP.hosts' in configurations['core-site']['properties'])
     # Avoid an unnecessary sort in the stack advisor, sort here for easy comparison
     actualHosts = configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
     expectedHosts = configurations['core-site']['properties']['hadoop.proxyuser.HTTP.hosts']
@@ -5525,6 +5536,11 @@ def test_recommendAtlasConfigurations(self):
             }
           ]
         },
+        {
+          "StackServices": {
+            "service_name": "KERBEROS",
+          },
+        },
       ],
       "configurations": configurations,
       "changed-configurations": [ ]