Author: smohanty
Date: Wed May 22 02:15:00 2013
New Revision: 1485031
URL: http://svn.apache.org/r1485031
Log:
AMBARI-2177. HBase Smoke Test shows success even if it fails. (smohanty)
Added:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/files/hbaseSmokeVerify.sh
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hbase-smoke.sh.erb
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1485031&r1=1485030&r2=1485031&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed May 22 02:15:00 2013
@@ -873,6 +873,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-2177. HBase Smoke Test shows success even if it fails. (smohanty)
+
AMBARI-2176. Incorrect unit displayed for "dfs.datanode.du.reserved" and
"fs.checkpoint.size". (jaimin)
Added:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/files/hbaseSmokeVerify.sh
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/files/hbaseSmokeVerify.sh?rev=1485031&view=auto
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/files/hbaseSmokeVerify.sh
(added)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/files/hbaseSmokeVerify.sh
Wed May 22 02:15:00 2013
@@ -0,0 +1,32 @@
+#
+#
+# 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.
+#
+#
+conf_dir=$1
+data=$2
+echo "scan 'ambarismoketest'" | hbase --config $conf_dir shell >
/tmp/hbase_chk_verify
+cat /tmp/hbase_chk_verify
+echo "Looking for $data"
+grep -q $data /tmp/hbase_chk_verify
+if [ "$?" -ne 0 ]
+then
+ exit 1
+fi
+
+grep -q '1 row(s)' /tmp/hbase_chk_verify
\ No newline at end of file
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp?rev=1485031&r1=1485030&r2=1485031&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/hbase/service_check.pp
Wed May 22 02:15:00 2013
@@ -18,28 +18,43 @@
# under the License.
#
#
-class hdp-hbase::hbase::service_check()
+class hdp-hbase::hbase::service_check()
{
$smoke_test_user = $hdp::params::smokeuser
$output_file = "/apps/hbase/data/ambarismoketest"
$conf_dir = $hdp::params::hbase_conf_dir
- $test_cmd = "fs -test -e ${output_file}"
-
+ $test_cmd = "fs -test -e ${output_file}"
+ $serviceCheckData = hdp_unique_id_and_date()
+
anchor { 'hdp-hbase::hbase::service_check::begin':}
- file { '/tmp/hbaseSmoke.sh':
+ $hbase_servicecheck_file = '/tmp/hbase-smoke.sh'
+
+ file { '/tmp/hbaseSmokeVerify.sh':
ensure => present,
- source => "puppet:///modules/hdp-hbase/hbaseSmoke.sh",
+ source => "puppet:///modules/hdp-hbase/hbaseSmokeVerify.sh",
mode => '0755',
}
- exec { '/tmp/hbaseSmoke.sh':
- command => "su - ${smoke_test_user} -c 'hbase --config $conf_dir shell
/tmp/hbaseSmoke.sh'",
+ file { $hbase_servicecheck_file:
+ mode => '0755',
+ content => template('hdp-hbase/hbase-smoke.sh.erb'),
+ }
+
+ exec { $hbase_servicecheck_file:
+ command => "su - ${smoke_test_user} -c 'hbase --config $conf_dir shell
$hbase_servicecheck_file'",
+ tries => 3,
+ try_sleep => 5,
+ path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+ logoutput => "true"
+ }
+
+ exec { '/tmp/hbaseSmokeVerify.sh':
+ command => "su - ${smoke_test_user} -c '/tmp/hbaseSmokeVerify.sh
$conf_dir ${serviceCheckData}'",
tries => 3,
try_sleep => 5,
- require => File['/tmp/hbaseSmoke.sh'],
path => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
notify => Hdp-hadoop::Exec-hadoop['hbase::service_check::test'],
logoutput => "true"
@@ -48,9 +63,13 @@ class hdp-hbase::hbase::service_check()
hdp-hadoop::exec-hadoop { 'hbase::service_check::test':
command => $test_cmd,
refreshonly => true,
- require => Exec['/tmp/hbaseSmoke.sh'],
+ require => Exec['/tmp/hbaseSmokeVerify.sh'],
before => Anchor['hdp-hbase::hbase::service_check::end'] #TODO:
remove after testing
}
-
+
+ Anchor['hdp-hbase::hbase::service_check::begin'] ->
File['/tmp/hbaseSmokeVerify.sh']
+ File[$hbase_servicecheck_file] -> Exec[$hbase_servicecheck_file] ->
Exec['/tmp/hbaseSmokeVerify.sh']
+ -> Anchor['hdp-hbase::hbase::service_check::end']
+
anchor{ 'hdp-hbase::hbase::service_check::end':}
-}
+}
\ No newline at end of file
Added:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hbase-smoke.sh.erb
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hbase-smoke.sh.erb?rev=1485031&view=auto
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hbase-smoke.sh.erb
(added)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/templates/hbase-smoke.sh.erb
Wed May 22 02:15:00 2013
@@ -0,0 +1,26 @@
+#
+#
+# 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'
+create 'ambarismoketest','family'
+put
'ambarismoketest','row01','family:col01','<%=scope.function_hdp_template_var("::hdp-hbase::hbase::service_check::serviceCheckData")%>'
+scan 'ambarismoketest'
+exit
\ No newline at end of file