You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2014/02/10 18:03:38 UTC
git commit: AMBARI-4577. Fix Nagios Tests (aonishuk)
Updated Branches:
refs/heads/trunk 65e8bc1e2 -> a7bc7d669
AMBARI-4577. Fix Nagios Tests (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a7bc7d66
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a7bc7d66
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a7bc7d66
Branch: refs/heads/trunk
Commit: a7bc7d669352c4a4b5d6b4c31f5791f461e947c2
Parents: 65e8bc1
Author: Andrew Onischuk <ao...@hortonworks.com>
Authored: Mon Feb 10 09:02:07 2014 -0800
Committer: Andrew Onischuk <ao...@hortonworks.com>
Committed: Mon Feb 10 09:03:26 2014 -0800
----------------------------------------------------------------------
.../1.3.2/services/NAGIOS/package/scripts/params.py | 2 +-
.../python/stacks/1.3.2/NAGIOS/test_nagios_server.py | 2 +-
.../python/stacks/1.3.2/PIG/test_pig_service_check.py | 2 +-
.../python/stacks/2.0.6/NAGIOS/test_nagios_server.py | 2 +-
.../python/stacks/2.0.6/PIG/test_pig_service_check.py | 2 +-
.../src/test/python/stacks/utils/RMFTestCase.py | 13 +++++++++----
6 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
index 342b3bc..1b2668e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
@@ -48,7 +48,7 @@ eventhandlers_dir = "/usr/lib/nagios/eventhandlers"
nagios_principal_name = default("nagios_principal_name", "nagios")
hadoop_ssl_enabled = False
-namenode_metadata_port = get_port_from_url(config['configurations']['core-site']['fs.defaultFS'])
+namenode_metadata_port = get_port_from_url(config['configurations']['core-site']['fs.default.name'])
oozie_server_port = "11000"
# different to HDP2
namenode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.http.address'])
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/test/python/stacks/1.3.2/NAGIOS/test_nagios_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/NAGIOS/test_nagios_server.py b/ambari-server/src/test/python/stacks/1.3.2/NAGIOS/test_nagios_server.py
index d89f6f3..3010778 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/NAGIOS/test_nagios_server.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/NAGIOS/test_nagios_server.py
@@ -66,7 +66,7 @@ class TestNagiosServer(RMFTestCase):
def assert_configure_default(self):
- self.assertResourceCalled('File', '/etc/httpd/conf.d/nagios.conf',
+ self.assertResourceCalled('File', '/etc/apache2/conf.d/nagios.conf',
owner='nagios',
group='nagios',
content=Template("nagios.conf.j2"),
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py b/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
index af579e3..71c1936 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/PIG/test_pig_service_check.py
@@ -35,7 +35,7 @@ class TestServiceCheck(RMFTestCase):
user = 'ambari-qa',
conf_dir = '/etc/hadoop/conf',
security_enabled = False,
- keytab = 'mockOfUnknownConfiguration',
+ keytab = UnknownConfigurationMock(),
kinit_path_local = '/usr/bin/kinit',
)
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/test/python/stacks/2.0.6/NAGIOS/test_nagios_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/NAGIOS/test_nagios_server.py b/ambari-server/src/test/python/stacks/2.0.6/NAGIOS/test_nagios_server.py
index 8682a48..5a9cc2f 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/NAGIOS/test_nagios_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/NAGIOS/test_nagios_server.py
@@ -66,7 +66,7 @@ class TestNagiosServer(RMFTestCase):
def assert_configure_default(self):
- self.assertResourceCalled('File', '/etc/httpd/conf.d/nagios.conf',
+ self.assertResourceCalled('File', '/etc/apache2/conf.d/nagios.conf',
owner='nagios',
group='nagios',
content=Template("nagios.conf.j2"),
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
index a8fd23f..cd63f42 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_service_check.py
@@ -34,7 +34,7 @@ class TestServiceCheck(RMFTestCase):
user = 'ambari-qa',
conf_dir = '/etc/hadoop/conf',
security_enabled = False,
- keytab = 'mockOfUnknownConfiguration',
+ keytab = UnknownConfigurationMock(),
kinit_path_local = '/usr/bin/kinit'
)
http://git-wip-us.apache.org/repos/asf/ambari/blob/a7bc7d66/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index bf21bad..d0580ab 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
-__all__ = ["RMFTestCase", "Template", "StaticFile", "InlineTemplate"]
+__all__ = ["RMFTestCase", "Template", "StaticFile", "InlineTemplate","UnknownConfigurationMock"]
from unittest import TestCase
import json
@@ -29,7 +29,7 @@ from mock.mock import MagicMock, patch
from resource_management.core.environment import Environment
from resource_management.libraries.script.config_dictionary import ConfigDictionary
from resource_management.libraries.script.script import Script
-from resource_management.libraries.script import config_dictionary
+from resource_management.libraries.script.config_dictionary import UnknownConfiguration
import platform
PATH_TO_STACKS = os.path.normpath("main/resources/stacks/HDP")
@@ -82,8 +82,7 @@ class RMFTestCase(TestCase):
with patch.object(Script, 'install_packages'):
with patch('resource_management.libraries.functions.get_kinit_path', return_value=kinit_path_local):
with patch.object(platform, 'linux_distribution', return_value=os_type):
- with patch.object(config_dictionary, 'UnknownConfiguration', return_value='mockOfUnknownConfiguration'):
- method(RMFTestCase.env)
+ method(RMFTestCase.env)
def getConfig(self):
return self.config_dict
@@ -119,6 +118,8 @@ class RMFTestCase(TestCase):
# correctly output octal mode numbers
if k == 'mode' and isinstance( v, int ):
val = oct(v)
+ elif isinstance( v, UnknownConfiguration):
+ val = "UnknownConfigurationMock()"
else:
val = self._ppformat(v)
@@ -155,4 +156,8 @@ def InlineTemplate(name, **kwargs):
with RMFTestCase.env:
from resource_management.core.source import InlineTemplate
return InlineTemplate(name, **kwargs)
+
+class UnknownConfigurationMock():
+ def __eq__(self, other):
+ return isinstance(other, UnknownConfiguration)