http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
index bcd9c80..680c984 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py
@@ -37,6 +37,8 @@ class Test(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HDFS/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"HDFS", "role":"HDFS_CLIENT"}
+
   def test_generate_configs_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/hdfs_client.py",
                        classname = "HdfsClient",
@@ -81,6 +83,7 @@ class Test(RMFTestCase):
                    classname = "HdfsClient",
                    command = "restart",
                    config_file="client-upgrade.json",
+                   config_overrides = self.CONFIG_OVERRIDES,
                    stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -101,6 +104,7 @@ class Test(RMFTestCase):
                        classname = "HdfsClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -128,6 +132,7 @@ class Test(RMFTestCase):
                        classname = "HdfsClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalledIgnoreEarlier('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hadoop-client', version), sudo=True,)

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
index ff8f92e..06c5fdd 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py
@@ -29,6 +29,8 @@ class TestJournalnode(RMFTestCase):
   STACK_VERSION = "2.0.6"
   UPGRADE_STACK_VERSION = "2.2"
 
+  CONFIG_OVERRIDES = {"serviceName":"HDFS", "role":"JOURNALNODE"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/journalnode.py",
                        classname = "JournalNode",
@@ -388,6 +390,7 @@ class TestJournalnode(RMFTestCase):
                        classname = "JournalNode",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hadoop-hdfs-journalnode', version), sudo=True,)
@@ -406,6 +409,7 @@ class TestJournalnode(RMFTestCase):
                        classname = "JournalNode",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index f0f2587..e6503a2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -35,6 +35,8 @@ class TestNamenode(RMFTestCase):
   STACK_VERSION = "2.0.6"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"HDFS", "role":"NAMENODE"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/namenode.py",
                        classname = "NameNode",
@@ -1402,6 +1404,7 @@ class TestNamenode(RMFTestCase):
                        classname = "NameNode",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -1423,6 +1426,7 @@ class TestNamenode(RMFTestCase):
                        classname = "NameNode",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, None), (0, None), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py
index de425cd..773d3fe 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_nfsgateway.py
@@ -34,6 +34,8 @@ class TestNFSGateway(RMFTestCase):
   STACK_VERSION = "2.0.6"
   UPGRADE_STACK_VERSION = "2.2"
 
+  CONFIG_OVERRIDES = {"serviceName":"HDFS", "role":"NFS_GATEWAY"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/nfsgateway.py",
                        classname = "NFSGateway",
@@ -291,6 +293,7 @@ class TestNFSGateway(RMFTestCase):
                        classname = "NFSGateway",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None), (0, None), (0, 
None)])

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py
index ff7e728..457fccf 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hcat_client.py
@@ -25,6 +25,8 @@ class TestHcatClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"HIVE", "role":"HCAT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/hcat_client.py",
                        classname = "HCatClient",
@@ -117,6 +119,7 @@ class TestHcatClient(RMFTestCase):
       classname = "HCatClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = [(0, None, ''), (0, None, ''), (0, None, ''), (0, None, 
'')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
index 6afc298..3bc597e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
@@ -25,11 +25,14 @@ class TestHiveClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = { "serviceName" : "HIVE", "role" : "HIVE_CLIENT" }
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/hive_client.py",
                        classname = "HiveClient",
                        command = "configure",
                        config_file="default_client.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
@@ -110,6 +113,7 @@ class TestHiveClient(RMFTestCase):
                        classname = "HiveClient",
                        command = "configure",
                        config_file="secured_client.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
@@ -198,6 +202,7 @@ class TestHiveClient(RMFTestCase):
                        classname = "HiveClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -219,6 +224,7 @@ class TestHiveClient(RMFTestCase):
                        classname = "HiveClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, ''), (0, None, 
''), (0, None, '')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
index 03dd391..a6a4fa0 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py
@@ -29,6 +29,8 @@ class TestWebHCatServer(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"HIVE", "role":"WEBHCAT_SERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/webhcat_server.py",
                        classname = "WebHCatServer",
@@ -286,6 +288,7 @@ class TestWebHCatServer(RMFTestCase):
                        classname = "WebHCatServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -308,6 +311,7 @@ class TestWebHCatServer(RMFTestCase):
                        classname = "WebHCatServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, '')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
index f7e4410..31d54ae 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_client.py
@@ -28,6 +28,8 @@ class TestOozieClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "OOZIE/4.0.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"OOZIE", "role":"OOZIE_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/oozie_client.py",
                        classname = "OozieClient",
@@ -243,6 +245,7 @@ class TestOozieClient(RMFTestCase):
                        classname = "OozieClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -264,6 +267,7 @@ class TestOozieClient(RMFTestCase):
                        classname = "OozieClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index 5ef6ad9..17b8abf 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -39,6 +39,8 @@ class TestOozieServer(RMFTestCase):
   UPGRADE_STACK_VERSION = "2.2"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"OOZIE", "role":"OOZIE_SERVER"}
+
   def setUp(self):
     self.maxDiff = None
 
@@ -1194,6 +1196,7 @@ class TestOozieServer(RMFTestCase):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/oozie_server.py",
      classname = "OozieServer", command = "pre_upgrade_restart", config_file = 
"oozie-upgrade.json",
+     config_overrides = self.CONFIG_OVERRIDES,
      stack_version = self.UPGRADE_STACK_VERSION,
      target = RMFTestCase.TARGET_COMMON_SERVICES,
      call_mocks = [(0, prepare_war_stdout)])
@@ -1206,6 +1209,9 @@ class TestOozieServer(RMFTestCase):
     self.assertEqual(glob_mock.call_count,1)
     
glob_mock.assert_called_with('/usr/hdp/2.2.1.0-2135/hadoop/lib/hadoop-lzo*.jar')
 
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-client', u'2.2.1.0-2135'),
+      sudo = True )
+
     self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-server', u'2.2.1.0-2135'),
       sudo = True )
 
@@ -1250,6 +1256,7 @@ class TestOozieServer(RMFTestCase):
     mocks_dict = {}
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/oozie_server.py",
      classname = "OozieServer", command = "pre_upgrade_restart", config_dict = 
json_content,
+     config_overrides = self.CONFIG_OVERRIDES,
      stack_version = self.UPGRADE_STACK_VERSION,
      target = RMFTestCase.TARGET_COMMON_SERVICES,
      call_mocks = [(0, None, ''), (0, prepare_war_stdout)],
@@ -1266,6 +1273,8 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Link', '/etc/oozie/conf',
                               to = '/usr/hdp/current/oozie-client/conf',
     )
+
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-client', '2.3.0.0-1234'), sudo = True)
     self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-server', '2.3.0.0-1234'), sudo = True)
 
     self.assertResourceCalled('Directory', 
'/usr/hdp/current/oozie-server/libext', mode = 0777)
@@ -1313,6 +1322,7 @@ class TestOozieServer(RMFTestCase):
     self.assertEqual(isfile_mock.call_count,1)
     isfile_mock.assert_called_with('/usr/share/HDP-oozie/ext-2.2.zip')
 
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-client', u'2.2.0.0-0000'), sudo = True)
     self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-server', u'2.2.0.0-0000'), sudo = True)
 
     self.assertResourceCalled('Directory', 
'/usr/hdp/current/oozie-server/libext',mode = 0777)
@@ -1507,6 +1517,7 @@ class TestOozieServer(RMFTestCase):
     
glob_mock.assert_called_with('/usr/hdp/2.3.0.0-1234/hadoop/lib/hadoop-lzo*.jar')
 
     self.assertResourceCalled('Link', '/etc/oozie/conf', to = 
'/usr/hdp/current/oozie-client/conf')
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-client', '2.3.0.0-1234'), sudo = True)
     self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'oozie-server', '2.3.0.0-1234'), sudo = True)
 
     self.assertResourceCalled('Directory', 
'/usr/hdp/current/oozie-server/libext', mode = 0777)

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py
index 804abe7..63076f9 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py
@@ -25,6 +25,8 @@ class TestPigClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "PIG/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"PIG", "role":"PIG"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/pig_client.py",
                        classname = "PigClient",
@@ -143,6 +145,7 @@ class TestPigClient(RMFTestCase):
                        classname = "PigClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -161,6 +164,7 @@ class TestPigClient(RMFTestCase):
                        classname = "PigClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, '')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py 
b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
index 87b8fec..4622ae3 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/SQOOP/test_sqoop.py
@@ -25,6 +25,8 @@ class TestSqoop(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "SQOOP/1.4.4.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"SQOOP", "role":"SQOOP"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/sqoop_client.py",
                        classname = "SqoopClient",
@@ -136,6 +138,7 @@ class TestSqoop(RMFTestCase):
                        classname = "SqoopClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
index b29cfb5..e156af2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
@@ -34,7 +34,9 @@ class TestHistoryServer(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
-  
+
+  CONFIG_OVERRIDES = {"serviceName":"MAPREDUCE2", "role":"HISTORYSERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/historyserver.py",
                        classname="HistoryServer",
@@ -764,6 +766,7 @@ class TestHistoryServer(RMFTestCase):
                        classname = "HistoryServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, None), (0, None, 
None), (0, None, None), (0, None, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
index 7e06969..5898355 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
@@ -34,6 +34,8 @@ class TestMapReduce2Client(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"MAPREDUCE2", "role":"MAPREDUCE2_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/mapreduce2_client.py",
                        classname = "MapReduce2Client",
@@ -390,6 +392,7 @@ class TestMapReduce2Client(RMFTestCase):
                    classname = "MapReduce2Client",
                    command = "restart",
                    config_file="client-upgrade.json",
+                   config_overrides = self.CONFIG_OVERRIDES,
                    stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES
     )
@@ -410,6 +413,7 @@ class TestMapReduce2Client(RMFTestCase):
                        classname = "MapReduce2Client",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -439,6 +443,7 @@ class TestMapReduce2Client(RMFTestCase):
                        classname = "MapReduce2Client",
                        command = "stack_upgrade_save_new_config",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
index dfbdd23..4281696 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
@@ -34,6 +34,8 @@ class TestNodeManager(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"YARN", "role":"NODEMANAGER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/nodemanager.py",
                        classname="Nodemanager",
@@ -581,6 +583,7 @@ class TestNodeManager(RMFTestCase):
       classname = "Nodemanager",
       command = "post_upgrade_restart",
       config_file = "default.json",
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       checked_call_mocks = [(0, process_output)],
@@ -609,6 +612,7 @@ class TestNodeManager(RMFTestCase):
                          classname="Nodemanager",
                          command = "post_upgrade_restart",
                          config_file="default.json",
+                         config_overrides = self.CONFIG_OVERRIDES,
                          stack_version = self.STACK_VERSION,
                          target = RMFTestCase.TARGET_COMMON_SERVICES,
                          call_mocks = [(0, process_output)],
@@ -632,6 +636,7 @@ class TestNodeManager(RMFTestCase):
                          classname="Nodemanager",
                          command = "post_upgrade_restart",
                          config_file="default.json",
+                         config_overrides = self.CONFIG_OVERRIDES,
                          stack_version = self.STACK_VERSION,
                          target = RMFTestCase.TARGET_COMMON_SERVICES,
                          call_mocks = [(999, process_output)],
@@ -655,6 +660,7 @@ class TestNodeManager(RMFTestCase):
                        classname = "Nodemanager",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
index 5ccd6a4..652fea8 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
@@ -37,6 +37,8 @@ class TestResourceManager(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"YARN", "role":"RESOURCEMANAGER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/resourcemanager.py",
                        classname="Resourcemanager",
@@ -547,6 +549,7 @@ class TestResourceManager(RMFTestCase):
                        classname = "Resourcemanager",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
index f71c93a..09a6278 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
@@ -34,6 +34,8 @@ class TestYarnClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"YARN", "role":"YARN_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/yarn_client.py",
                        classname = "YarnClient",
@@ -556,6 +558,7 @@ class TestYarnClient(RMFTestCase):
                    classname = "YarnClient",
                    command = "restart",
                    config_file="client-upgrade.json",
+                   config_overrides = self.CONFIG_OVERRIDES,
                    stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES
     )
@@ -577,6 +580,7 @@ class TestYarnClient(RMFTestCase):
                        classname = "YarnClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_client.py 
b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_client.py
index e4c6fbd..f074036 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_client.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_client.py
@@ -27,6 +27,8 @@ class TestZookeeperClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "ZOOKEEPER/3.4.5/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"ZOOKEEPER", "role":"ZOOKEEPER_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/zookeeper_client.py",
                        classname = "ZookeeperClient",
@@ -170,6 +172,7 @@ class TestZookeeperClient(RMFTestCase):
                        classname = "ZookeeperClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -191,6 +194,7 @@ class TestZookeeperClient(RMFTestCase):
                        classname = "ZookeeperClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py
index 6d38a67..bc58e56 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py
@@ -28,6 +28,8 @@ class TestZookeeperServer(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "ZOOKEEPER/3.4.5/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = {"serviceName":"ZOOKEEPER", "role":"ZOOKEEPER_SERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/zookeeper_server.py",
                        classname = "ZookeeperServer",
@@ -257,6 +259,7 @@ class TestZookeeperServer(RMFTestCase):
                        classname = "ZookeeperServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -278,6 +281,7 @@ class TestZookeeperServer(RMFTestCase):
                        classname = "ZookeeperServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -313,6 +317,7 @@ class TestZookeeperServer(RMFTestCase):
                        classname = "ZookeeperServer",
                        command = "post_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
index 19c785c..caef738 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
@@ -26,13 +26,15 @@ from resource_management.libraries.functions import 
conf_select
 @patch("os.path.exists", new = MagicMock(return_value=True))
 @patch("os.path.isfile", new = MagicMock(return_value=False))
 class TestHookAfterInstall(RMFTestCase):
+  CONFIG_OVERRIDES = {"serviceName":"HIVE", "role":"HIVE_SERVER"}
 
   def test_hook_default(self):
 
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
                        classname="AfterInstallHook",
                        command="hook",
-                       config_file="default.json"
+                       config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES
     )
     self.assertResourceCalled('XmlConfig', 'core-site.xml',
                               owner = 'hdfs',
@@ -49,7 +51,7 @@ class TestHookAfterInstall(RMFTestCase):
     self.assertNoMoreResources()
 
 
-  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1243"))
+  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1234"))
   @patch("resource_management.libraries.functions.conf_select.create")
   @patch("resource_management.libraries.functions.conf_select.select")
   @patch("os.symlink")
@@ -72,11 +74,12 @@ class TestHookAfterInstall(RMFTestCase):
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
                        classname="AfterInstallHook",
                        command="hook",
-                       config_dict = json_content)
+                       config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES)
 
 
-    self.assertResourceCalled('Execute', 'ambari-sudo.sh /usr/bin/hdp-select 
set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail 
-1`',
-      only_if = 'ls -d /usr/hdp/2.3*')
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.3.0.0-1234'),
+      sudo = True)
 
     self.assertResourceCalled('XmlConfig', 'core-site.xml',
       owner = 'hdfs',
@@ -116,7 +119,7 @@ class TestHookAfterInstall(RMFTestCase):
 
     self.assertNoMoreResources()
 
-  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1243"))
+  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1234"))
   @patch("resource_management.libraries.functions.conf_select.create")
   @patch("resource_management.libraries.functions.conf_select.select")
   @patch("os.symlink")
@@ -145,11 +148,12 @@ class TestHookAfterInstall(RMFTestCase):
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
                        classname="AfterInstallHook",
                        command="hook",
-                       config_dict = json_content)
+                       config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES)
 
 
-    self.assertResourceCalled('Execute', 'ambari-sudo.sh /usr/bin/hdp-select 
set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail 
-1`',
-      only_if = 'ls -d /usr/hdp/2.3*')
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.3.0.0-1234'),
+      sudo = True)
 
     self.assertResourceCalled('XmlConfig', 'core-site.xml',
       owner = 'hdfs',
@@ -190,7 +194,7 @@ class TestHookAfterInstall(RMFTestCase):
     self.assertNoMoreResources()
 
 
-  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1243"))
+  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1234"))
   @patch("resource_management.libraries.functions.conf_select.create")
   @patch("resource_management.libraries.functions.conf_select.select")
   @patch("os.symlink")
@@ -224,12 +228,13 @@ class TestHookAfterInstall(RMFTestCase):
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
       classname="AfterInstallHook",
       command="hook",
-      config_dict = json_content)
+      config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES)
 
-    self.assertResourceCalled('Execute', 'ambari-sudo.sh /usr/bin/hdp-select 
set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3.0.0-1234 | 
tail -1`',
-      only_if = 'ls -d /usr/hdp/2.3.0.0-1234*')
+    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.3.0.0-1234'),
+      sudo = True)
 
-  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1243"))
+  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1234"))
   @patch("resource_management.libraries.functions.conf_select.create")
   @patch("resource_management.libraries.functions.conf_select.select")
   @patch("os.symlink")
@@ -253,7 +258,8 @@ class TestHookAfterInstall(RMFTestCase):
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
                        classname="AfterInstallHook",
                        command="hook",
-                       config_dict = json_content)
+                       config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES)
 
     # same assertions as test_hook_default_conf_select, but skip hdp-select 
set all
 
@@ -297,7 +303,7 @@ class TestHookAfterInstall(RMFTestCase):
 
 
   @patch("resource_management.core.Logger.warning")
-  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1243"))
+  @patch("shared_initialization.load_version", new = 
MagicMock(return_value="2.3.0.0-1234"))
   @patch("resource_management.libraries.functions.conf_select.create")
   @patch("resource_management.libraries.functions.conf_select.select")
   @patch("os.symlink")
@@ -326,6 +332,7 @@ class TestHookAfterInstall(RMFTestCase):
     self.executeScript("2.0.6/hooks/after-INSTALL/scripts/hook.py",
                        classname="AfterInstallHook",
                        command="hook",
-                       config_dict = json_content)
+                       config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES)
 
-    logger_warning_mock.assert_any_call('Skipping running stack-selector-tool 
for stack 2.3.0.0-1234 as its a sys_prepped host. This may cause symlink 
pointers not to be created for HDP componets installed later on top of an 
already sys_prepped host.')
+    logger_warning_mock.assert_any_call('Skipping running stack-selector-tool 
becase this is a sys_prepped host. This may cause symlink pointers not to be 
created for HDP componets installed later on top of an already sys_prepped 
host.')

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 b9747a2..dcc649d 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
@@ -27,6 +27,8 @@ class TestFalconClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "FALCON/0.5.0.2.1/package"
   STACK_VERSION = "2.1"
 
+  CONFIG_OVERRIDES = {"serviceName":"FALCON", "role":"FALCON_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/falcon_client.py",
                        classname="FalconClient",
@@ -101,6 +103,7 @@ class TestFalconClient(RMFTestCase):
                        classname = "FalconClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -120,6 +123,7 @@ class TestFalconClient(RMFTestCase):
                        classname = "FalconClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 44da365..a7e6a1e 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
@@ -33,6 +33,8 @@ class TestFalconServer(RMFTestCase):
   UPGRADE_STACK_VERSION = "2.2"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"FALCON", "role":"FALCON_SERVER"}
+
   def test_start_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/falcon_server.py",
       classname="FalconServer",
@@ -225,6 +227,7 @@ class TestFalconServer(RMFTestCase):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/falcon_server.py",
      classname = "FalconServer", command = "restart", config_file = 
"falcon-upgrade.json",
+     config_overrides = self.CONFIG_OVERRIDES,
      stack_version = self.UPGRADE_STACK_VERSION,
      target = RMFTestCase.TARGET_COMMON_SERVICES )
 
@@ -427,6 +430,7 @@ class TestFalconServer(RMFTestCase):
                        classname = "FalconServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -463,6 +467,7 @@ class TestFalconServer(RMFTestCase):
                        classname = "FalconServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py 
b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
index e34734c..e3ed890 100644
--- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py
@@ -33,6 +33,8 @@ class TestHiveMetastore(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
 
+  CONFIG_OVERRIDES = { "serviceName" : "HIVE", "role" : "HIVE_METASTORE" }
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/hive_metastore.py",
                        classname = "HiveMetastore",
@@ -416,6 +418,7 @@ class TestHiveMetastore(RMFTestCase):
                        classname = "HiveMetastore",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -437,6 +440,7 @@ class TestHiveMetastore(RMFTestCase):
                        classname = "HiveMetastore",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -551,6 +555,7 @@ class TestHiveMetastore(RMFTestCase):
       classname = "HiveMetastore",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = [(0, None, ''), (0, None)],
@@ -570,7 +575,7 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalledIgnoreEarlier('Directory', '/var/lib/hive', owner 
= 'hive', group = 'hadoop',
       mode = 0755, create_parents = True, cd_access = 'a')
 
-    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-server2/lib/ojdbc6.jar'),
+    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-metastore/lib/ojdbc6.jar'),
         path = ['/bin', '/usr/bin/'],
         sudo = True)
 
@@ -586,7 +591,7 @@ class TestHiveMetastore(RMFTestCase):
 
     self.assertResourceCalled('File', 
'/usr/hdp/2.3.0.0-1234/hive/lib/mysql-connector-java.jar',
         mode = 0644)
-    self.assertResourceCalled('File', 
'/usr/hdp/current/hive-server2/conf/conf.server/hadoop-metrics2-hivemetastore.properties',
+    self.assertResourceCalled('File', 
'/usr/hdp/current/hive-metastore/conf/conf.server/hadoop-metrics2-hivemetastore.properties',
         content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
         owner = 'hive',
         group = 'hadoop',
@@ -596,7 +601,7 @@ class TestHiveMetastore(RMFTestCase):
         content = StaticFile('startMetastore.sh'),
         mode = 0755,
     )
-    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-server2/lib/ojdbc6.jar'),
+    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-metastore/lib/ojdbc6.jar'),
         path = ['/bin', '/usr/bin/'],
         sudo = True,
     )
@@ -760,6 +765,7 @@ class TestHiveMetastore(RMFTestCase):
                        classname = "HiveMetastore",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -776,7 +782,7 @@ class TestHiveMetastore(RMFTestCase):
       mode = 0755, create_parents = True, cd_access = 'a')
 
     self.assertResourceCalled('Execute',
-                              ('rm', '-f', 
'/usr/hdp/current/hive-server2/lib/ojdbc6.jar'),
+                              ('rm', '-f', 
'/usr/hdp/current/hive-metastore/lib/ojdbc6.jar'),
                               path=["/bin", "/usr/bin/"],
                               sudo = True)
 
@@ -790,22 +796,22 @@ class TestHiveMetastore(RMFTestCase):
                               sudo = True)
 
     self.assertResourceCalled('Execute',
-                              ('yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/java/* /usr/hdp/current/hive-server2/lib'))
+                              ('yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/java/* /usr/hdp/current/hive-metastore/lib'))
 
     self.assertResourceCalled('Directory',
-                              '/usr/hdp/current/hive-server2/lib/native/lib64',
+                              
'/usr/hdp/current/hive-metastore/lib/native/lib64',
                               create_parents = True)
 
     self.assertResourceCalled('Execute',
-                              ('yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/native/lib64/* 
/usr/hdp/current/hive-server2/lib/native/lib64'))
+                              ('yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/native/lib64/* 
/usr/hdp/current/hive-metastore/lib/native/lib64'))
 
     self.assertResourceCalled('Execute',
-                              ('ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-server2/lib/*'))
+                              ('ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-metastore/lib/*'))
 
     self.assertResourceCalled('File', 
'/usr/hdp/2.3.0.0-1234/hive/lib/sqla-client-jdbc.tar.gz',
                               mode = 0644,
                               )
-    self.assertResourceCalled('File', 
'/usr/hdp/current/hive-server2/conf/conf.server/hadoop-metrics2-hivemetastore.properties',
+    self.assertResourceCalled('File', 
'/usr/hdp/current/hive-metastore/conf/conf.server/hadoop-metrics2-hivemetastore.properties',
         content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
         owner = 'hive',
         group = 'hadoop',
@@ -815,7 +821,7 @@ class TestHiveMetastore(RMFTestCase):
         content = StaticFile('startMetastore.sh'),
         mode = 0755,
     )
-    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-server2/lib/ojdbc6.jar'),
+    self.assertResourceCalled('Execute', ('rm', '-f', 
'/usr/hdp/current/hive-metastore/lib/ojdbc6.jar'),
         path = ['/bin', '/usr/bin/'],
         sudo = True,
     )
@@ -825,34 +831,34 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Execute', ('tar', '-xvf', 
u'/tmp/sqla-client-jdbc.tar.gz', '-C', '/tmp'),
         sudo = True,
     )
-    self.assertResourceCalled('Execute', 'yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/java/* /usr/hdp/current/hive-server2/lib',)
-    self.assertResourceCalled('Directory', 
'/usr/hdp/current/hive-server2/lib/native/lib64',
+    self.assertResourceCalled('Execute', 'yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/java/* /usr/hdp/current/hive-metastore/lib',)
+    self.assertResourceCalled('Directory', 
'/usr/hdp/current/hive-metastore/lib/native/lib64',
         create_parents = True,
     )
-    self.assertResourceCalled('Execute', 'yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/native/lib64/* 
/usr/hdp/current/hive-server2/lib/native/lib64',)
-    self.assertResourceCalled('Execute', 'ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-server2/lib/*',)
+    self.assertResourceCalled('Execute', 'yes | ambari-sudo.sh cp 
/tmp/sqla-client-jdbc/native/lib64/* 
/usr/hdp/current/hive-metastore/lib/native/lib64',)
+    self.assertResourceCalled('Execute', 'ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-metastore/lib/*',)
     self.assertResourceCalled('File', 
'/usr/hdp/2.3.0.0-1234/hive/lib/sqla-client-jdbc.tar.gz',
         mode = 0644,
     )
     self.assertResourceCalled('Execute',
-                              ('yes | ambari-sudo.sh cp 
/usr/hdp/current/hive-server2/lib/*.jar /usr/hdp/2.3.0.0-1234/hive/lib'))
+                              ('yes | ambari-sudo.sh cp 
/usr/hdp/current/hive-metastore/lib/*.jar /usr/hdp/2.3.0.0-1234/hive/lib'))
 
     self.assertResourceCalled('Directory',
                               '/usr/hdp/2.3.0.0-1234/hive/lib/native/lib64',
                               create_parents = True)
 
     self.assertResourceCalled('Execute',
-                              ('yes | ambari-sudo.sh cp 
/usr/hdp/current/hive-server2/lib/native/lib64/* 
/usr/hdp/2.3.0.0-1234/hive/lib/native/lib64'))
+                              ('yes | ambari-sudo.sh cp 
/usr/hdp/current/hive-metastore/lib/native/lib64/* 
/usr/hdp/2.3.0.0-1234/hive/lib/native/lib64'))
 
     self.assertResourceCalled('Execute',
-                              ('ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-server2/lib/*'))
+                              ('ambari-sudo.sh chown -R hive:hadoop 
/usr/hdp/current/hive-metastore/lib/*'))
 
     self.assertResourceCalled('File', 
'/usr/hdp/2.3.0.0-1234/hive/lib/sqla-client-jdbc.tar.gz',
                               mode = 0644,
                               )
 
     self.assertResourceCalled('Execute', 
"/usr/hdp/2.3.0.0-1234/hive/bin/schematool -dbType sqlanywhere -upgradeSchema",
-                              logoutput = True, environment = 
{'HIVE_CONF_DIR': '/usr/hdp/current/hive-server2/conf/conf.server'},
+                              logoutput = True, environment = 
{'HIVE_CONF_DIR': '/usr/hdp/current/hive-metastore/conf/conf.server'},
                               tries = 1, user = 'hive')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 f208d3a..608b156 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
@@ -27,6 +27,8 @@ from test_storm_base import TestStormBase
 
@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0, '123', '')))
 class TestStormDrpcServer(TestStormBase):
 
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"DRPC_SERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/drpc_server.py",
                        classname = "DrpcServer",
@@ -144,6 +146,7 @@ class TestStormDrpcServer(TestStormBase):
                      classname = "DrpcServer",
                      command = "pre_upgrade_restart",
                      config_file="default.json",
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -161,6 +164,7 @@ class TestStormDrpcServer(TestStormBase):
                      classname = "DrpcServer",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 fd25126..ab5da22 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
@@ -26,6 +26,7 @@ from test_storm_base import TestStormBase
 
 
@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0, '123', '')))
 class TestStormNimbus(TestStormBase):
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"NIMBUS"}
 
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nimbus.py",
@@ -282,6 +283,7 @@ class TestStormNimbus(TestStormBase):
                        classname = "Nimbus",
                        command = "pre_upgrade_restart",
                        config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -300,6 +302,7 @@ class TestStormNimbus(TestStormBase):
                      classname = "Nimbus",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 850a98b..efa50c8 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
@@ -25,6 +25,7 @@ import resource_management.core.source
 from test_storm_base import TestStormBase
 
 class TestStormNimbus(TestStormBase):
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"NIMBUS"}
 
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/nimbus_prod.py",
@@ -117,6 +118,7 @@ class TestStormNimbus(TestStormBase):
                        classname = "Nimbus",
                        command = "pre_upgrade_restart",
                        config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -136,6 +138,7 @@ class TestStormNimbus(TestStormBase):
                      classname = "Nimbus",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None, '')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 b7ec7ba..116597b 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
@@ -27,6 +27,8 @@ from test_storm_base import TestStormBase
 
@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0, '123', '')))
 class TestStormSupervisor(TestStormBase):
 
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"SUPERVISOR"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/supervisor.py",
                        classname = "Supervisor",
@@ -182,6 +184,7 @@ class TestStormSupervisor(TestStormBase):
                        classname = "Supervisor",
                        command = "pre_upgrade_restart",
                        config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -200,6 +203,7 @@ class TestStormSupervisor(TestStormBase):
                      classname = "Supervisor",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 21c5f2c..46221a9 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
@@ -27,6 +27,8 @@ from test_storm_base import TestStormBase
 
@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0, '123', '')))
 class TestStormSupervisor(TestStormBase):
 
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"SUPERVISOR"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/supervisor_prod.py",
                        classname = "Supervisor",
@@ -159,6 +161,7 @@ class TestStormSupervisor(TestStormBase):
                        classname = "Supervisor",
                        command = "pre_upgrade_restart",
                        config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -178,6 +181,7 @@ class TestStormSupervisor(TestStormBase):
                      classname = "Supervisor",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 3ac38c7..985c754 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
@@ -27,6 +27,8 @@ from test_storm_base import TestStormBase
 
@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0, '123', '')))
 class TestStormUiServer(TestStormBase):
 
+  CONFIG_OVERRIDES = {"serviceName":"STORM", "role":"STORM_UI_SERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/ui_server.py",
                        classname = "UiServer",
@@ -209,10 +211,10 @@ class TestStormUiServer(TestStormBase):
     )
     self.assertNoMoreResources()
 
-  def test_pre_upgrade_restart(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/ui_server.py",
                        classname = "UiServer",
                        command = "pre_upgrade_restart",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        config_file="default.json",
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
@@ -231,6 +233,7 @@ class TestStormUiServer(TestStormBase):
                      classname = "UiServer",
                      command = "pre_upgrade_restart",
                      config_dict = json_content,
+                     config_overrides = self.CONFIG_OVERRIDES,
                      stack_version = self.STACK_VERSION,
                      target = RMFTestCase.TARGET_COMMON_SERVICES,
                      call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/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 e63090a..bd7567a 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
@@ -27,6 +27,8 @@ class TestTezClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "TEZ/0.4.0.2.1/package"
   STACK_VERSION = "2.1"
 
+  CONFIG_OVERRIDES = {"serviceName":"TEZ", "role":"TEZ_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/tez_client.py",
                        classname = "TezClient",
@@ -70,6 +72,7 @@ class TestTezClient(RMFTestCase):
                        classname = "TezClient",
                        command = "restart",
                        config_file="client-upgrade.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -84,6 +87,7 @@ class TestTezClient(RMFTestCase):
                        classname = "TezClient",
                        command = "restart",
                        config_file="client-upgrade.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py 
b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
index 530d1d9..ad2d25f 100644
--- a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
+++ b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py
@@ -34,6 +34,8 @@ class TestAppTimelineServer(RMFTestCase):
   STACK_VERSION = "2.0.6"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"YARN", "role":"APP_TIMELINE_SERVER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/application_timeline_server.py",
                        classname="ApplicationTimelineServer",
@@ -279,6 +281,7 @@ class TestAppTimelineServer(RMFTestCase):
                        classname = "ApplicationTimelineServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, '')],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.2/ACCUMULO/test_accumulo_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/ACCUMULO/test_accumulo_client.py 
b/ambari-server/src/test/python/stacks/2.2/ACCUMULO/test_accumulo_client.py
index e3430e5..3ffd0a9 100644
--- a/ambari-server/src/test/python/stacks/2.2/ACCUMULO/test_accumulo_client.py
+++ b/ambari-server/src/test/python/stacks/2.2/ACCUMULO/test_accumulo_client.py
@@ -29,6 +29,8 @@ class TestAccumuloClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "ACCUMULO/1.6.1.2.2.0/package"
   STACK_VERSION = "2.1"
 
+  CONFIG_OVERRIDES = {"serviceName":"ACCUMULO", "role":"ACCUMULO_CLIENT"}
+
   def test_pre_upgrade_restart(self):
     config_file = self.get_src_folder() + 
"/test/python/stacks/2.2/configs/default.json"
     with open(config_file, "r") as f:
@@ -41,6 +43,7 @@ class TestAccumuloClient(RMFTestCase):
       classname = "AccumuloClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -62,6 +65,7 @@ class TestAccumuloClient(RMFTestCase):
       classname = "AccumuloClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py 
b/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
index d6afa50..477830e 100644
--- a/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
+++ b/ambari-server/src/test/python/stacks/2.2/KAFKA/test_kafka_broker.py
@@ -28,6 +28,8 @@ class TestKafkaBroker(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "KAFKA/0.8.1/package"
   STACK_VERSION = "2.2"
 
+  CONFIG_OVERRIDES = {"serviceName":"KAFKA", "role":"KAFKA_BROKER"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/kafka_broker.py",
                          classname = "KafkaBroker",
@@ -133,6 +135,7 @@ class TestKafkaBroker(RMFTestCase):
                        classname = "KafkaBroker",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
     self.assertResourceCalled('Execute',
@@ -152,6 +155,7 @@ class TestKafkaBroker(RMFTestCase):
                        classname = "KafkaBroker",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py 
b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
index 638f92e..d4dcc48 100644
--- a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
+++ b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
@@ -27,6 +27,8 @@ class TestSliderClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "SLIDER/0.60.0.2.2/package"
   STACK_VERSION = "2.2"
 
+  CONFIG_OVERRIDES = {"serviceName":"SLIDER", "role":"SLIDER"}
+
   def test_configure_default(self):
     self.maxDiff = None
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/slider_client.py",
@@ -168,6 +170,7 @@ class TestSliderClient(RMFTestCase):
                        classname = "SliderClient",
                        command = "pre_upgrade_restart",
                        config_file="default.json",
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -187,6 +190,7 @@ class TestSliderClient(RMFTestCase):
                        classname = "SliderClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None, ''), (0, None, 
''), (0, None, '')],
@@ -194,6 +198,8 @@ class TestSliderClient(RMFTestCase):
 
     self.assertResourceCalledIgnoreEarlier("Execute", ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'slider-client', '2.3.0.0-1234'), sudo=True)
     self.assertResourceCalledIgnoreEarlier("Execute", ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hadoop-client', '2.3.0.0-1234'), sudo=True)
+    self.assertResourceCalled('Link', '/etc/hadoop/conf', 
to='/usr/hdp/current/hadoop-client/conf')
+
     self.assertNoMoreResources()
 
     self.assertEquals(2, mocks_dict['call'].call_count)

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py 
b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
index 186ff72..b87f8fc 100644
--- a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
+++ b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
@@ -30,6 +30,8 @@ class TestJobHistoryServer(RMFTestCase):
   STACK_VERSION = "2.2"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"SPARK", "role":"SPARK_JOBHISTORYSERVER"}
+
   @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs")
   def test_configure_default(self, copy_to_hdfs_mock):
     copy_to_hdfs_mock = True
@@ -334,6 +336,7 @@ class TestJobHistoryServer(RMFTestCase):
                        classname = "JobHistoryServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py 
b/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
index 0921edc..3fe59ad 100644
--- a/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
+++ b/ambari-server/src/test/python/stacks/2.2/SPARK/test_spark_client.py
@@ -29,6 +29,8 @@ class TestSparkClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "SPARK/1.2.1/package"
   STACK_VERSION = "2.2"
 
+  CONFIG_OVERRIDES = {"serviceName":"SPARK", "role":"SPARK_CLIENT"}
+
   def test_configure_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/spark_client.py",
                    classname = "SparkClient",
@@ -163,6 +165,7 @@ class TestSparkClient(RMFTestCase):
                        classname = "SparkClient",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
@@ -192,6 +195,7 @@ class TestSparkClient(RMFTestCase):
                        classname = "SparkClient",
                        command = "stack_upgrade_save_new_config",
                        config_dict = json_content,
+                       config_overrides =  self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py 
b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
index 17be97f..9286b7a 100644
--- a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
+++ b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
@@ -29,6 +29,8 @@ class TestMahoutClient(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "MAHOUT/1.0.0.2.3/package"
   STACK_VERSION = "2.3"
 
+  CONFIG_OVERRIDES = {"serviceName":"MAHOUT", "role":"MAHOUT"}
+
   def test_configure_default(self):
     self.executeScript(
       self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/mahout_client.py",
@@ -73,6 +75,7 @@ class TestMahoutClient(RMFTestCase):
       classname = "MahoutClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES)
 
@@ -98,6 +101,7 @@ class TestMahoutClient(RMFTestCase):
       classname = "MahoutClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
+      config_overrides = self.CONFIG_OVERRIDES,
       stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = itertools.cycle([(0, None, '')]),

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py 
b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
index e8e9320..ddd1ab3 100644
--- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
@@ -30,6 +30,8 @@ class TestSparkThriftServer(RMFTestCase):
   STACK_VERSION = "2.3"
   DEFAULT_IMMUTABLE_PATHS = ['/apps/hive/warehouse', '/apps/falcon', 
'/mr-history/done', '/app-logs', '/tmp']
 
+  CONFIG_OVERRIDES = {"serviceName":"SPARK", "role":"SPARK_THRIFTSERVER"}
+
   @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs")
   def test_configure_default(self, copy_to_hdfs_mock):
     copy_to_hdfs_mock = True
@@ -180,6 +182,7 @@ class TestSparkThriftServer(RMFTestCase):
                        classname = "SparkThriftServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
+                       config_overrides = self.CONFIG_OVERRIDES,
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py 
b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 2f3794d..e48c8c7 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -109,6 +109,9 @@ class RMFTestCase(TestCase):
     if "stack_features" not in 
self.config_dict["configurations"]["cluster-env"]:
       self.config_dict["configurations"]["cluster-env"]["stack_features"] = 
RMFTestCase.get_stack_features()
 
+    if "stack_select_packages" not in 
self.config_dict["configurations"]["cluster-env"]:
+      
self.config_dict["configurations"]["cluster-env"]["stack_select_packages"] = 
RMFTestCase.get_stack_select_packages()
+
     if config_overrides:
       for key, value in config_overrides.iteritems():
         self.config_dict[key] = value
@@ -192,6 +195,15 @@ class RMFTestCase(TestCase):
       return f.read()
 
   @staticmethod
+  def get_stack_select_packages():
+    """
+    Read stack_select_packages config property from 
resources/stacks/HDP/2.0.6/properties/stack_features.json
+    """
+    stack_features_file = os.path.join(RMFTestCase.get_src_folder(), 
PATH_TO_STACKS, "2.0.6", "properties", "stack_select_packages.json")
+    with open(stack_features_file, "r") as f:
+      return f.read()
+
+  @staticmethod
   def _getStackTestsFolder():
     return os.path.join(RMFTestCase.get_src_folder(), PATH_TO_STACK_TESTS)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bab2159/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
----------------------------------------------------------------------
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
index 8a583b3..8bae9e6 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
@@ -28,7 +28,7 @@ class AfterInstallHook(Hook):
     import params
 
     env.set_params(params)
-    setup_stack_symlinks()
+    setup_stack_symlinks(self.stroutfile)
     setup_config()
 
     link_configs(self.stroutfile)

Reply via email to