Repository: ambari
Updated Branches:
  refs/heads/trunk c583afb58 -> bd891629e


AMBARI-16956. Ensure smokeuser HDFS folder exists before running MR, YARN, PIG, 
OOZIE service checks (magyari_sandor)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bd891629
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bd891629
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bd891629

Branch: refs/heads/trunk
Commit: bd891629ea04de92a62424a1bc4ab1cb912770eb
Parents: c583afb
Author: Sandor Magyari <[email protected]>
Authored: Thu May 26 16:55:53 2016 +0200
Committer: Sandor Magyari <[email protected]>
Committed: Thu Jun 2 21:38:00 2016 +0200

----------------------------------------------------------------------
 .../MAHOUT/1.0.0.2.3/package/scripts/params.py  |  1 +
 .../1.0.0.2.3/package/scripts/service_check.py  |  7 +++++
 .../4.0.0.2.0/package/scripts/params_linux.py   |  1 +
 .../4.0.0.2.0/package/scripts/service_check.py  |  7 +++++
 .../0.12.0.2.0/package/scripts/params_linux.py  |  1 +
 .../0.12.0.2.0/package/scripts/service_check.py |  7 +++++
 .../package/scripts/mapred_service_check.py     |  7 +++++
 .../2.1.0.2.0/package/scripts/params_linux.py   |  2 ++
 .../2.1.0.2.0/package/scripts/service_check.py  |  7 +++++
 .../stacks/2.0.6/OOZIE/test_service_check.py    | 14 +++++++++
 .../stacks/2.0.6/PIG/test_pig_service_check.py  | 29 ++++++++++++++++++-
 .../2.0.6/YARN/test_mapreduce2_service_check.py | 28 ++++++++++++++++++
 .../2.0.6/YARN/test_yarn_service_check.py       | 30 +++++++++++++++++++-
 .../stacks/2.2/PIG/test_pig_service_check.py    | 19 ++++++++++++-
 .../2.3/MAHOUT/test_mahout_service_check.py     | 15 ++++++++++
 15 files changed, 172 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
index 60ebc42..8ef3ba8 100644
--- 
a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
@@ -62,6 +62,7 @@ hdfs_principal_name = 
config['configurations']['hadoop-env']['hdfs_principal_nam
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
 smokeuser = config['configurations']['cluster-env']['smokeuser']
 smokeuser_principal = 
config['configurations']['cluster-env']['smokeuser_principal_name']
+smoke_hdfs_user_mode = 0770
 user_group = config['configurations']['cluster-env']['user_group']
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
index dbb8079..c1151fc 100644
--- 
a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/service_check.py
@@ -38,6 +38,13 @@ class MahoutServiceCheck(Script):
         content = "Test text which will be converted to sequence file.",
         mode = 0755
     )
+
+    params.HdfsResource(format("/user/{smokeuser}"),
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.smokeuser,
+                        mode=params.smoke_hdfs_user_mode,
+                        )
     
     params.HdfsResource(format("/user/{smokeuser}/mahoutsmokeoutput"),
                        action="delete_on_execute",

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index a4edfa3..542be3f 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -111,6 +111,7 @@ execute_path = oozie_bin_dir + os.pathsep + hadoop_bin_dir
 oozie_user = config['configurations']['oozie-env']['oozie_user']
 smokeuser = config['configurations']['cluster-env']['smokeuser']
 smokeuser_principal = 
config['configurations']['cluster-env']['smokeuser_principal_name']
+smoke_hdfs_user_mode = 0770
 
 # This config actually contains {oozie_user}
 oozie_admin_users = 
format(config['configurations']['oozie-env']['oozie_admin_users'])

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
index 8d14836..c7cce86 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
@@ -82,6 +82,13 @@ class OozieServiceCheckDefault(OozieServiceCheck):
             logoutput=True
     )
 
+    params.HdfsResource(format("/user/{smokeuser}"),
+        type="directory",
+        action="create_on_execute",
+        owner=params.smokeuser,
+        mode=params.smoke_hdfs_user_mode,
+        )
+
     examples_dir = format('/user/{smokeuser}/examples')
     params.HdfsResource(examples_dir,
                         action = "delete_on_execute",

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params_linux.py
index b7f798c..5af1274 100644
--- 
a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params_linux.py
@@ -62,6 +62,7 @@ hdfs_principal_name = 
config['configurations']['hadoop-env']['hdfs_principal_nam
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
 smokeuser = config['configurations']['cluster-env']['smokeuser']
 smokeuser_principal = 
config['configurations']['cluster-env']['smokeuser_principal_name']
+smoke_hdfs_user_mode = 0770
 user_group = config['configurations']['cluster-env']['user_group']
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py
index 395295f..e029092 100644
--- 
a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/service_check.py
@@ -45,6 +45,13 @@ class PigServiceCheckLinux(PigServiceCheck):
     input_file = format('/user/{smokeuser}/passwd')
     output_dir = format('/user/{smokeuser}/pigsmoke.out')
 
+    params.HdfsResource(format("/user/{smokeuser}"),
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.smokeuser,
+                        mode=params.smoke_hdfs_user_mode,
+                        )
+
     params.HdfsResource(output_dir,
                         type="directory",
                         action="delete_on_execute",

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py
index d450701..6288ac0 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapred_service_check.py
@@ -27,6 +27,7 @@ from resource_management.core.resources.system import 
Execute, File
 from resource_management.core.source import StaticFile
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
+from resource_management.core.logger import Logger
 
 
 class MapReduce2ServiceCheck(Script):
@@ -124,6 +125,12 @@ class 
MapReduce2ServiceCheckDefault(MapReduce2ServiceCheck):
     test_cmd = format("fs -test -e {output_file}")
     run_wordcount_job = format("jar {jar_path} wordcount {input_file} 
{output_file}")
 
+    params.HdfsResource(format("/user/{smokeuser}"),
+                      type="directory",
+                      action="create_on_execute",
+                      owner=params.smokeuser,
+                      mode=params.smoke_hdfs_user_mode,
+    )
     params.HdfsResource(output_file,
                         action = "delete_on_execute",
                         type = "directory",

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 150fedf..a63abd5 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -135,12 +135,14 @@ hdfs_tmp_dir = 
config['configurations']['hadoop-env']['hdfs_tmp_dir']
 
 smokeuser = config['configurations']['cluster-env']['smokeuser']
 smokeuser_principal = 
config['configurations']['cluster-env']['smokeuser_principal_name']
+smoke_hdfs_user_mode = 0770
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 nm_security_marker_dir = "/var/lib/hadoop-yarn"
 nm_security_marker = format('{nm_security_marker_dir}/nm_security_enabled')
 current_nm_security_state = os.path.isfile(nm_security_marker)
 toggle_nm_security = (current_nm_security_state and not security_enabled) or 
(not current_nm_security_state and security_enabled)
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
+
 yarn_executor_container_group = 
config['configurations']['yarn-site']['yarn.nodemanager.linux-container-executor.group']
 yarn_nodemanager_container_executor_class =  
config['configurations']['yarn-site']['yarn.nodemanager.container-executor.class']
 is_linux_container_executor = (yarn_nodemanager_container_executor_class == 
'org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor')

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index c802c41..6b7e0c3 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -90,6 +90,13 @@ class ServiceCheckDefault(ServiceCheck):
     import params
     env.set_params(params)
 
+    params.HdfsResource(format("/user/{smokeuser}"),
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.smokeuser,
+                        mode=params.smoke_hdfs_user_mode,
+                        )
+
     if params.stack_version_formatted_major and 
check_stack_feature(StackFeature.ROLLING_UPGRADE, 
params.stack_version_formatted_major):
       path_to_distributed_shell_jar = 
format("{stack_root}/current/hadoop-yarn-client/hadoop-yarn-applications-distributedshell.jar")
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
index 84ecf76..ac5e5c0 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
@@ -83,6 +83,20 @@ class TestServiceCheck(RMFTestCase):
         tries = 3,
         try_sleep = 5,
     )
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = False,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name=UnknownConfigurationMock(), 
default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa/examples',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = False,

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
index 100d78a..b31ce57 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
@@ -33,6 +33,20 @@ class TestPigServiceCheck(RMFTestCase):
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = False,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name=UnknownConfigurationMock(), 
default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa/pigsmoke.out',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = False,
@@ -109,7 +123,20 @@ class TestPigServiceCheck(RMFTestCase):
                        stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = True,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = 
'/etc/security/keytabs/hdfs.headless.keytab',
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name='hdfs', default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa/pigsmoke.out',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py
 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py
index 5f97efe..c159c72 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py
@@ -40,6 +40,20 @@ class TestServiceCheck(RMFTestCase):
                       stack_version = self.STACK_VERSION,
                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                             security_enabled = False,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name=UnknownConfigurationMock(), 
default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', 
'/user/ambari-qa/mapredsmokeoutput',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = False,
@@ -100,6 +114,20 @@ class TestServiceCheck(RMFTestCase):
                       stack_version = self.STACK_VERSION,
                       target = RMFTestCase.TARGET_COMMON_SERVICES
     )
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = True,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = 
'/etc/security/keytabs/hdfs.headless.keytab',
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name='hdfs', default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', 
'/user/ambari-qa/mapredsmokeoutput',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
index 320092d..ccd472c 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
@@ -28,6 +28,7 @@ from stacks.utils.RMFTestCase import *
 class TestServiceCheck(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']
 
   @patch("re.search")
   def test_service_check_default(self, re_search_mock):
@@ -44,6 +45,20 @@ class TestServiceCheck(RMFTestCase):
                           checked_call_mocks = [(0, "some test text, 
appTrackingUrl=http:"
                                 
"//c6402.ambari.apache.org:8088/proxy/application_1429885383763_0001/, some 
test text")]
     )
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = False,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name=UnknownConfigurationMock(), 
default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertNoMoreResources()
 
 
@@ -62,5 +77,18 @@ class TestServiceCheck(RMFTestCase):
                           checked_call_mocks = [(0, "some test text, 
appTrackingUrl=http:"
                                
"//c6402.ambari.apache.org:8088/proxy/application_1429885383763_0001/, some 
test text")]
     )
-
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = True,
+                              hadoop_bin_dir = '/usr/bin',
+                              keytab = 
'/etc/security/keytabs/hdfs.headless.keytab',
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name='hdfs', default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = '/etc/hadoop/conf',
+                              type = 'directory',
+                              )
     self.assertNoMoreResources()

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.2/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.2/PIG/test_pig_service_check.py 
b/ambari-server/src/test/python/stacks/2.2/PIG/test_pig_service_check.py
index 906c627..3abc601 100644
--- a/ambari-server/src/test/python/stacks/2.2/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.2/PIG/test_pig_service_check.py
@@ -37,7 +37,24 @@ class TestPigServiceCheck(RMFTestCase):
                        stack_version=self.STACK_VERSION,
                        target=RMFTestCase.TARGET_COMMON_SERVICES
     )
-    
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              dfs_type = '',
+                              security_enabled = True,
+                              hadoop_bin_dir = 
'/usr/hdp/current/hadoop-client/bin',
+                              keytab = 
'/etc/security/keytabs/hdfs.headless.keytab',
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'],
+                              
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+                              
hdfs_site=self.getConfig()['configurations']['hdfs-site'],
+                              principal_name = '[email protected]',
+                              default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = 
'/usr/hdp/current/hadoop-client/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa/pigsmoke.out',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = True,

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd891629/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py 
b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
index 7a3f010..7bda992 100644
--- 
a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
+++ 
b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
@@ -41,6 +41,21 @@ class TestMahoutClient(RMFTestCase):
         content = 'Test text which will be converted to sequence file.',
         mode = 0755,
     )
+    self.maxDiff=None
+    self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = False,
+                              hadoop_bin_dir = 
'/usr/hdp/current/hadoop-client/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              mode = 0770,
+                              owner = 'ambari-qa',
+                              action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name=UnknownConfigurationMock(), 
default_fs='hdfs://c6401.ambari.apache.org:8020',
+                              hadoop_conf_dir = 
'/usr/hdp/current/hadoop-client/conf',
+                              type = 'directory',
+                              )
     self.assertResourceCalled('HdfsResource', 
'/user/ambari-qa/mahoutsmokeoutput',
         immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
         security_enabled = False,

Reply via email to