ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject git commit: AMBARI-5031. gmetad/gmond left in init after install.(vbrodetskyi)
Date Tue, 11 Mar 2014 18:01:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 19a336954 -> ada5de23c


AMBARI-5031. gmetad/gmond left in init after install.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: ada5de23cbd3be852870ea6410eb21b03e8f2f40
Parents: 19a3369
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Tue Mar 11 20:01:30 2014 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Tue Mar 11 20:01:30 2014 +0200

----------------------------------------------------------------------
 .../GANGLIA/package/scripts/ganglia_monitor.py  |   6 +
 .../package/scripts/ganglia_monitor_service.py  |   4 -
 .../GANGLIA/package/scripts/ganglia_server.py   |   6 +
 .../GANGLIA/package/scripts/ganglia_monitor.py  |   6 +
 .../package/scripts/ganglia_monitor_service.py  |   4 -
 .../GANGLIA/package/scripts/ganglia_server.py   |   6 +
 .../1.3.2/GANGLIA/test_ganglia_monitor.py       | 166 ++++++++++++++++-
 .../stacks/1.3.2/GANGLIA/test_ganglia_server.py | 184 +++++++++++++++++++
 .../2.0.6/GANGLIA/test_ganglia_monitor.py       | 139 +++++++++++++-
 .../stacks/2.0.6/GANGLIA/test_ganglia_server.py | 171 +++++++++++++++++
 10 files changed, 676 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
index 4b825b4..2eab1e8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -32,6 +32,7 @@ class GangliaMonitor(Script):
     self.install_packages(env)
     env.set_params(params)
     self.configure(env)
+    self.chkconfigOff()
 
   def start(self, env):
     import params
@@ -155,5 +156,10 @@ class GangliaMonitor(Script):
     )
 
 
+  def chkconfigOff(self):
+    Execute("chkconfig gmond off",
+            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin')
+
+
 if __name__ == "__main__":
   GangliaMonitor().execute()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor_service.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor_service.py
index d86d894..cf7a4b1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_monitor_service.py
@@ -20,10 +20,6 @@ from resource_management import *
 
 
 def monitor(action=None):# 'start' or 'stop'
-  if action == "start":
-    Execute("chkconfig gmond off",
-            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-    )
   Execute(
     format(
       "service hdp-gmond {action} >> /tmp/gmond.log  2>&1 ; /bin/ps auwx | /bin/grep
[g]mond  >> /tmp/gmond.log  2>&1"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py
index 32c198e..3eed1cf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py
@@ -32,6 +32,7 @@ class GangliaServer(Script):
     self.install_packages(env)
     env.set_params(params)
     self.configure(env)
+    self.chkconfigOff()
 
   def start(self, env):
     import params
@@ -135,6 +136,11 @@ class GangliaServer(Script):
     )
 
 
+  def chkconfigOff(self):
+    Execute("chkconfig gmetad off",
+            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin')
+
+
 def change_permission():
   import params
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
index 6f9bc40..d03f0bb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -32,6 +32,7 @@ class GangliaMonitor(Script):
     self.install_packages(env)
     env.set_params(params)
     self.configure(env)
+    self.chkconfigOff()
 
   def start(self, env):
     import params
@@ -182,5 +183,10 @@ class GangliaMonitor(Script):
     )
 
 
+  def chkconfigOff(self):
+    Execute("chkconfig gmond off",
+            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin')
+
+
 if __name__ == "__main__":
   GangliaMonitor().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor_service.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor_service.py
index d86d894..cf7a4b1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor_service.py
@@ -20,10 +20,6 @@ from resource_management import *
 
 
 def monitor(action=None):# 'start' or 'stop'
-  if action == "start":
-    Execute("chkconfig gmond off",
-            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-    )
   Execute(
     format(
       "service hdp-gmond {action} >> /tmp/gmond.log  2>&1 ; /bin/ps auwx | /bin/grep
[g]mond  >> /tmp/gmond.log  2>&1"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
index 467336a..a027f30 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
@@ -32,6 +32,7 @@ class GangliaServer(Script):
     self.install_packages(env)
     env.set_params(params)
     self.configure(env)
+    self.chkconfigOff()
 
   def start(self, env):
     import params
@@ -170,6 +171,11 @@ class GangliaServer(Script):
     )
 
 
+  def chkconfigOff(self):
+    Execute("chkconfig gmetad off",
+            path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin')
+
+
 def change_permission():
   import params
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
index 5127906..af56453 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_monitor.py
@@ -374,10 +374,6 @@ class TestGangliaMonitor(RMFTestCase):
         group = 'hadoop',
         )
     self.assertResourceCalled(
-        'Execute', 'chkconfig gmond off',
-        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-        )
-    self.assertResourceCalled(
         'Execute', 'service hdp-gmond start >> /tmp/gmond.log  2>&1 ; /bin/ps
auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
         path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
         )
@@ -395,3 +391,165 @@ class TestGangliaMonitor(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
+
+  def test_install_default(self):
+    self.executeScript("1.3.2/services/GANGLIA/package/scripts/ganglia_monitor.py",
+                       classname="GangliaMonitor",
+                       command="install",
+                       config_file="default.json"
+    )
+    self.assertResourceCalled('Group', 'hadoop',)
+
+    self.assertResourceCalled('Group', 'nobody',)
+
+    self.assertResourceCalled('Group', 'nobody',)
+
+    self.assertResourceCalled('User', 'nobody',
+                              groups = [u'nobody'],)
+
+    self.assertResourceCalled('User', 'nobody',
+                              groups = [u'nobody'],)
+
+    self.assertResourceCalled('Directory', '/etc/ganglia/hdp',
+                              owner = 'root',
+                              group = 'hadoop',
+                              recursive = True,)
+
+    self.assertResourceCalled('Directory', '/usr/libexec/hdp/ganglia',
+                              owner = 'root',
+                              group = 'root',
+                              recursive = True,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmetad',
+                              content = StaticFile('gmetad.init'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmond',
+                              content = StaticFile('gmond.init'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+                              content = StaticFile('checkGmond.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+                              content = StaticFile('checkRrdcached.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+                              content = StaticFile('gmetadLib.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+                              content = StaticFile('gmondLib.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+                              content = StaticFile('rrdcachedLib.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+                              content = StaticFile('setupGanglia.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+                              content = StaticFile('startGmetad.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+                              content = StaticFile('startGmond.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+                              content = StaticFile('startRrdcached.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+                              content = StaticFile('stopGmetad.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+                              content = StaticFile('stopGmond.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+                              content = StaticFile('stopRrdcached.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+                              content = StaticFile('teardownGanglia.sh'),
+                              mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+                              owner = 'root',
+                              template_tag = None,
+                              group = 'root',
+                              mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+                              owner = 'root',
+                              template_tag = None,
+                              group = 'root',
+                              mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+                              owner = 'root',
+                              template_tag = None,
+                              group = 'root',
+                              mode = 0755,)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPJobTracker
-o root -g hadoop',
+                              path = ['/usr/libexec/hdp/ganglia',
+                                      '/usr/sbin',
+                                      '/sbin:/usr/local/bin',
+                                      '/bin',
+                                      '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHistoryServer
-o root -g hadoop',
+                              path = ['/usr/libexec/hdp/ganglia',
+                                      '/usr/sbin',
+                                      '/sbin:/usr/local/bin',
+                                      '/bin',
+                                      '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPDataNode
-o root -g hadoop',
+                              path = ['/usr/libexec/hdp/ganglia',
+                                      '/usr/sbin',
+                                      '/sbin:/usr/local/bin',
+                                      '/bin',
+                                      '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPTaskTracker
-o root -g hadoop',
+                              path = ['/usr/libexec/hdp/ganglia',
+                                      '/usr/sbin',
+                                      '/sbin:/usr/local/bin',
+                                      '/bin',
+                                      '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseRegionServer
-o root -g hadoop',
+                              path = ['/usr/libexec/hdp/ganglia',
+                                      '/usr/sbin',
+                                      '/sbin:/usr/local/bin',
+                                      '/bin',
+                                      '/usr/bin'],)
+
+    self.assertResourceCalled('Directory', '/etc/ganglia/conf.d',
+                              owner = 'root',
+                              group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/conf.d/modgstatus.conf',
+                              owner = 'root',
+                              group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/conf.d/multicpu.conf',
+                              owner = 'root',
+                              group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/gmond.conf',
+                              owner = 'root',
+                              group = 'hadoop',)
+
+    self.assertResourceCalled('Execute', 'chkconfig gmond off',
+                              path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],)
+
+    self.assertNoMoreResources()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_server.py b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_server.py
index 4ecb539..7334bcf 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_server.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/GANGLIA/test_ganglia_server.py
@@ -231,3 +231,187 @@ class TestGangliaServer(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
+
+  def test_install_default(self):
+    self.executeScript("1.3.2/services/GANGLIA/package/scripts/ganglia_server.py",
+                       classname="GangliaServer",
+                       command="install",
+                       config_file="default.json"
+    )
+    self.assertResourceCalled('Group', 'hadoop',)
+
+    self.assertResourceCalled('Group', 'nobody',)
+
+    self.assertResourceCalled('Group', 'nobody',)
+
+    self.assertResourceCalled('User', 'nobody',
+                          groups = [u'nobody'],)
+
+    self.assertResourceCalled('User', 'nobody',
+                          groups = [u'nobody'],)
+
+    self.assertResourceCalled('Directory', '/usr/libexec/hdp/ganglia',
+                          owner = 'root',
+                          group = 'root',
+                          recursive = True,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmetad',
+                          content = StaticFile('gmetad.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmond',
+                          content = StaticFile('gmond.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+                          content = StaticFile('checkGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+                          content = StaticFile('checkRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+                          content = StaticFile('gmetadLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+                          content = StaticFile('gmondLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+                          content = StaticFile('rrdcachedLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+                          content = StaticFile('setupGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+                          content = StaticFile('startGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+                          content = StaticFile('startGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+                          content = StaticFile('startRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+                          content = StaticFile('stopGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+                          content = StaticFile('stopGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+                          content = StaticFile('stopRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+                          content = StaticFile('teardownGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPJobTracker
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseMaster
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHistoryServer
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPDataNode
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPTaskTracker
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseRegionServer
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -t -o
root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSlaves
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Directory', '/var/lib/ganglia/dwoo',
+                          owner = 'nobody',
+                          recursive = True,
+                          mode = 0777,)
+
+    self.assertResourceCalled('Directory', '/srv/www/cgi-bin',
+                          recursive = True,)
+
+    self.assertResourceCalled('File', '/srv/www/cgi-bin/rrd.py',
+                          content = StaticFile('rrd.py'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/ganglia/gmetad.conf',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('Execute', 'chkconfig gmetad off',
+                          path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],)
+    self.assertNoMoreResources()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
index 52aff88..666ac3e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_monitor.py
@@ -315,10 +315,6 @@ class TestGangliaMonitor(RMFTestCase):
         group = 'hadoop',
         )
     self.assertResourceCalled(
-        'Execute', 'chkconfig gmond off',
-        path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
-        )
-    self.assertResourceCalled(
         'Execute', 'service hdp-gmond start >> /tmp/gmond.log  2>&1 ; /bin/ps
auwx | /bin/grep [g]mond  >> /tmp/gmond.log  2>&1',
         path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
         )
@@ -335,3 +331,138 @@ class TestGangliaMonitor(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
+
+  def test_install_default(self):
+    self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py",
+                       classname="GangliaMonitor",
+                       command="install",
+                       config_file="default.json"
+    )
+    self.assertResourceCalled('Directory', '/etc/ganglia/hdp',
+                              owner = 'root',
+                              group = 'hadoop',
+                              recursive = True,)
+
+    self.assertResourceCalled('Directory', '/usr/libexec/hdp/ganglia',
+                          owner = 'root',
+                          group = 'root',
+                          recursive = True,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmetad',
+                          content = StaticFile('gmetad.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmond',
+                          content = StaticFile('gmond.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+                          content = StaticFile('checkGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+                          content = StaticFile('checkRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+                          content = StaticFile('gmetadLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+                          content = StaticFile('gmondLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+                          content = StaticFile('rrdcachedLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+                          content = StaticFile('setupGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+                          content = StaticFile('startGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+                          content = StaticFile('startGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+                          content = StaticFile('startRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+                          content = StaticFile('stopGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+                          content = StaticFile('stopGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+                          content = StaticFile('stopRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+                          content = StaticFile('teardownGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode
-o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNimbus
-o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSupervisor
-o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Directory', '/etc/ganglia/conf.d',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/conf.d/modgstatus.conf',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/conf.d/multicpu.conf',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('File', '/etc/ganglia/gmond.conf',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('Execute', 'chkconfig gmond off',
+                          path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],)
+    self.assertNoMoreResources()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ada5de23/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
index f6af9ab..95c9fea 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
@@ -219,3 +219,174 @@ class TestGangliaServer(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
+  def test_install_default(self):
+    self.executeScript("2.0.6/services/GANGLIA/package/scripts/ganglia_server.py",
+                       classname="GangliaServer",
+                       command="install",
+                       config_file="default.json"
+    )
+    self.assertResourceCalled('Directory', '/usr/libexec/hdp/ganglia',
+                              owner = 'root',
+                              group = 'root',
+                              recursive = True,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmetad',
+                          content = StaticFile('gmetad.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/init.d/hdp-gmond',
+                          content = StaticFile('gmond.init'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkGmond.sh',
+                          content = StaticFile('checkGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/checkRrdcached.sh',
+                          content = StaticFile('checkRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmetadLib.sh',
+                          content = StaticFile('gmetadLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/gmondLib.sh',
+                          content = StaticFile('gmondLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/rrdcachedLib.sh',
+                          content = StaticFile('rrdcachedLib.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/setupGanglia.sh',
+                          content = StaticFile('setupGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmetad.sh',
+                          content = StaticFile('startGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startGmond.sh',
+                          content = StaticFile('startGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/startRrdcached.sh',
+                          content = StaticFile('startRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmetad.sh',
+                          content = StaticFile('stopGmetad.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopGmond.sh',
+                          content = StaticFile('stopGmond.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/stopRrdcached.sh',
+                          content = StaticFile('stopRrdcached.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/usr/libexec/hdp/ganglia/teardownGanglia.sh',
+                          content = StaticFile('teardownGanglia.sh'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaClusters.conf',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaEnv.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('TemplateConfig', '/usr/libexec/hdp/ganglia/gangliaLib.sh',
+                          owner = 'root',
+                          template_tag = None,
+                          group = 'root',
+                          mode = 0755,)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseMaster
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPResourceManager
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNodeManager
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHistoryServer
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPDataNode
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseRegionServer
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNimbus
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Execute', '/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPSupervisor
-m -o root -g hadoop',
+                          path = ['/usr/libexec/hdp/ganglia',
+                                  '/usr/sbin',
+                                  '/sbin:/usr/local/bin',
+                                  '/bin',
+                                  '/usr/bin'],)
+
+    self.assertResourceCalled('Directory', '/var/lib/ganglia/dwoo',
+                          owner = 'nobody',
+                          recursive = True,
+                          mode = 0777,)
+
+    self.assertResourceCalled('Directory', '/srv/www/cgi-bin',
+                          recursive = True,)
+
+    self.assertResourceCalled('File', '/srv/www/cgi-bin/rrd.py',
+                          content = StaticFile('rrd.py'),
+                          mode = 0755,)
+
+    self.assertResourceCalled('File', '/etc/ganglia/gmetad.conf',
+                          owner = 'root',
+                          group = 'hadoop',)
+
+    self.assertResourceCalled('Execute', 'chkconfig gmetad off',
+                          path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],)
+    self.assertNoMoreResources()
\ No newline at end of file


Mime
View raw message