ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-14185. Zookeeper service check failing.(vbrodetskyi)
Date Thu, 03 Dec 2015 23:48:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 19194e0b2 -> 12f70d99c


AMBARI-14185. Zookeeper service check failing.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 12f70d99cd6a391aa96347188c03048f9651e954
Parents: 19194e0
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Thu Dec 3 22:49:20 2015 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Thu Dec 3 22:50:16 2015 +0200

----------------------------------------------------------------------
 .../ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh     |  2 +-
 .../3.4.5.2.0/package/scripts/params_linux.py        |  2 ++
 .../3.4.5.2.0/package/scripts/service_check.py       |  6 +++++-
 .../2.0.6/ZOOKEEPER/test_zookeeper_service_check.py  | 15 ++++++++++++---
 4 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/12f70d99/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh
index 6838cef..4d1562e 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh
@@ -28,8 +28,8 @@ security_enabled=$5
 kinit_path_local=$6
 smoke_user_keytab=$7
 smokeuser_principal=$8
+test_output_file=$9
 export ZOOKEEPER_EXIT_CODE=0
-test_output_file=/tmp/zkSmoke.out
 errors_expr="ERROR|Exception"
 acceptable_expr="SecurityException"
 zkhosts=` grep "^\s*server\.[[:digit:]]"  $conf_dir/zoo.cfg  | cut -f 2 -d '=' | cut -f 1
-d ':' | tr '\n' ' ' `

http://git-wip-us.apache.org/repos/asf/ambari/blob/12f70d99/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
index 3ef0a8c..c6264ff 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
@@ -19,6 +19,7 @@ Ambari Agent
 
 """
 import status_params
+import os
 
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions.version import format_hdp_stack_version
@@ -45,6 +46,7 @@ zk_home = "/usr"
 zk_bin = "/usr/lib/zookeeper/bin"
 zk_cli_shell = "/usr/lib/zookeeper/bin/zkCli.sh"
 config_dir = "/etc/zookeeper/conf"
+zk_smoke_out = os.path.join(tmp_dir, "zkSmoke.out")
 
 # hadoop parameters for 2.2+
 if Script.is_hdp_stack_greater_or_equal("2.2"):

http://git-wip-us.apache.org/repos/asf/ambari/blob/12f70d99/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
index b601c58..b53e5f5 100644
--- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py
@@ -32,6 +32,10 @@ class ZookeeperServiceCheckLinux(ZookeeperServiceCheck):
     import params
     env.set_params(params)
 
+    File(params.zk_smoke_out,
+         action="delete"
+    )
+
     File(format("{tmp_dir}/zkSmoke.sh"),
          mode=0755,
          content=StaticFile('zkSmoke.sh')
@@ -46,7 +50,7 @@ class ZookeeperServiceCheckLinux(ZookeeperServiceCheck):
 
 
     cmd_quorum = format("{tmp_dir}/zkSmoke.sh {zk_cli_shell} {smokeuser} {config_dir} {client_port}
"
-                  "{security_enabled} {kinit_path_local} {smokeUserKeytab} {smokeUserPrincipal}")
+                  "{security_enabled} {kinit_path_local} {smokeUserKeytab} {smokeUserPrincipal}
{zk_smoke_out}")
 
     Execute(cmd_quorum,
             tries=3,

http://git-wip-us.apache.org/repos/asf/ambari/blob/12f70d99/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py
b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py
index 01941b8..bb6570a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_service_check.py
@@ -32,11 +32,14 @@ class TestServiceCheck(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('File', '/tmp/zkSmoke.out',
+                              action=['delete']
+    )
     self.assertResourceCalled('File', '/tmp/zkSmoke.sh',
                        content = StaticFile('zkSmoke.sh'),
                        mode = 0755,
     )
-    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh
ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab no_principal',
+    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh
ambari-qa /etc/zookeeper/conf 2181 False /usr/bin/kinit no_keytab no_principal /tmp/zkSmoke.out',
                        logoutput = True,
                        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                        tries = 3,
@@ -52,11 +55,14 @@ class TestServiceCheck(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('File', '/tmp/zkSmoke.out',
+                              action=['delete']
+    )
     self.assertResourceCalled('File', '/tmp/zkSmoke.sh',
                        content = StaticFile('zkSmoke.sh'),
                        mode = 0755,
     )
-    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh
ambari-qa /etc/zookeeper/conf 2181 True /usr/bin/kinit /etc/security/keytabs/smokeuser.headless.keytab
ambari-qa@EXAMPLE.COM',
+    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/lib/zookeeper/bin/zkCli.sh
ambari-qa /etc/zookeeper/conf 2181 True /usr/bin/kinit /etc/security/keytabs/smokeuser.headless.keytab
ambari-qa@EXAMPLE.COM /tmp/zkSmoke.out',
                        logoutput = True,
                        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                        tries = 3,
@@ -72,11 +78,14 @@ class TestServiceCheck(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('File', '/tmp/zkSmoke.out',
+                              action=['delete']
+    )
     self.assertResourceCalled('File', '/tmp/zkSmoke.sh',
                        content = StaticFile('zkSmoke.sh'),
                        mode = 0755,
     )
-    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/hdp/current/zookeeper-client/bin/zkCli.sh
ambari-qa /usr/hdp/current/zookeeper-client/conf 2181 False /usr/bin/kinit no_keytab no_principal',
+    self.assertResourceCalled('Execute', '/tmp/zkSmoke.sh /usr/hdp/current/zookeeper-client/bin/zkCli.sh
ambari-qa /usr/hdp/current/zookeeper-client/conf 2181 False /usr/bin/kinit no_keytab no_principal
/tmp/zkSmoke.out',
                        logoutput = True,
                        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                        tries = 3,


Mime
View raw message