You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2014/12/19 07:21:56 UTC

[07/12] ambari git commit: AMBARI-8779: Common Services: Refactor HDP-2.1 FALCON, STORM, TEZ services (Jayush Luniya)

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
deleted file mode 100644
index 218c508..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  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.
--->
-
-<configuration supports_final="true">
-
-  <property>
-    <name>tez.lib.uris</name>
-    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/</value>
-    <description>The location of the Tez libraries which will be localized for DAGs</description>
-  </property>
-
-  <property>
-    <name>tez.am.log.level</name>
-    <value>INFO</value>
-    <description>Root Logging level passed to the Tez app master</description>
-  </property>
-
-  <property>
-    <name>tez.staging-dir</name>
-    <value>/tmp/${user.name}/staging</value>
-    <description>The staging dir used while submitting DAGs</description>
-  </property>
-
-  <property>
-    <name>tez.am.resource.memory.mb</name>
-    <value>1536</value>
-    <description>The amount of memory to be used by the AppMaster</description>
-  </property>
-
-  <!-- tez picks the java opts from yarn.app.mapreduce.am.command-opts for MR tasks. Likewise for the AM memory MB -->
-  <property>
-    <name>tez.am.java.opts</name>
-    <value>-server -Xmx1024m -Djava.net.preferIPv4Stack=true -XX:+UseNUMA -XX:+UseParallelGC</value>
-    <description>Java options for the Tez AppMaster process. The -Xmx parameter value is generally 0.8 times tez.am.resource.memory.mb config.</description>
-  </property>
-
-  <property>
-    <name>tez.am.shuffle-vertex-manager.min-src-fraction</name>
-    <value>0.2</value>
-    <description>In case of a ScatterGather connection, the fraction of source tasks which should
-      complete before tasks for the current vertex are schedule
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.shuffle-vertex-manager.max-src-fraction</name>
-    <value>0.4</value>
-    <description>In case of a ScatterGather connection, once this fraction of source tasks have
-      completed, all tasks on the current vertex can be scheduled. Number of tasks ready for
-      scheduling on the current vertex scales linearly between min-fraction and max-fraction
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.am-rm.heartbeat.interval-ms.max</name>
-    <value>250</value>
-    <description>The maximum heartbeat interval between the AM and RM in milliseconds</description>
-  </property>
-
-  <property>
-    <name>tez.am.grouping.split-waves</name>
-    <value>1.4</value>
-    <description>The multiplier for available queue capacity when determining number of tasks for
-      a Vertex. 1.4 with 100% queue available implies generating a number of tasks roughly equal
-      to 140% of the available containers on the queue
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.grouping.min-size</name>
-    <value>16777216</value>
-    <description>Lower bound on the size (in bytes) of a grouped split, to avoid generating
-      too many splits
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.grouping.max-size</name>
-    <value>1073741824</value>
-    <description>Upper bound on the size (in bytes) of a grouped split, to avoid generating
-      excessively large split
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.container.reuse.enabled</name>
-    <value>true</value>
-    <description>Configuration to specify whether container should be reused</description>
-  </property>
-
-  <property>
-    <name>tez.am.container.reuse.rack-fallback.enabled</name>
-    <value>true</value>
-    <description>Whether to reuse containers for rack local tasks. Active only if reuse is enabled
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.container.reuse.non-local-fallback.enabled</name>
-    <value>true</value>
-    <description>Whether to reuse containers for non-local tasks. Active only if reuse is enabled
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.container.session.delay-allocation-millis</name>
-    <value>10000</value>
-    <!-- TODO This value may change -->
-    <description>The amount of time to hold on to a container if no task can be assigned to
-      it immediately. Only active when reuse is enabled. Set to -1 to never release a container
-      in a session
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.container.reuse.locality.delay-allocation-millis</name>
-    <value>250</value>
-    <description>The amount of time to wait before assigning a container to the next level of
-      locality. NODE -> RACK -> NON_LOCAL
-    </description>
-  </property>
-
-  <property>
-    <name>tez.task.get-task.sleep.interval-ms.max</name>
-    <value>200</value>
-    <description>The maximum amount of time, in seconds, to wait before a task asks an AM for
-      another task
-    </description>
-  </property>
-
-  <property>
-    <name>tez.am.env</name>
-    <value>LD_LIBRARY_PATH=/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/Linux-amd64-64</value>
-    <description>
-        Additional execution environment entries for tez. This is not an additive property. You must preserve the original value if
-        you want to have access to native libraries.
-    </description>
-  </property>
-
-  <!-- Client Submission timeout value when submitting DAGs to a session -->
-  <property>
-    <name>tez.session.client.timeout.secs</name>
-    <value>180</value>
-    <description>Time (in seconds) to wait for AM to come up when trying to submit a DAG from
-      the client
-    </description>
-  </property>
-
-  <property>
-    <name>tez.session.am.dag.submit.timeout.secs</name>
-    <value>300</value>
-    <description>Time (in seconds) for which the Tez AM should wait for a DAG to be submitted
-      before shutting down
-    </description>
-  </property>
-
-
-  <!-- Configuration for runtime components -->
-
-  <!-- These properties can be set on a per edge basis by configuring the payload for each
-       edge independently. -->
-
-  <property>
-    <name>tez.runtime.intermediate-output.should-compress</name>
-    <value>false</value>
-    <description>Whether intermediate output should be compressed or not</description>
-  </property>
-
-  <property>
-    <name>tez.runtime.intermediate-output.compress.codec</name>
-    <value>org.apache.hadoop.io.compress.SnappyCodec</value>
-    <description>The coded to be used if compressing intermediate output. Only
-      applicable if tez.runtime.intermediate-output.should-compress is enabled.
-    </description>
-  </property>
-
-  <property>
-    <name>tez.runtime.intermediate-input.is-compressed</name>
-    <value>false</value>
-    <description>Whether intermediate input is compressed</description>
-  </property>
-
-  <property>
-    <name>tez.runtime.intermediate-input.compress.codec</name>
-    <value>org.apache.hadoop.io.compress.SnappyCodec</value>
-    <description>The coded to be used when reading intermediate compressed input.
-    Only applicable if tez.runtime.intermediate-input.is-compressed is enabled.</description>
-  </property>
-
-  <!-- Configuration for ATS integration -->
-
-  <property>
-    <name>tez.yarn.ats.enabled</name>
-    <value>true</value>
-    <description>Whether to send history events to YARN Application Timeline Server</description>
-  </property>
-
-</configuration>
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
index 641de86..92f125f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/metainfo.xml
@@ -20,54 +20,7 @@
   <services>
     <service>
       <name>TEZ</name>
-      <displayName>Tez</displayName>
-      <comment>Tez is the next generation Hadoop Query Processing framework written on top of YARN.</comment>
-      <version>0.4.0.2.1</version>
-      <components>
-        <component>
-          <name>TEZ_CLIENT</name>
-          <displayName>Tez Client</displayName>
-          <cardinality>1+</cardinality>
-          <category>CLIENT</category>
-          <commandScript>
-            <script>scripts/tez_client.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-          <configFiles>
-            <configFile>
-              <type>xml</type>
-              <fileName>tez-site.xml</fileName>
-              <dictionaryName>tez-site</dictionaryName>
-            </configFile>
-            <configFile>
-              <type>env</type>
-              <fileName>tez-env.sh</fileName>
-              <dictionaryName>tez-env</dictionaryName>
-            </configFile>
-          </configFiles>
-        </component>
-      </components>
-      <osSpecifics>
-        <osSpecific>
-          <osFamily>any</osFamily>
-          <packages>
-            <package>
-              <name>tez</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-      
-      <requiredServices>
-        <service>YARN</service>
-      </requiredServices>
-
-      <configuration-dependencies>
-        <config-type>tez-site</config-type>
-        <config-type>tez-env</config-type>
-      </configuration-dependencies>
-
+      <extends>common-services/TEZ/0.4.0.2.1</extends>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/params.py
deleted file mode 100644
index 31162cd..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/params.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
-from resource_management import *
-
-# server configurations
-config = Script.get_config()
-
-# This is expected to be of the form #.#.#.#
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
-
-# New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
-version = default("/commandParams/version", None)
-
-if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
-  hadoop_bin_dir = "/usr/hdp/current/hadoop-client/bin"
-else:
-  hadoop_bin_dir = "/usr/bin"
-hadoop_conf_dir = "/etc/hadoop/conf"
-
-kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-security_enabled = config['configurations']['cluster-env']['security_enabled']
-hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
-hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name']
-hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
-
-config_dir_prefix = "/etc/tez"
-config_dir = format("{config_dir_prefix}/conf")
-
-hadoop_home = '/usr'
-java64_home = config['hostLevelParams']['java_home']
-
-tez_user = config['configurations']['tez-env']['tez_user']
-user_group = config['configurations']['cluster-env']['user_group']
-tez_env_sh_template = config['configurations']['tez-env']['content']
-
-import functools
-# Create partial functions with common arguments for every HdfsDirectory call
-# to create hdfs directory we need to call params.HdfsDirectory in code
-HdfsDirectory = functools.partial(
-  HdfsDirectory,
-  conf_dir=hadoop_conf_dir,
-  hdfs_user=hdfs_principal_name if security_enabled else hdfs_user,
-  security_enabled=security_enabled,
-  keytab=hdfs_user_keytab,
-  kinit_path_local=kinit_path_local,
-  bin_dir=hadoop_bin_dir
-)

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez.py
deleted file mode 100644
index bb8b7c2..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez.py
+++ /dev/null
@@ -1,61 +0,0 @@
-"""
-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.
-
-Ambari Agent
-
-"""
-
-from resource_management import *
-
-def tez():
-  import params
-
-  Directory(params.config_dir_prefix,
-            mode=0755
-  )
-  Directory(params.config_dir,
-            owner = params.tez_user,
-            group = params.user_group,
-            recursive = True
-  )
-
-  XmlConfig( "tez-site.xml",
-             conf_dir = params.config_dir,
-             configurations = params.config['configurations']['tez-site'],
-             configuration_attributes=params.config['configuration_attributes']['tez-site'],
-             owner = params.tez_user,
-             group = params.user_group,
-             mode = 0664
-  )
-
-  File(format("{config_dir}/tez-env.sh"),
-       owner=params.tez_user,
-       content=InlineTemplate(params.tez_env_sh_template)
-  )
-
-
-def tez_TemplateConfig(name):
-  import params
-
-  if not isinstance(name, list):
-    name = [name]
-
-  for x in name:
-    TemplateConfig(format("{config_dir}/{x}"),
-                   owner = params.tez_user
-    )
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez_client.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez_client.py
deleted file mode 100644
index 04cfb90..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/package/scripts/tez_client.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""
-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.
-
-Ambari Agent
-
-"""
-
-import sys
-from resource_management import *
-from tez import tez
-
-class TezClient(Script):
-
-  def pre_rolling_restart(self, env):
-    import params
-    env.set_params(params)
-
-    if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
-      Execute(format("hdp-select set hadoop-client {version}"))
-
-  def install(self, env):
-    self.install_packages(env)
-    self.configure(env)
-
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    tez()
-
-  def status(self, env):
-    raise ClientComponentHasNoStatus()
-
-
-if __name__ == "__main__":
-  TezClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
index 2763574..267e1ab 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
@@ -22,11 +22,16 @@ from stacks.utils.RMFTestCase import *
 
 
 class TestFalconClient(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "FALCON/0.5.0.2.1/package"
+  STACK_VERSION = "2.1"
+
   def test_configure_default(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/falcon_client.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_client.py",
                        classname="FalconClient",
                        command="configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Directory', '/var/run/falcon',
                               owner = 'falcon',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 91e10b0..5451cf8 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -22,12 +22,16 @@ from stacks.utils.RMFTestCase import *
 
 
 class TestFalconServer(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "FALCON/0.5.0.2.1/package"
+  STACK_VERSION = "2.1"
 
   def test_start_default(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/falcon_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py",
                        classname="FalconServer",
                        command="start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertResourceCalled('Execute', '/usr/lib/falcon/bin/falcon-start -port 15000',
@@ -37,10 +41,12 @@ class TestFalconServer(RMFTestCase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/falcon_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py",
                        classname="FalconServer",
                        command="stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', '/usr/lib/falcon/bin/falcon-stop',
                               path = ['/usr/bin'],
@@ -52,10 +58,12 @@ class TestFalconServer(RMFTestCase):
     self.assertNoMoreResources()
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/falcon_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/falcon_server.py",
                        classname="FalconServer",
                        command="configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/FALCON/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/FALCON/test_service_check.py b/ambari-server/src/test/python/stacks/2.1/FALCON/test_service_check.py
index 97bb480..7258eae 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_service_check.py
@@ -22,12 +22,16 @@ from stacks.utils.RMFTestCase import *
 
 
 class TestFalconServer(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "FALCON/0.5.0.2.1/package"
+  STACK_VERSION = "2.1"
 
   def test_service_check(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/service_check.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
                        classname="FalconServiceCheck",
                        command="service_check",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', '/usr/lib/falcon/bin/falcon admin -version',
                               logoutput = True,
@@ -36,10 +40,12 @@ class TestFalconServer(RMFTestCase):
                               try_sleep = 20,)
     self.assertNoMoreResources()
   def test_service_check_secured(self):
-    self.executeScript("2.1/services/FALCON/package/scripts/service_check.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
                        classname="FalconServiceCheck",
                        command="service_check",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute','/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa',
                               user='ambari-qa'

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
index c6dda41..5686196 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
@@ -22,15 +22,19 @@ from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 import datetime
 import  resource_management.libraries.functions
+from test_storm_base import TestStormBase
+
 @patch.object(resource_management.libraries.functions, "get_unique_id_and_date", new = MagicMock(return_value=''))
 
-class TestStormServiceCheck(RMFTestCase):
+class TestStormServiceCheck(TestStormBase):
 
   def test_service_check(self):
-    self.executeScript("2.1/services/STORM/package/scripts/service_check.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/service_check.py",
                        classname="ServiceCheck",
                        command="service_check",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('File', '/tmp/wordCount.jar',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py
index d9a2bc0..6e6e2eb 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_base.py
@@ -25,6 +25,9 @@ import re
 
 
 class TestStormBase(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "STORM/0.9.1.2.1/package"
+  STACK_VERSION = "2.1"
+
   def assert_configure_default(self):
     import params
     self.assertResourceCalled('Directory', '/var/log/storm',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
index 2527e69..336aded 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
@@ -26,10 +26,12 @@ from test_storm_base import TestStormBase
 class TestStormDrpcServer(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -37,10 +39,12 @@ class TestStormDrpcServer(TestStormBase):
 
   def test_start_default(self):
 
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
 
@@ -61,10 +65,12 @@ class TestStormDrpcServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/drpc.pid`',
         not_if = '! (ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/drpc.pid` >/dev/null 2>&1)',
@@ -79,19 +85,23 @@ class TestStormDrpcServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -112,10 +122,12 @@ class TestStormDrpcServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/drpc_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/drpc_server.py",
                        classname = "DrpcServer",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/drpc.pid`',
         not_if = '! (ls /var/run/storm/drpc.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/drpc.pid` >/dev/null 2>&1)',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_jaas_configuration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_jaas_configuration.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_jaas_configuration.py
index d8b5465..047bfaf 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_jaas_configuration.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_jaas_configuration.py
@@ -26,18 +26,22 @@ from test_storm_base import TestStormBase
 class TestStormJaasConfiguration(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file = "default-storm-start.json"
+                       config_file = "default-storm-start.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
   def test_start_default(self):
 
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file = "default-storm-start.json"
+                       config_file = "default-storm-start.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
 
@@ -45,19 +49,23 @@ class TestStormJaasConfiguration(TestStormBase):
   @patch("storm._find_real_user_min_uid")
   def test_configure_secured(self, find_real_user_max_pid):
     find_real_user_max_pid.return_value = 500
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file = "secured-storm-start.json"
+                       config_file = "secured-storm-start.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
   @patch("storm._find_real_user_min_uid")
   def test_start_secured(self, find_real_user_max_pid):
     find_real_user_max_pid.return_value = 500
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file = "secured-storm-start.json"
+                       config_file = "secured-storm-start.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
index 3b82e22..d9887d4 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py
@@ -27,19 +27,23 @@ from test_storm_base import TestStormBase
 class TestStormNimbus(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -60,10 +64,12 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/nimbus.pid`',
         not_if = '! (ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/nimbus.pid` >/dev/null 2>&1)',
@@ -78,19 +84,23 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -111,10 +121,12 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
                        classname = "Nimbus",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/nimbus.pid`',
         not_if = '! (ls /var/run/storm/nimbus.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/nimbus.pid` >/dev/null 2>&1)',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
index e7a2761..6c7ea30 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus_prod.py
@@ -26,19 +26,23 @@ from test_storm_base import TestStormBase
 class TestStormNimbus(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -49,10 +53,12 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'supervisorctl stop storm-nimbus',
                               wait_for_finish = False,
@@ -60,19 +66,23 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -83,10 +93,12 @@ class TestStormNimbus(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/nimbus_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus_prod.py",
                        classname = "Nimbus",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'supervisorctl stop storm-nimbus',
                               wait_for_finish = False,

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
index a818313..4e29ffa 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py
@@ -26,19 +26,23 @@ from test_storm_base import TestStormBase
 class TestStormRestApi(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -59,10 +63,12 @@ class TestStormRestApi(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/restapi.pid`',
         not_if = '! (ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/restapi.pid` >/dev/null 2>&1)',
@@ -77,19 +83,23 @@ class TestStormRestApi(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -111,10 +121,12 @@ class TestStormRestApi(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/rest_api.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/rest_api.py",
                        classname = "StormRestApi",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/restapi.pid`',
         not_if = '! (ls /var/run/storm/restapi.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/restapi.pid` >/dev/null 2>&1)',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
index b968b1b..699dce8 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py
@@ -26,19 +26,23 @@ from test_storm_base import TestStormBase
 class TestStormSupervisor(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -72,10 +76,12 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/supervisor.pid`',
         not_if = '! (ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/supervisor.pid` >/dev/null 2>&1)',
@@ -100,19 +106,23 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -147,10 +157,12 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor.py",
                        classname = "Supervisor",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/supervisor.pid`',
         not_if = '! (ls /var/run/storm/supervisor.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/supervisor.pid` >/dev/null 2>&1)',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
index 2822833..4ae0c4d 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py
@@ -26,19 +26,23 @@ from test_storm_base import TestStormBase
 class TestStormSupervisor(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -62,10 +66,12 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'supervisorctl stop storm-supervisor',
                               wait_for_finish = False,
@@ -83,19 +89,23 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -119,10 +129,12 @@ class TestStormSupervisor(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/supervisor_prod.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/supervisor_prod.py",
                        classname = "Supervisor",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Execute', 'supervisorctl stop storm-supervisor',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
index 5b6123a..becd591 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py
@@ -25,19 +25,23 @@ from test_storm_base import TestStormBase
 class TestStormUiServer(TestStormBase):
 
   def test_configure_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
   def test_start_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "start",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_default()
@@ -58,10 +62,12 @@ class TestStormUiServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_default(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "stop",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/ui.pid`',
         not_if = '! (ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/ui.pid` >/dev/null 2>&1)',
@@ -76,19 +82,23 @@ class TestStormUiServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_configure_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "configure",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
   def test_start_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "start",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assert_configure_secured()
@@ -110,10 +120,12 @@ class TestStormUiServer(TestStormBase):
     self.assertNoMoreResources()
 
   def test_stop_secured(self):
-    self.executeScript("2.1/services/STORM/package/scripts/ui_server.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "stop",
-                       config_file="secured.json"
+                       config_file="secured.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', 'sudo kill `cat /var/run/storm/ui.pid`',
         not_if = '! (ls /var/run/storm/ui.pid >/dev/null 2>&1 && ps -p `cat /var/run/storm/ui.pid` >/dev/null 2>&1)',

http://git-wip-us.apache.org/repos/asf/ambari/blob/bab3dbc8/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py b/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
index e8acbe5..3d74113 100644
--- a/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
+++ b/ambari-server/src/test/python/stacks/2.1/TEZ/test_tez_client.py
@@ -22,11 +22,16 @@ from stacks.utils.RMFTestCase import *
 
 class TestTezClient(RMFTestCase):
 
+  COMMON_SERVICES_PACKAGE_DIR = "TEZ/0.4.0.2.1/package"
+  STACK_VERSION = "2.1"
+
   def test_configure_default(self):
-    self.executeScript("2.1/services/TEZ/package/scripts/tez_client.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/tez_client.py",
                        classname = "TezClient",
                        command = "configure",
-                       config_file="default.json"
+                       config_file="default.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 
     self.assertResourceCalled('Directory', '/etc/tez',
@@ -57,10 +62,12 @@ class TestTezClient(RMFTestCase):
 
 
   def test_upgrade(self):
-    self.executeScript("2.1/services/TEZ/package/scripts/tez_client.py",
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/tez_client.py",
                        classname = "TezClient",
                        command = "restart",
-                       config_file="client-upgrade.json")
+                       config_file="client-upgrade.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES)
 
     self.assertResourceCalled("Execute", "hdp-select set hadoop-client 2.2.1.0-2067")