Browse Source

AMBARI-2094. Create smoke test for NODEMANAGER component as a part of MapReduce V2 Service check. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1480138 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle 12 years ago
parent
commit
0cc6f6057a

+ 3 - 0
CHANGES.txt

@@ -12,6 +12,9 @@ Trunk (unreleased changes):
 
  NEW FEATURES
 
+ AMBARI-2094. Create smoke test for NODEMANAGER component as a part of 
+ MapReduce V2 Service check. (swagle)
+
  AMBARI-2093. Add Tez as a configurable Service in Hadoop 2.0 stack. (swagle)
 
  AMBARI-2031. AMBARI-2031. Add clover code coverage profile. 

+ 24 - 0
ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/nodemanager/service_check.pp

@@ -0,0 +1,24 @@
+#
+#
+# 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.
+#
+#
+class hdp-yarn::nodemanager::service_check() inherits hdp-yarn::params
+{
+  class { 'hdp-yarn::smoketest': component_name => 'resourcemanager'}
+}

+ 1 - 23
ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/resourcemanager/service_check.pp

@@ -20,27 +20,5 @@
 #
 class hdp-yarn::resourcemanager::service_check() inherits hdp-yarn::params
 {
-  $smoke_test_user = $hdp::params::smokeuser
-  
-  $validateStatusFileName = "validateYarnComponentStatus.py"
-  $validateStatusFilePath = "/tmp/$validateStatusFileName"
-  $yarn_webui_port = $hdp-yarn::params::yarn_webui_port
-  $validateStatusCmd = "su - ${smoke_test_user} -c 'python $validateStatusFilePath rm -p $yarn_webui_port'"
-
-  $test_cmd = "fs -test -e ${output_file}" 
-
-  file { $validateStatusFilePath:
-    ensure => present,
-    source => "puppet:///modules/hdp-yarn/$validateStatusFileName",
-    mode => '0755'
-  }
-
-  exec { $validateStatusFilePath:
-    command   => $validateStatusCmd,
-    tries     => 3,
-    try_sleep => 5,
-    path      => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-    logoutput => "true"
-  }
-  File[$validateStatusFilePath] -> Exec[$validateStatusFilePath]
+  class { 'hdp-yarn::smoketest': component_name => 'resourcemanager'}
 }

+ 56 - 0
ambari-agent/src/main/puppet/modules/hdp-yarn/manifests/smoketest.pp

@@ -0,0 +1,56 @@
+#
+#
+# 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.
+#
+#
+class hdp-yarn::smoketest(
+  $component_name = undef
+)
+{
+  if ($component_name == 'resourcemanager') {
+    $component_type = 'rm' 
+  } elsif ($component_name == 'nodemanger') {
+    $component_type = 'nm' 
+  } elsif ($component_name == 'historyserver') {
+    $component_type = 'hs' 
+  } else {
+    hdp_fail("Unsupported component name: $component_name")
+  }
+
+  $smoke_test_user = $hdp::params::smokeuser
+  
+  $validateStatusFileName = "validateYarnComponentStatus.py"
+  $validateStatusFilePath = "/tmp/$validateStatusFileName"
+  $yarn_webui_port = $hdp-yarn::params::yarn_webui_port
+  $validateStatusCmd = "su - ${smoke_test_user} -c 'python $validateStatusFilePath $component_type -p $yarn_webui_port'"
+
+  file { $validateStatusFilePath:
+    ensure => present,
+    source => "puppet:///modules/hdp-yarn/$validateStatusFileName",
+    mode => '0755'
+  }
+
+  exec { $validateStatusFilePath:
+    command   => $validateStatusCmd,
+    tries     => 3,
+    try_sleep => 5,
+    path      => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+    logoutput => "true"
+  }
+  File[$validateStatusFilePath] -> Exec[$validateStatusFilePath]
+}

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

@@ -125,6 +125,7 @@ rolesToClass = {
   'DECOMMISSION_DATANODE': 'hdp-hadoop::hdfs::decommission',
   'HUE_SERVICE_CHECK': 'hdp-hue::service_check',
   'RESOURCEMANAGER_SERVICE_CHECK': 'hdp-yarn::resourcemanager::service_check',
+  'NODEMANAGER_SERVICE_CHECK': 'hdp-yarn::nodemanager::service_check',
   'TEZ_CLIENT': 'hdp-tez::tez_client'
 }
 

+ 1 - 0
ambari-server/src/main/java/org/apache/ambari/server/Role.java

@@ -72,6 +72,7 @@ public enum Role {
   AMBARI_SERVER_ACTION,
   RESOURCEMANAGER,
   RESOURCEMANAGER_SERVICE_CHECK,
+  NODEMANAGER_SERVICE_CHECK,
   NODEMANAGER,
   YARN_CLIENT,
   HISTORYSERVER,