Repository: ambari
Updated Branches:
  refs/heads/trunk 402f9c73f -> 21984fcc4


AMBARI-16636. Ambari should delete the ambarismoketest table  (aonishuk)


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

Branch: refs/heads/trunk
Commit: 21984fcc430ab57a5de6e96ca398c51fdef9d453
Parents: 402f9c7
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Thu May 12 17:50:18 2016 +0300
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Thu May 12 17:50:18 2016 +0300

----------------------------------------------------------------------
 .../package/files/hbase-smoke-cleanup.sh        | 23 ++++++++++++++++++++
 .../0.96.0.2.0/package/scripts/service_check.py | 12 +++++++---
 .../2.0.6/HBASE/test_hbase_service_check.py     | 18 ++++++++++++---
 3 files changed, 47 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/21984fcc/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbase-smoke-cleanup.sh
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbase-smoke-cleanup.sh
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbase-smoke-cleanup.sh
new file mode 100644
index 0000000..cde19e4
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbase-smoke-cleanup.sh
@@ -0,0 +1,23 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, 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.
+#
+#
+disable 'ambarismoketest'
+drop 'ambarismoketest'
+exit
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/21984fcc/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py
index 6ecb58e..a440c10 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/service_check.py
@@ -48,11 +48,17 @@ class HbaseServiceCheckDefault(HbaseServiceCheck):
     output_file = "/apps/hbase/data/ambarismoketest"
     smokeuser_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} 
{smokeuser_principal};") if params.security_enabled else ""
     hbase_servicecheck_file = format("{exec_tmp_dir}/hbase-smoke.sh")
-  
+    hbase_servicecheck_cleanup_file = 
format("{exec_tmp_dir}/hbase-smoke-cleanup.sh")
+
     File( format("{exec_tmp_dir}/hbaseSmokeVerify.sh"),
       content = StaticFile("hbaseSmokeVerify.sh"),
       mode = 0755
     )
+
+    File(hbase_servicecheck_cleanup_file,
+      content = StaticFile("hbase-smoke-cleanup.sh"),
+      mode = 0755
+    )
   
     File( hbase_servicecheck_file,
       mode = 0755,
@@ -76,8 +82,8 @@ class HbaseServiceCheckDefault(HbaseServiceCheck):
 
     servicecheckcmd = format("{smokeuser_kinit_cmd} {hbase_cmd} --config 
{hbase_conf_dir} shell {hbase_servicecheck_file}")
     smokeverifycmd = format("{exec_tmp_dir}/hbaseSmokeVerify.sh 
{hbase_conf_dir} {service_check_data} {hbase_cmd}")
-  
-    Execute(format("{servicecheckcmd} && {smokeverifycmd}"),
+    cleanupCmd = format("{smokeuser_kinit_cmd} {hbase_cmd} --config 
{hbase_conf_dir} shell {hbase_servicecheck_cleanup_file}")
+    Execute(format("{servicecheckcmd} && {smokeverifycmd} && {cleanupCmd}"),
       tries     = 6,
       try_sleep = 5,
       user = params.smoke_test_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/21984fcc/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py
index 69a6665..f63abac 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_service_check.py
@@ -40,11 +40,15 @@ class TestServiceCheck(RMFTestCase):
       content = StaticFile('hbaseSmokeVerify.sh'),
       mode = 0755,
     )
+    self.assertResourceCalled('File', '/tmp/hbase-smoke-cleanup.sh',
+      content = StaticFile('hbase-smoke-cleanup.sh'),
+      mode = 0755,
+    )
     self.assertResourceCalled('File', '/tmp/hbase-smoke.sh',
       content = Template('hbase-smoke.sh.j2'),
       mode = 0755,
     )
-    self.assertResourceCalled('Execute', ' /usr/lib/hbase/bin/hbase --config 
/etc/hbase/conf shell /tmp/hbase-smoke.sh && /tmp/hbaseSmokeVerify.sh 
/etc/hbase/conf  /usr/lib/hbase/bin/hbase',
+    self.assertResourceCalled('Execute', ' /usr/lib/hbase/bin/hbase --config 
/etc/hbase/conf shell /tmp/hbase-smoke.sh && /tmp/hbaseSmokeVerify.sh 
/etc/hbase/conf  /usr/lib/hbase/bin/hbase &&  /usr/lib/hbase/bin/hbase --config 
/etc/hbase/conf shell /tmp/hbase-smoke-cleanup.sh',
       logoutput = True,
       tries = 6,
       user = 'ambari-qa',
@@ -65,6 +69,10 @@ class TestServiceCheck(RMFTestCase):
       content = StaticFile('hbaseSmokeVerify.sh'),
       mode = 0755,
     )
+    self.assertResourceCalled('File', '/tmp/hbase-smoke-cleanup.sh',
+      content = StaticFile('hbase-smoke-cleanup.sh'),
+      mode = 0755,
+    )
     self.assertResourceCalled('File', '/tmp/hbase-smoke.sh',
       content = Template('hbase-smoke.sh.j2'),
       mode = 0755,
@@ -78,7 +86,7 @@ class TestServiceCheck(RMFTestCase):
     self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/hbase.headless.keytab hbase; /usr/lib/hbase/bin/hbase 
shell /tmp/hbase_grant_permissions.sh',
       user = 'hbase',
     )
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/smokeuser.headless.keytab ambari...@example.com; 
/usr/lib/hbase/bin/hbase --config /etc/hbase/conf shell /tmp/hbase-smoke.sh && 
/tmp/hbaseSmokeVerify.sh /etc/hbase/conf  /usr/lib/hbase/bin/hbase',
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/smokeuser.headless.keytab ambari...@example.com; 
/usr/lib/hbase/bin/hbase --config /etc/hbase/conf shell /tmp/hbase-smoke.sh && 
/tmp/hbaseSmokeVerify.sh /etc/hbase/conf  /usr/lib/hbase/bin/hbase && 
/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab 
ambari...@example.com; /usr/lib/hbase/bin/hbase --config /etc/hbase/conf shell 
/tmp/hbase-smoke-cleanup.sh',
       logoutput = True,
       tries = 6,
       user = 'ambari-qa',
@@ -98,11 +106,15 @@ class TestServiceCheck(RMFTestCase):
       content = StaticFile('hbaseSmokeVerify.sh'),
       mode = 0755,
     )
+    self.assertResourceCalled('File', '/tmp/hbase-smoke-cleanup.sh',
+      content = StaticFile('hbase-smoke-cleanup.sh'),
+      mode = 0755,
+    )
     self.assertResourceCalled('File', '/tmp/hbase-smoke.sh',
       content = Template('hbase-smoke.sh.j2'),
       mode = 0755,
     )
-    self.assertResourceCalled('Execute', ' 
/usr/hdp/current/hbase-client/bin/hbase --config 
/usr/hdp/current/hbase-client/conf shell /tmp/hbase-smoke.sh && 
/tmp/hbaseSmokeVerify.sh /usr/hdp/current/hbase-client/conf  
/usr/hdp/current/hbase-client/bin/hbase',
+    self.assertResourceCalled('Execute',  ' 
/usr/hdp/current/hbase-client/bin/hbase --config 
/usr/hdp/current/hbase-client/conf shell /tmp/hbase-smoke.sh && 
/tmp/hbaseSmokeVerify.sh /usr/hdp/current/hbase-client/conf  
/usr/hdp/current/hbase-client/bin/hbase &&  
/usr/hdp/current/hbase-client/bin/hbase --config 
/usr/hdp/current/hbase-client/conf shell /tmp/hbase-smoke-cleanup.sh',
       logoutput = True,
       tries = 6,
       user = 'ambari-qa',

Reply via email to