ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.(vbrodetskyi)
Date Fri, 23 Dec 2016 17:48:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d146df7ee -> 003cebcc8


AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: 003cebcc87a0e9e905728ad04d30a93b083ca8e4
Parents: d146df7
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Fri Dec 23 19:47:21 2016 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Fri Dec 23 19:47:21 2016 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive.py     |  38 ++--
 .../package/scripts/hive_interactive.py         |  20 +-
 .../stacks/2.0.6/HIVE/test_hive_client.py       |  12 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py    |  33 ++-
 .../stacks/2.0.6/HIVE/test_hive_server.py       |  22 +-
 .../stacks/2.1/HIVE/test_hive_metastore.py      |  18 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py     | 206 +++++++++++++------
 7 files changed, 241 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 792aac3..459105f 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -109,7 +109,7 @@ def hive(name=None):
 
   if name == 'hiveserver2':
     # copy tarball to HDFS feature not supported
-    if not (params.stack_version_formatted_major and check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, params.stack_version_formatted_major)):  
+    if not (params.stack_version_formatted_major and check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, params.stack_version_formatted_major)):
       params.HdfsResource(params.webhcat_apps_dir,
                             type="directory",
                             action="create_on_execute",
@@ -226,13 +226,13 @@ def hive(name=None):
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=0644)
+            mode=0600)
 
   # Generate atlas-application.properties.xml file
   if params.enable_atlas_hook:
     atlas_hook_filepath = os.path.join(params.hive_config_dir, params.atlas_hook_filename)
     setup_atlas_hook(SERVICE.HIVE, params.hive_atlas_application_properties, atlas_hook_filepath, params.hive_user, params.user_group)
-  
+
   if name == 'hiveserver2':
     XmlConfig("hiveserver2-site.xml",
               conf_dir=params.hive_server_conf_dir,
@@ -240,7 +240,7 @@ def hive(name=None):
               configuration_attributes=params.config['configuration_attributes']['hiveserver2-site'],
               owner=params.hive_user,
               group=params.user_group,
-              mode=0644)
+              mode=0600)
 
   if params.hive_metastore_site_supported and name == 'metastore':
     XmlConfig("hivemetastore-site.xml",
@@ -249,11 +249,12 @@ def hive(name=None):
               configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'],
               owner=params.hive_user,
               group=params.user_group,
-              mode=0644)
-  
+              mode=0600)
+
   File(format("{hive_config_dir}/hive-env.sh"),
        owner=params.hive_user,
        group=params.user_group,
+       mode=0600,
        content=InlineTemplate(params.hive_env_sh_template)
   )
 
@@ -286,6 +287,7 @@ def hive(name=None):
     File(os.path.join(params.hive_server_conf_dir, "hadoop-metrics2-hivemetastore.properties"),
          owner=params.hive_user,
          group=params.user_group,
+         mode=0600,
          content=Template("hadoop-metrics2-hivemetastore.properties.j2")
     )
 
@@ -328,6 +330,7 @@ def hive(name=None):
     File(os.path.join(params.hive_server_conf_dir, "hadoop-metrics2-hiveserver2.properties"),
          owner=params.hive_user,
          group=params.user_group,
+         mode=0600,
          content=Template("hadoop-metrics2-hiveserver2.properties.j2")
     )
 
@@ -356,11 +359,16 @@ Writes configuration files required by Hive.
 """
 def fill_conf_dir(component_conf_dir):
   import params
+  hive_client_conf_path = os.path.realpath(format("{stack_root}/current/{component_directory}/conf"))
+  component_conf_dir = os.path.realpath(component_conf_dir)
+  mode_identified_for_file = 0644 if component_conf_dir == hive_client_conf_path else 0600
+  mode_identified_for_dir = 0755 if component_conf_dir == hive_client_conf_path else 0700
 
   Directory(component_conf_dir,
             owner=params.hive_user,
             group=params.user_group,
-            create_parents = True
+            create_parents = True,
+            mode=mode_identified_for_dir
   )
 
   XmlConfig("mapred-site.xml",
@@ -369,17 +377,19 @@ def fill_conf_dir(component_conf_dir):
             configuration_attributes=params.config['configuration_attributes']['mapred-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=0644)
+            mode=mode_identified_for_file)
 
 
   File(format("{component_conf_dir}/hive-default.xml.template"),
        owner=params.hive_user,
-       group=params.user_group
+       group=params.user_group,
+       mode=mode_identified_for_file
   )
 
   File(format("{component_conf_dir}/hive-env.sh.template"),
        owner=params.hive_user,
-       group=params.user_group
+       group=params.user_group,
+       mode=mode_identified_for_file
   )
 
   # Create hive-log4j.properties and hive-exec-log4j.properties
@@ -388,14 +398,14 @@ def fill_conf_dir(component_conf_dir):
     log4j_exec_filename = 'hive-exec-log4j.properties'
     if (params.log4j_exec_props != None):
       File(format("{component_conf_dir}/{log4j_exec_filename}"),
-           mode=0644,
+           mode=mode_identified_for_file,
            group=params.user_group,
            owner=params.hive_user,
            content=params.log4j_exec_props
       )
     elif (os.path.exists("{component_conf_dir}/{log4j_exec_filename}.template")):
       File(format("{component_conf_dir}/{log4j_exec_filename}"),
-           mode=0644,
+           mode=mode_identified_for_file,
            group=params.user_group,
            owner=params.hive_user,
            content=StaticFile(format("{component_conf_dir}/{log4j_exec_filename}.template"))
@@ -404,14 +414,14 @@ def fill_conf_dir(component_conf_dir):
     log4j_filename = 'hive-log4j.properties'
     if (params.log4j_props != None):
       File(format("{component_conf_dir}/{log4j_filename}"),
-           mode=0644,
+           mode=mode_identified_for_file,
            group=params.user_group,
            owner=params.hive_user,
            content=params.log4j_props
       )
     elif (os.path.exists("{component_conf_dir}/{log4j_filename}.template")):
       File(format("{component_conf_dir}/{log4j_filename}"),
-           mode=0644,
+           mode=mode_identified_for_file,
            group=params.user_group,
            owner=params.hive_user,
            content=StaticFile(format("{component_conf_dir}/{log4j_filename}.template"))

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index 298db2a..2cee307 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -177,6 +177,7 @@ def hive_interactive(name=None):
       del merged_hive_interactive_site_copy[item]
 
   for conf_dir in hive2_conf_dirs_list:
+      mode_identified = 0644 if conf_dir == hive2_client_conf_path else 0600
       if conf_dir == hive2_client_conf_path:
         XmlConfig("hive-site.xml",
                   conf_dir=conf_dir,
@@ -192,54 +193,54 @@ def hive_interactive(name=None):
                   configuration_attributes=params.config['configuration_attributes']['hive-interactive-site'],
                   owner=params.hive_user,
                   group=params.user_group,
-                  mode=0644)
-
+                  mode=0600)
       XmlConfig("hiveserver2-site.xml",
                 conf_dir=conf_dir,
                 configurations=merged_hiveserver2_interactive_site,
                 configuration_attributes=params.config['configuration_attributes']['hiveserver2-interactive-site'],
                 owner=params.hive_user,
                 group=params.user_group,
-                mode=0644)
+                mode=mode_identified)
 
       hive_server_interactive_conf_dir = conf_dir
 
       File(format("{hive_server_interactive_conf_dir}/hive-env.sh"),
            owner=params.hive_user,
            group=params.user_group,
+           mode=mode_identified,
            content=InlineTemplate(params.hive_interactive_env_sh_template))
 
       llap_daemon_log4j_filename = 'llap-daemon-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{llap_daemon_log4j_filename}"),
-           mode=0644,
+           mode=mode_identified,
            group=params.user_group,
            owner=params.hive_user,
            content=params.llap_daemon_log4j)
 
       llap_cli_log4j2_filename = 'llap-cli-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{llap_cli_log4j2_filename}"),
-           mode=0644,
+           mode=mode_identified,
            group=params.user_group,
            owner=params.hive_user,
            content=params.llap_cli_log4j2)
 
       hive_log4j2_filename = 'hive-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{hive_log4j2_filename}"),
-         mode=0644,
+         mode=mode_identified,
          group=params.user_group,
          owner=params.hive_user,
          content=params.hive_log4j2)
 
       hive_exec_log4j2_filename = 'hive-exec-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{hive_exec_log4j2_filename}"),
-         mode=0644,
+         mode=mode_identified,
          group=params.user_group,
          owner=params.hive_user,
          content=params.hive_exec_log4j2)
 
       beeline_log4j2_filename = 'beeline-log4j2.properties'
       File(format("{hive_server_interactive_conf_dir}/{beeline_log4j2_filename}"),
-         mode=0644,
+         mode=mode_identified,
          group=params.user_group,
          owner=params.hive_user,
          content=params.beeline_log4j2)
@@ -247,17 +248,20 @@ def hive_interactive(name=None):
       File(os.path.join(hive_server_interactive_conf_dir, "hadoop-metrics2-hiveserver2.properties"),
            owner=params.hive_user,
            group=params.user_group,
+           mode=mode_identified,
            content=Template("hadoop-metrics2-hiveserver2.properties.j2")
            )
 
       File(format("{hive_server_interactive_conf_dir}/hadoop-metrics2-llapdaemon.properties"),
            owner=params.hive_user,
            group=params.user_group,
+           mode=mode_identified,
            content=Template("hadoop-metrics2-llapdaemon.j2"))
 
       File(format("{hive_server_interactive_conf_dir}/hadoop-metrics2-llaptaskscheduler.properties"),
            owner=params.hive_user,
            group=params.user_group,
+           mode=mode_identified,
            content=Template("hadoop-metrics2-llaptaskscheduler.j2"))
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/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 b96437d..1a7256f 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
@@ -40,6 +40,7 @@ class TestHiveClient(RMFTestCase):
         owner = 'hive',
         group = 'hadoop',
         create_parents = True,
+        mode = 0755,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
         group = 'hadoop',
@@ -52,10 +53,12 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-default.xml.template',
         owner = 'hive',
         group = 'hadoop',
+        mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-env.sh.template',
         owner = 'hive',
         group = 'hadoop',
+        mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-exec-log4j.properties',
         content = 'log4jproperties\nline2',
@@ -72,7 +75,7 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/usr/hdp/current/hive-client/conf',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'],
                               owner = 'hive',
                               configurations = self.getConfig()['configurations']['hive-site'],
@@ -81,6 +84,7 @@ class TestHiveClient(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -116,6 +120,7 @@ class TestHiveClient(RMFTestCase):
         owner = 'hive',
         group = 'hadoop',
         create_parents = True,
+        mode = 0755,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
         group = 'hadoop',
@@ -128,10 +133,12 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-default.xml.template',
         owner = 'hive',
         group = 'hadoop',
+        mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-env.sh.template',
         owner = 'hive',
         group = 'hadoop',
+        mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-client/conf/hive-exec-log4j.properties',
         content = 'log4jproperties\nline2',
@@ -148,7 +155,7 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/usr/hdp/current/hive-client/conf',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'],
                               owner = 'hive',
                               configurations = self.getConfig()['configurations']['hive-site'],
@@ -157,6 +164,7 @@ class TestHiveClient(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index c79e773..25ce513 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -156,6 +156,7 @@ class TestHiveMetastore(RMFTestCase):
                               owner = 'hive',
                               group = 'hadoop',
                               create_parents = True,
+                              mode = 0755,
                               )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group = 'hadoop',
@@ -169,10 +170,12 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
                               content = 'log4jproperties\nline2',
@@ -189,7 +192,7 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/etc/hive/conf.server',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = {u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                      u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                      u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -200,6 +203,7 @@ class TestHiveMetastore(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -229,7 +233,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hivemetastore.properties.j2')
+                              content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
+                              mode = 0600,
                               )
     self.assertResourceCalled('File', '/tmp/start_metastore_script',
                               content = StaticFile('startMetastore.sh'),
@@ -269,6 +274,7 @@ class TestHiveMetastore(RMFTestCase):
                               owner = 'hive',
                               group = 'hadoop',
                               create_parents = True,
+                              mode = 0755,
                               )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group = 'hadoop',
@@ -282,10 +288,12 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
                               content = 'log4jproperties\nline2',
@@ -302,7 +310,7 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/etc/hive/conf.server',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = {u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                      u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                      u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -313,6 +321,7 @@ class TestHiveMetastore(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -342,7 +351,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hivemetastore.properties.j2')
+                              content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
+                              mode = 0600,
                               )
     self.assertResourceCalled('File', '/tmp/start_metastore_script',
                               content = StaticFile('startMetastore.sh'),
@@ -406,7 +416,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('Directory', '/usr/hdp/current/hive-server2/conf',
                               owner = 'hive',
                               group = 'hadoop',
-                              create_parents = True)
+                              create_parents = True,
+                              mode = 0755)
 
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group = 'hadoop',
@@ -420,11 +431,13 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
 
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner = 'hive',
-                              group = 'hadoop')
+                              group = 'hadoop',
+                              mode = 0644)
 
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
       content = 'log4jproperties\nline2',
@@ -441,7 +454,7 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/usr/hdp/current/hive-server2/conf/conf.server',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = {u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                      u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                      u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -451,7 +464,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/conf.server/hive-env.sh',
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
-                              group = 'hadoop')
+                              group = 'hadoop',
+                              mode = 0600)
 
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -482,7 +496,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/conf.server/hadoop-metrics2-hivemetastore.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hivemetastore.properties.j2')
+                              content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
+                              mode = 0600,
                               )
     self.assertResourceCalled('File', '/tmp/start_metastore_script',
                               content = StaticFile('startMetastore.sh'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index bcd6c4b..4ea7bf4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -418,6 +418,7 @@ class TestHiveServer(RMFTestCase):
                               owner='hive',
                               group='hadoop',
                               create_parents = True,
+                              mode = 0755,
     )
 
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
@@ -432,10 +433,12 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
                               content='log4jproperties\nline2',
@@ -452,7 +455,7 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group='hadoop',
                               conf_dir='/etc/hive/conf.server',
-                              mode=0644,
+                              mode=0600,
                               configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                    u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                    u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -462,7 +465,7 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hiveserver2-site.xml',
       group = 'hadoop',
       conf_dir = '/etc/hive/conf.server',
-      mode = 0644,
+      mode = 0600,
       owner = 'hive',
       configuration_attributes = self.getConfig()['configuration_attributes']['hiveserver2-site'],
       configurations = self.getConfig()['configurations']['hiveserver2-site'],
@@ -471,6 +474,7 @@ class TestHiveServer(RMFTestCase):
                               content=InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner='hive',
                               group='hadoop',
+                              mode = 0600,
     )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner='root',
@@ -505,7 +509,8 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hiveserver2.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hiveserver2.properties.j2')
+                              content = Template('hadoop-metrics2-hiveserver2.properties.j2'),
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/var/run/hive',
                               owner='hive',
@@ -620,6 +625,7 @@ class TestHiveServer(RMFTestCase):
                               owner='hive',
                               group='hadoop',
                               create_parents = True,
+                              mode = 0755,
     )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group='hadoop',
@@ -633,10 +639,12 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-exec-log4j.properties',
                               content='log4jproperties\nline2',
@@ -653,7 +661,7 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group='hadoop',
                               conf_dir='/etc/hive/conf.server',
-                              mode=0644,
+                              mode=0600,
                               configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                    u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                    u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -663,7 +671,7 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hiveserver2-site.xml',
       group = 'hadoop',
       conf_dir = '/etc/hive/conf.server',
-      mode = 0644,
+      mode = 0600,
       owner = 'hive',
       configuration_attributes = self.getConfig()['configuration_attributes']['hiveserver2-site'],
       configurations = self.getConfig()['configurations']['hiveserver2-site'],
@@ -672,6 +680,7 @@ class TestHiveServer(RMFTestCase):
                               content=InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner='hive',
                               group='hadoop',
+                              mode = 0600,
     )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner='root',
@@ -706,7 +715,8 @@ class TestHiveServer(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hiveserver2.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hiveserver2.properties.j2')
+                              content = Template('hadoop-metrics2-hiveserver2.properties.j2'),
+                              mode = 0600,
     )
     self.assertResourceCalled('Directory', '/var/run/hive',
                               owner='hive',

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/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 b398ac8..635c297 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
@@ -194,6 +194,7 @@ class TestHiveMetastore(RMFTestCase):
                               owner = 'hive',
                               group = 'hadoop',
                               create_parents = True,
+                              mode = 0755,
                               )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group = 'hadoop',
@@ -207,15 +208,17 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/etc/hive/conf.server',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = {u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                      u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                      u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -226,6 +229,7 @@ class TestHiveMetastore(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -255,7 +259,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hivemetastore.properties.j2')
+                              content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
+                              mode = 0600,
                               )
     self.assertResourceCalled('File', '/tmp/start_metastore_script',
                               content = StaticFile('startMetastore.sh'),
@@ -295,6 +300,7 @@ class TestHiveMetastore(RMFTestCase):
                               owner = 'hive',
                               group = 'hadoop',
                               create_parents = True,
+                              mode = 0755,
                               )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group = 'hadoop',
@@ -308,15 +314,17 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-default.xml.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2/conf/hive-env.sh.template',
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0644,
                               )
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/etc/hive/conf.server',
-                              mode = 0644,
+                              mode = 0600,
                               configuration_attributes = {u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                      u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                      u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -327,6 +335,7 @@ class TestHiveMetastore(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
+                              mode = 0600,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -357,7 +366,8 @@ class TestHiveMetastore(RMFTestCase):
     self.assertResourceCalled('File', '/etc/hive/conf.server/hadoop-metrics2-hivemetastore.properties',
                               owner = 'hive',
                               group = 'hadoop',
-                              content = Template('hadoop-metrics2-hivemetastore.properties.j2')
+                              content = Template('hadoop-metrics2-hivemetastore.properties.j2'),
+                              mode = 0600,
                               )
 
     self.assertResourceCalled('File', '/tmp/start_metastore_script',

http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index e00668a..ab6528b 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -360,6 +360,7 @@ class TestHiveServerInteractive(RMFTestCase):
                               owner='hive',
                               group='hadoop',
                               create_parents=True,
+                              mode = 0755,
                               )
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group='hadoop',
@@ -373,10 +374,12 @@ class TestHiveServerInteractive(RMFTestCase):
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/hive-default.xml.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/hdp/current/hive-server2-hive2/conf/hive-env.sh.template',
                               owner='hive',
                               group='hadoop',
+                              mode = 0644,
     )
     hive_site_conf = {}
     hive_site_conf.update(self.getConfig()['configurations']['hive-site'])
@@ -397,12 +400,13 @@ class TestHiveServerInteractive(RMFTestCase):
     self.assertResourceCalled("Directory", "/usr/hdp/current/hive-server2-hive2/conf/conf.server",
                               owner=u"hive",
                               group=u"hadoop",
-                              create_parents=True)
+                              create_parents=True,
+                              mode = 0700)
 
     self.assertResourceCalled('XmlConfig', 'mapred-site.xml',
                               group='hadoop',
                               conf_dir='/usr/hdp/current/hive-server2-hive2/conf/conf.server',
-                              mode=0644,
+                              mode=0600,
                               configuration_attributes={u'final': {u'mapred.healthChecker.script.path': u'true',
                                                                    u'mapreduce.jobtracker.staging.root.dir': u'true'}},
                               owner='hive',
@@ -411,11 +415,13 @@ class TestHiveServerInteractive(RMFTestCase):
 
     self.assertResourceCalled("File", "/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-default.xml.template",
                               owner=u"hive",
-                              group=u"hadoop")
+                              group=u"hadoop",
+                              mode = 0600)
 
     self.assertResourceCalled("File", "/usr/hdp/current/hive-server2-hive2/conf/conf.server/hive-env.sh.template",
                               owner=u"hive",
-                              group=u"hadoop")
+                              group=u"hadoop",
+                              mode = 0600)
     self.assertResourceCalled('XmlConfig', 'tez-site.xml',
                               group='hadoop',
                               conf_dir='/etc/tez_hive2/conf',
@@ -450,7 +456,7 @@ class TestHiveServerInteractive(RMFTestCase):
           self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                                     group='hadoop',
                                     conf_dir=conf_dir,
-                                    mode=0644,
+                                    mode=0600,
                                     configuration_attributes={u'final': {u'hive.optimize.bucketmapjoin.sortedmerge': u'true',
                                                                          u'javax.jdo.option.ConnectionDriverName': u'true',
                                                                          u'javax.jdo.option.ConnectionPassword': u'true'}},
@@ -458,66 +464,136 @@ class TestHiveServerInteractive(RMFTestCase):
                                     configurations=hive_site_conf,
           )
 
-        self.assertResourceCalled('XmlConfig', 'hiveserver2-site.xml',
-                                  group='hadoop',
-                                  conf_dir=conf_dir,
-                                  mode=0644,
-                                  configuration_attributes={},
-                                  owner='hive',
-                                  configurations=hiveserver2_site_conf,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-env.sh'),
-                                  content=InlineTemplate(self.getConfig()['configurations']['hive-interactive-env']['content']),
-                                  owner='hive',
-                                  group='hadoop',
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-daemon-log4j2.properties'),
-                                  content='con\ntent',
-                                  owner='hive',
-                                  group='hadoop',
-                                  mode=0644,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-cli-log4j2.properties'),
-                                  content='con\ntent',
-                                  owner='hive',
-                                  group='hadoop',
-                                  mode=0644,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-log4j2.properties'),
-                                  content='con\ntent',  # Test new line
-                                  owner='hive',
-                                  group='hadoop',
-                                  mode=0644,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
-                                  content='con\ntent',  # Test new line
-                                  owner='hive',
-                                  group='hadoop',
-                                  mode=0644,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
-                                  content='con\ntent',  # Test new line
-                                  owner='hive',
-                                  group='hadoop',
-                                  mode=0644,
-        )
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-hiveserver2.properties'),
-                                  content=Template("hadoop-metrics2-hiveserver2.properties.j2"),
-                                  owner='hive',
-                                  group='hadoop'
-                                  )
-
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llapdaemon.properties'),
-                                  content=Template("hadoop-metrics2-llapdaemon.j2"),
-                                  owner='hive',
-                                  group='hadoop'
-        )
-
-        self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llaptaskscheduler.properties'),
-                                  content=Template("hadoop-metrics2-llaptaskscheduler.j2"),
-                                  owner='hive',
-                                  group='hadoop'
-        )
+        if conf_dir == '/usr/hdp/current/hive-server2-hive2/conf/conf.server':
+          self.assertResourceCalled('XmlConfig', 'hiveserver2-site.xml',
+                                    group='hadoop',
+                                    conf_dir=conf_dir,
+                                    mode=0600,
+                                    configuration_attributes={},
+                                    owner='hive',
+                                    configurations=hiveserver2_site_conf,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-env.sh'),
+                                    content=InlineTemplate(self.getConfig()['configurations']['hive-interactive-env']['content']),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-daemon-log4j2.properties'),
+                                    content='con\ntent',
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-cli-log4j2.properties'),
+                                    content='con\ntent',
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0600,
+                                    )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-hiveserver2.properties'),
+                                    content=Template("hadoop-metrics2-hiveserver2.properties.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0600,
+                                    )
+
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llapdaemon.properties'),
+                                    content=Template("hadoop-metrics2-llapdaemon.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0600
+          )
+
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llaptaskscheduler.properties'),
+                                    content=Template("hadoop-metrics2-llaptaskscheduler.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0600
+          )
+        else:
+          self.assertResourceCalled('XmlConfig', 'hiveserver2-site.xml',
+                                    group='hadoop',
+                                    conf_dir=conf_dir,
+                                    mode=0644,
+                                    configuration_attributes={},
+                                    owner='hive',
+                                    configurations=hiveserver2_site_conf,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-env.sh'),
+                                    content=InlineTemplate(self.getConfig()['configurations']['hive-interactive-env']['content']),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-daemon-log4j2.properties'),
+                                    content='con\ntent',
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'llap-cli-log4j2.properties'),
+                                    content='con\ntent',
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hive-exec-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'beeline-log4j2.properties'),
+                                    content='con\ntent',  # Test new line
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode=0644,
+          )
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-hiveserver2.properties'),
+                                    content=Template("hadoop-metrics2-hiveserver2.properties.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0644,
+                                    )
+
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llapdaemon.properties'),
+                                    content=Template("hadoop-metrics2-llapdaemon.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0644
+          )
+
+          self.assertResourceCalled('File', os.path.join(conf_dir, 'hadoop-metrics2-llaptaskscheduler.properties'),
+                                    content=Template("hadoop-metrics2-llaptaskscheduler.j2"),
+                                    owner='hive',
+                                    group='hadoop',
+                                    mode = 0644
+          )
         pass
 
     self.assertResourceCalled('Directory', '/etc/security/limits.d',


Mime
View raw message