ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-11783. Hive service check failed during Rolling upgrade due to JAVA_HOME not set (ncole)
Date Mon, 08 Jun 2015 17:07:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d64cf1ffe -> ce33632aa


AMBARI-11783. Hive service check failed during Rolling upgrade due to JAVA_HOME not set (ncole)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ce33632a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ce33632a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ce33632a

Branch: refs/heads/trunk
Commit: ce33632aa1aab77a40ba711928b2b0576b8efbc6
Parents: d64cf1f
Author: Nate Cole <ncole@hortonworks.com>
Authored: Mon Jun 8 08:04:52 2015 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Mon Jun 8 13:03:58 2015 -0400

----------------------------------------------------------------------
 .../libraries/functions/hdp_select.py           |  5 +--
 .../2.0.6/HIVE/test_hive_service_check.py       | 36 +++++++++++++++++++-
 2 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ce33632a/ambari-common/src/main/python/resource_management/libraries/functions/hdp_select.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/hdp_select.py
b/ambari-common/src/main/python/resource_management/libraries/functions/hdp_select.py
index 668c8b1..4a24301 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/hdp_select.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/hdp_select.py
@@ -69,7 +69,8 @@ SERVER_ROLE_DIRECTORY_MAP = {
 SERVICE_CHECK_DIRECTORY_MAP = {
   "HDFS_SERVICE_CHECK" : "hadoop-client",
   "TEZ_SERVICE_CHECK" : "hadoop-client",
-  "PIG_SERVICE_CHECK" : "hadoop-client"
+  "PIG_SERVICE_CHECK" : "hadoop-client",
+  "HIVE_SERVICE_CHECK" : "hadoop-client"
 }
 
 # /usr/hdp/current/hadoop-client/[bin|sbin|libexec|lib]
@@ -202,4 +203,4 @@ def _get_upgrade_stack():
   if direction and stack_name and stack_version:
     return (stack_name, stack_version)
 
-  return None
\ No newline at end of file
+  return None

http://git-wip-us.apache.org/repos/asf/ambari/blob/ce33632a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
index 476bd14..5bf85fd 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
@@ -17,11 +17,13 @@ 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.
 '''
+import json
 import os
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 import datetime, sys, socket
-import  resource_management.libraries.functions
+import resource_management.libraries.functions
+
 @patch.object(resource_management.libraries.functions, "get_unique_id_and_date", new = MagicMock(return_value=''))
 @patch("socket.socket")
 @patch("time.time", new=MagicMock(return_value=1431110511.43))
@@ -246,3 +248,35 @@ class TestServiceCheck(RMFTestCase):
         try_sleep = 5,
     )
     self.assertNoMoreResources()
+
+
+  
+  def test_service_check_during_upgrade(self, socket_mock):
+    config_file = self.get_src_folder() + "/test/python/stacks/2.2/configs/hive-upgrade.json"
+    with open(config_file, 'r') as f:
+      json_content = json.load(f)
+
+    json_content['commandParams']['version'] = "2.3.0.0-1234"
+
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
+      classname="HiveServiceCheck",
+      command="service_check",
+      config_dict = json_content,
+      hdp_stack_version = self.STACK_VERSION,
+      target = RMFTestCase.TARGET_COMMON_SERVICES)
+
+    self.assertResourceCalled('Execute', "! beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10010/;transportMode=binary'
-e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'",
+      path = ['/bin/', '/usr/bin/', '/usr/lib/hive/bin/', '/usr/sbin/'],
+      timeout = 30,
+      user = 'ambari-qa')
+
+    self.assertResourceCalled('File', '/tmp/hcatSmoke.sh',
+      content = StaticFile('hcatSmoke.sh'),
+      mode = 0755)
+
+    self.assertResourceCalled('Execute', "env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /tmp/hcatSmoke.sh
hcatsmoke prepare",
+        logoutput = True,
+        path = ['/usr/sbin','/usr/local/bin','/bin','/usr/bin', '/bin:/usr/hdp/current/hadoop-client/bin:/usr/hdp/2.3.0.0-1234/hive/bin'],
+        tries = 3,
+        user = 'ambari-qa',
+        try_sleep = 5)


Mime
View raw message