Sfoglia il codice sorgente

AMBARI-1729. Creating smoke test for Hue service. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1465138 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle 12 anni fa
parent
commit
8a18cd17f1

+ 2 - 0
CHANGES.txt

@@ -12,6 +12,8 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-1729. Creating smoke test for Hue service. (swagle)
+
  AMBARI-1776. ZooKeeper Servers needs to store correct kerberos principal 
  in zookeeper_jaas.conf. (swagle)
 

+ 24 - 1
ambari-agent/src/main/puppet/modules/hdp-hue/manifests/hue/service_check.pp

@@ -18,7 +18,30 @@
 # under the License.
 #
 #
-class hdp-hue::service_check() inherits hdp-hue::params
+class hdp-hue::hue::service_check() inherits hdp-hue::params
 {
+  $status_check_cmd = "/etc/init.d/hue status | grep 'is running'"
+  $smoke_test_cmd = "${hue_home_dir}/build/env/bin/hue smoke_test"
 
+  anchor { 'hdp-hue::hue::service_check::begin' : }
+
+  exec { 'hue-status-check':
+    command   => $status_check_cmd,
+    tries     => 3,
+    try_sleep => 5,
+    path      => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+    logoutput => "true"
+  }
+
+  exec { 'hue-smoke-test':
+      command   => $smoke_test_cmd,
+      tries     => 3,
+      try_sleep => 5,
+      path      => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+      require   => Exec['hue-status-check'],
+      before    => Anchor['hdp-hue::hue::service_check::end'],
+      logoutput => "true"
+    }
+
+  anchor { 'hdp-hue::hue::service_check::end' : }
 }

+ 2 - 1
ambari-agent/src/main/puppet/modules/hdp-hue/manifests/params.pp

@@ -29,6 +29,7 @@ class hdp-hue::params() inherits hdp::params {
   $hue_lock_file = hdp_default("hue_lock_file", "/var/lock/subsys/hue")
   $hue_server_user = hdp_default("hue_user", "hue")
   $hue_server_group = hdp_default("hue_user_group", "hadoop")
+  $hue_home_dir = hdp_default("hue_home_dir", "/usr/lib/hue")
 
   # Other properties - not exposed
 
@@ -104,4 +105,4 @@ class hdp-hue::params() inherits hdp::params {
 
   }
 
-}
+}

+ 2 - 1
ambari-agent/src/main/python/ambari_agent/AmbariConfig.py

@@ -147,7 +147,8 @@ servicesToPidNames = {
   'KERBEROS_SERVER': 'kadmind.pid',
   'HIVE_SERVER': 'hive-server.pid',
   'HIVE_METASTORE': 'hive.pid',
-  'MYSQL_SERVER': 'mysqld.pid'
+  'MYSQL_SERVER': 'mysqld.pid',
+  'HUE_SERVER': '/var/run/hue/supervisor.pid'
 }
 
 linuxUserPattern = '[A-Za-z0-9_-]*[$]?'