ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject [1/2] AMBARI-4678. Custom log4j configs should be stored as raw text. (Dmitry Sen via mahadev)
Date Fri, 21 Feb 2014 23:22:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 60ea8da46 -> dfe1fe043


http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
index 3bb59f6..2663839 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/hooks/before-START/test_before_start.py
@@ -96,36 +96,25 @@ class TestHookBeforeStart(RMFTestCase):
                               content = Template('health_check.j2'),
                               owner = 'hdfs',
                               )
-    self.assertResourceCalled('PropertiesFile',
+    rca_properties = format('''
+
+log4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender
+log4j.appender.JHA.database=jdbc:postgresql://c6401.ambari.apache.org/ambarirca
+log4j.appender.JHA.driver=org.postgresql.Driver
+log4j.appender.JHA.user=mapred
+log4j.appender.JHA.password=mapred
+
+log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=DEBUG,JHA
+log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true
+
+''')
+    self.maxDiff = None
+    self.assertResourceCalled('File',
                               '/etc/hadoop/conf/log4j.properties',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+                              mode=0644,
+                              group='hadoop',
                               owner='hdfs',
-                              group='hadoop'
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.driver=.*~ambari.jobhistory.driver=org.postgresql.Driver~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA=.*~log4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.driver=.*~log4j.appender.JHA.driver=${ambari.jobhistory.driver}~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.database=.*~log4j.appender.JHA.database=${ambari.jobhistory.database}~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.logger=.*~ambari.jobhistory.logger=DEBUG,JHA~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.password=.*~log4j.appender.JHA.password=${ambari.jobhistory.password}~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.database=.*~ambari.jobhistory.database=jdbc:postgresql://c6401.ambari.apache.org/ambarirca~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=${ambari.jobhistory.logger}~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.user=.*~log4j.appender.JHA.user=${ambari.jobhistory.user}~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.user=.*~ambari.jobhistory.user=mapred~' /etc/hadoop/conf/log4j.properties",
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.password=.*~ambari.jobhistory.password=mapred~' /etc/hadoop/conf/log4j.properties",
+                              content='log4jproperties\nline2log4jproperties\nline2'+rca_properties
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/hadoop-metrics2.properties',
       content = Template('hadoop-metrics2.properties.j2'),
@@ -267,35 +256,11 @@ class TestHookBeforeStart(RMFTestCase):
                               content = Template('health_check.j2'),
                               owner = 'root',
                               )
-    self.assertResourceCalled('PropertiesFile', '/etc/hadoop/conf/log4j.properties',
+    self.assertResourceCalled('File', '/etc/hadoop/conf/log4j.properties',
                               owner = 'hdfs',
                               group = 'hadoop',
-                              mode = 0664,
-                              properties = self.getConfig()['configurations']['hdfs-log4j'],
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.driver=.*~ambari.jobhistory.driver=org.postgresql.Driver~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA=.*~log4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.driver=.*~log4j.appender.JHA.driver=${ambari.jobhistory.driver}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.database=.*~log4j.appender.JHA.database=${ambari.jobhistory.database}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.logger=.*~ambari.jobhistory.logger=DEBUG,JHA~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.password=.*~log4j.appender.JHA.password=${ambari.jobhistory.password}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.database=.*~ambari.jobhistory.database=jdbc:postgresql://c6401.ambari.apache.org/ambarirca~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=${ambari.jobhistory.logger}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.user=.*~log4j.appender.JHA.user=${ambari.jobhistory.user}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.user=.*~ambari.jobhistory.user=mapred~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.password=.*~ambari.jobhistory.password=mapred~' /etc/hadoop/conf/log4j.properties",
+                              mode = 0644,
+                              content = 'log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/hadoop/conf/hadoop-metrics2.properties',
                               content = Template('hadoop-metrics2.properties.j2'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
index bd3228f..b497745 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_client.py
@@ -71,13 +71,12 @@ class TestHBaseClient(RMFTestCase):
       owner = 'hbase',
       template_tag = None,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
     
@@ -125,13 +124,12 @@ class TestHBaseClient(RMFTestCase):
       owner = 'hbase',
       template_tag = None,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
index ef58f17..f413857 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
@@ -236,13 +236,12 @@ class TestHBaseMaster(RMFTestCase):
       owner = 'hbase',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
   
   def assert_configure_secured(self):
@@ -322,11 +321,10 @@ class TestHBaseMaster(RMFTestCase):
       owner = 'hbase',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py
index 3efe21e..d0eaa90 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py
@@ -169,13 +169,12 @@ class TestHbaseRegionServer(RMFTestCase):
       owner = 'hbase',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
   
   def assert_configure_secured(self):
@@ -255,11 +254,10 @@ class TestHbaseRegionServer(RMFTestCase):
       owner = 'hbase',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/hbase/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hbase/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hbase',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 e9de42a..b555c0f 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
@@ -57,21 +57,19 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
 
@@ -112,20 +110,18 @@ class TestHiveClient(RMFTestCase):
       owner = 'hive',
       group = 'hadoop',
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 b2dca85..b6b5b5a 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
@@ -38,21 +38,19 @@ class TestHiveMetastore(RMFTestCase):
     )
 
     self.assert_configure_default()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertResourceCalled('Execute', 'env HADOOP_HOME=/usr JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.log /var/run/hive/hive.pid /etc/hive/conf.server',
                               not_if = 'ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps `cat /var/run/hive/hive.pid` >/dev/null 2>&1',
@@ -82,21 +80,19 @@ class TestHiveMetastore(RMFTestCase):
                        config_file="secured.json"
     )
     self.assert_configure_default()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
 
@@ -108,21 +104,19 @@ class TestHiveMetastore(RMFTestCase):
     )
 
     self.assert_configure_secured()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertResourceCalled('Execute', 'env HADOOP_HOME=/usr JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /tmp/start_metastore_script /var/log/hive/hive.out /var/log/hive/hive.log /var/run/hive/hive.pid /etc/hive/conf.server',
                               not_if = 'ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps `cat /var/run/hive/hive.pid` >/dev/null 2>&1',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 7446493..cc480dc 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
@@ -29,21 +29,19 @@ class TestHiveServer(RMFTestCase):
                        config_file="default.json"
     )
     self.assert_configure_default()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
   
@@ -55,21 +53,19 @@ class TestHiveServer(RMFTestCase):
     )
 
     self.assert_configure_default()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
 
     self.assertResourceCalled('HdfsDirectory', '/apps/tez/',
@@ -150,21 +146,19 @@ class TestHiveServer(RMFTestCase):
                        config_file="secured.json"
     )
     self.assert_configure_secured()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertNoMoreResources()
 
@@ -176,21 +170,19 @@ class TestHiveServer(RMFTestCase):
     )
 
     self.assert_configure_secured()
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-exec-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-exec-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'hive-log4j.properties',
-                              dir='/etc/hive/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+    self.assertResourceCalled('File',
+                              '/etc/hive/conf/hive-log4j.properties',
+                              mode=0644,
+                              group='hadoop',
                               owner='hive',
-                              group='hadoop'
+                              content='log4jproperties\nline2'
     )
     self.assertResourceCalled('Execute', 'env JAVA_HOME=/usr/jdk64/jdk1.7.0_45 /tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.log /var/run/hive/hive-server.pid /etc/hive/conf.server',
                               not_if = 'ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 bc84440..8213cbc 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
@@ -45,13 +45,12 @@ class TestOozieClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/oozie/conf/oozie-env.sh',
         owner = 'oozie',
         )
-    self.assertResourceCalled('PropertiesFile', 'oozie-log4j.properties',
-        owner = 'oozie',
-        group = 'hadoop',
-        mode = 0664,
-        dir = '/etc/oozie/conf',
-        properties = self.getConfig()['configurations']['oozie-log4j'],
-        )
+    self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
+                              owner = 'oozie',
+                              group = 'hadoop',
+                              mode = 0644,
+                              content = 'log4jproperties\nline2'
+                              )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
         owner = 'oozie',
         group = 'hadoop',
@@ -98,12 +97,11 @@ class TestOozieClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/oozie/conf/oozie-env.sh',
                               owner = 'oozie',
                               )
-    self.assertResourceCalled('PropertiesFile', 'oozie-log4j.properties',
+    self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
                               owner = 'oozie',
                               group = 'hadoop',
-                              mode = 0664,
-                              dir = '/etc/oozie/conf',
-                              properties = self.getConfig()['configurations']['oozie-log4j'],
+                              mode = 0644,
+                              content = 'log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 6b438a6..51cd982 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
@@ -138,12 +138,11 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/oozie/conf/oozie-env.sh',
                               owner = 'oozie',
                               )
-    self.assertResourceCalled('PropertiesFile', 'oozie-log4j.properties',
+    self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
                               owner = 'oozie',
                               group = 'hadoop',
-                              mode = 0664,
-                              dir = '/etc/oozie/conf',
-                              properties = self.getConfig()['configurations']['oozie-log4j'],
+                              mode = 0644,
+                              content = 'log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',
@@ -238,12 +237,11 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/oozie/conf/oozie-env.sh',
                               owner = 'oozie',
                               )
-    self.assertResourceCalled('PropertiesFile', 'oozie-log4j.properties',
+    self.assertResourceCalled('File', '/etc/oozie/conf/oozie-log4j.properties',
                               owner = 'oozie',
                               group = 'hadoop',
-                              mode = 0664,
-                              dir = '/etc/oozie/conf',
-                              properties = self.getConfig()['configurations']['oozie-log4j'],
+                              mode = 0644,
+                              content = 'log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/oozie/conf/adminusers.txt',
                               owner = 'oozie',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 0143e27..2ebe113 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
@@ -20,7 +20,7 @@ limitations under the License.
 
 from stacks.utils.RMFTestCase import *
 
-class TestPigClient(RMFTestCase):
+class TestHcatClient(RMFTestCase):
 
   def test_configure_default(self):
     self.executeScript("2.0.6/services/PIG/package/scripts/pig_client.py",
@@ -28,6 +28,7 @@ class TestPigClient(RMFTestCase):
                        command = "configure",
                        config_file="default.json"
     )
+
     self.assertResourceCalled('Directory', '/etc/pig/conf',
       owner = 'hdfs',
       group = 'hadoop',
@@ -38,21 +39,21 @@ class TestPigClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/pig/conf/pig.properties',
       owner = 'hdfs',
     )
-    self.assertResourceCalled('PropertiesFile', 'log4j.properties',
+    self.assertResourceCalled('File', '/etc/pig/conf/log4j.properties',
       owner = 'hdfs',
       group = 'hadoop',
-      mode = 0664,
-      dir = '/etc/pig/conf',
-      properties = self.getConfig()['configurations']['pig-log4j'],
+      mode = 0644,
+      content = 'log4jproperties\nline2'
     )
     self.assertNoMoreResources()
-    
+
   def test_configure_secured(self):
     self.executeScript("2.0.6/services/PIG/package/scripts/pig_client.py",
                        classname = "PigClient",
                        command = "configure",
                        config_file="secured.json"
     )
+    
     self.assertResourceCalled('Directory', '/etc/pig/conf',
       owner = 'hdfs',
       group = 'hadoop',
@@ -63,11 +64,10 @@ class TestPigClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/pig/conf/pig.properties',
       owner = 'hdfs',
     )
-    self.assertResourceCalled('PropertiesFile', 'log4j.properties',
+    self.assertResourceCalled('File', '/etc/pig/conf/log4j.properties',
       owner = 'hdfs',
       group = 'hadoop',
-      mode = 0664,
-      dir = '/etc/pig/conf',
-      properties = self.getConfig()['configurations']['pig-log4j'],
+      mode = 0644,
+      content = 'log4jproperties\nline2'
     )
     self.assertNoMoreResources()

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 db1b883..2f74caa 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
@@ -65,13 +65,12 @@ class TestZookeeperClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/zookeeper/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
-                              owner='zookeeper',
-                              group='hadoop'
+    self.assertResourceCalled('File',
+                              '/etc/zookeeper/conf/log4j.properties',
+                              content='log4jproperties\nline2',
+                              mode=0644,
+                              group='hadoop',
+                              owner='zookeeper'
     )
     self.assertResourceCalled('File', '/etc/zookeeper/conf/zoo_sample.cfg',
       owner = 'zookeeper',
@@ -122,13 +121,12 @@ class TestZookeeperClient(RMFTestCase):
       group = 'hadoop',
       recursive = True,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/zookeeper/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
-                              owner='zookeeper',
-                              group='hadoop'
+    self.assertResourceCalled('File',
+                              '/etc/zookeeper/conf/log4j.properties',
+                              content='log4jproperties\nline2',
+                              mode=0644,
+                              group='hadoop',
+                              owner='zookeeper'
     )
     self.assertResourceCalled('File', '/etc/zookeeper/conf/zookeeper_client_jaas.conf',
       owner = 'zookeeper',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/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 098d0bb..951d31c 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
@@ -136,13 +136,12 @@ class TestZookeeperServer(RMFTestCase):
       content = '1',
       mode = 0644,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/zookeeper/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
-                              owner='zookeeper',
-                              group='hadoop'
+    self.assertResourceCalled('File',
+                              '/etc/zookeeper/conf/log4j.properties',
+                              content='log4jproperties\nline2',
+                              mode=0644,
+                              group='hadoop',
+                              owner='zookeeper'
     )
     self.assertResourceCalled('File', '/etc/zookeeper/conf/zoo_sample.cfg',
       owner = 'zookeeper',
@@ -189,13 +188,12 @@ class TestZookeeperServer(RMFTestCase):
       content = '1',
       mode = 0644,
     )
-    self.assertResourceCalled('PropertiesFile',
-                              'log4j.properties',
-                              dir='/etc/zookeeper/conf',
-                              properties={'property1': 'value1'},
-                              mode=0664,
-                              owner='zookeeper',
-                              group='hadoop'
+    self.assertResourceCalled('File',
+                              '/etc/zookeeper/conf/log4j.properties',
+                              content='log4jproperties\nline2',
+                              mode=0644,
+                              group='hadoop',
+                              owner='zookeeper'
     )
     self.assertResourceCalled('File', '/etc/zookeeper/conf/zookeeper_jaas.conf',
       owner = 'zookeeper',

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index 719c2e9..fea2268 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -491,28 +491,28 @@
             "tez.am.am-rm.heartbeat.interval-ms.max": "250"
         },
         "hdfs-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "yarn-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hbase-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hive-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hive-exec-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "zookeeper-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "pig-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "oozie-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         }
     },
     "configurationTags": {
@@ -566,6 +566,12 @@
         },
         "zookeeper-log4j": {
             "tag": "version1"
+        },
+        "oozie-log4j": {
+            "tag": "version1"
+        },
+        "pig-log4j": {
+            "tag": "version1"
         }
     }, 
     "commandId": "7-1", 

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
index 758fe0b..a8c9315 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
@@ -618,28 +618,28 @@
             "yarn.nodemanager.aux-services.mapreduce_shuffle.class": "org.apache.hadoop.mapred.ShuffleHandler"
         },
         "hdfs-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "yarn-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hbase-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hive-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "hive-exec-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "zookeeper-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "pig-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         },
         "oozie-log4j": {
-            "property1": "value1"
+            "content": "log4jproperties\nline2"
         }
     }, 
     "configurationTags": {
@@ -693,8 +693,13 @@
         },
         "zookeeper-log4j": {
             "tag": "version1389972945450"
+        },
+        "oozie-log4j": {
+            "tag": "version1389972945450"
+        },
+        "pig-log4j": {
+            "tag": "version1389972945450"
         }
-
     },
     "commandId": "9-1", 
     "clusterHostInfo": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dfe1fe04/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index 159ba3e..88448e6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -100,36 +100,12 @@ class TestHookBeforeStart(RMFTestCase):
                               content = Template('health_check-v2.j2'),
                               owner = 'hdfs',
                               )
-    self.assertResourceCalled('PropertiesFile',
+    self.assertResourceCalled('File',
                               '/etc/hadoop/conf/log4j.properties',
-                              properties={'property1': 'value1'},
-                              mode=0664,
+                              mode=0644,
+                              group='hadoop',
                               owner='hdfs',
-                              group='hadoop'
-    )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.driver=.*~###ambari.jobhistory.driver=o~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA=.*~###log4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.driver=.*~###log4j.appender.JHA.driver=${ambari.jobhistory.driver}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.database=.*~###log4j.appender.JHA.database=${ambari.jobhistory.database}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.logger=.*~###ambari.jobhistory.logger=DEBUG,JHA~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.password=.*~###log4j.appender.JHA.password=${ambari.jobhistory.password}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.database=.*~###ambari.jobhistory.database=j~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~###log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~###log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=${ambari.jobhistory.logger}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.user=.*~###log4j.appender.JHA.user=${ambari.jobhistory.user}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.user=.*~###ambari.jobhistory.user=m~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.password=.*~###ambari.jobhistory.password=m~' /etc/hadoop/conf/log4j.properties",
+                              content='log4jproperties\nline2log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/hadoop/conf/hadoop-metrics2.properties',
                               content = Template('hadoop-metrics2.properties.j2'),
@@ -278,35 +254,12 @@ class TestHookBeforeStart(RMFTestCase):
                               content = Template('health_check-v2.j2'),
                               owner = 'root',
                               )
-    self.assertResourceCalled('PropertiesFile', '/etc/hadoop/conf/log4j.properties',
-                              owner = 'hdfs',
-                              group = 'hadoop',
-                              mode = 0664,
-                              properties = self.getConfig()['configurations']['hdfs-log4j'],
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.driver=.*~###ambari.jobhistory.driver=o~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA=.*~###log4j.appender.JHA=org.apache.ambari.log4j.hadoop.mapreduce.jobhistory.JobHistoryAppender~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.driver=.*~###log4j.appender.JHA.driver=${ambari.jobhistory.driver}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.database=.*~###log4j.appender.JHA.database=${ambari.jobhistory.database}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.logger=.*~###ambari.jobhistory.logger=DEBUG,JHA~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.password=.*~###log4j.appender.JHA.password=${ambari.jobhistory.password}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.database=.*~###ambari.jobhistory.database=j~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~###log4j.additivity.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=true~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=.*~###log4j.logger.org.apache.hadoop.mapred.JobHistory$JobHistoryLogger=${ambari.jobhistory.logger}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?log4j.appender.JHA.user=.*~###log4j.appender.JHA.user=${ambari.jobhistory.user}~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.user=.*~###ambari.jobhistory.user=m~' /etc/hadoop/conf/log4j.properties",
-                              )
-    self.assertResourceCalled('Execute', "sed -i 's~\\(###\\)\\?ambari.jobhistory.password=.*~###ambari.jobhistory.password=m~' /etc/hadoop/conf/log4j.properties",
+    self.assertResourceCalled('File',
+                              '/etc/hadoop/conf/log4j.properties',
+                              mode=0644,
+                              group='hadoop',
+                              owner='hdfs',
+                              content='log4jproperties\nline2log4jproperties\nline2'
                               )
     self.assertResourceCalled('File', '/etc/hadoop/conf/hadoop-metrics2.properties',
                               content = Template('hadoop-metrics2.properties.j2'),
@@ -364,4 +317,4 @@ class TestHookBeforeStart(RMFTestCase):
                               owner = 'mapred',
                               group = 'hadoop',
                               )
-    self.assertNoMoreResources()
\ No newline at end of file
+    self.assertNoMoreResources()


Mime
View raw message