Repository: ambari Updated Branches: refs/heads/trunk c7157e00f -> a69d17fad
AMBARI-10552. Several ambari-server python unit tests fail because OS type is not mocked Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a69d17fa Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a69d17fa Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a69d17fa Branch: refs/heads/trunk Commit: a69d17fad8e76c45a182218724de19aae8173d2e Parents: c7157e0 Author: Sumit Mohanty <[email protected]> Authored: Thu Apr 16 16:04:42 2015 -0700 Committer: Sumit Mohanty <[email protected]> Committed: Thu Apr 16 16:04:42 2015 -0700 ---------------------------------------------------------------------- .../src/test/python/stacks/2.0.6/YARN/test_historyserver.py | 1 + .../src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py | 1 + .../test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py | 1 + ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py | 1 + .../src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py | 1 + ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py | 1 + .../src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py | 1 + .../src/test/python/stacks/2.1/YARN/test_apptimelineserver.py | 1 + 8 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py index 6117a6c..dc7fc11 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py @@ -22,6 +22,7 @@ from stacks.utils.RMFTestCase import * import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py index 3cabf10..4fdc398 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py @@ -22,6 +22,7 @@ from stacks.utils.RMFTestCase import * import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py index 3af8064..01073df 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_service_check.py @@ -22,6 +22,7 @@ from stacks.utils.RMFTestCase import * import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py index 9c88389..44ea312 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py @@ -24,6 +24,7 @@ from resource_management.core import shell import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py index 0b5b6e2..8f2d192 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py @@ -22,6 +22,7 @@ from stacks.utils.RMFTestCase import * import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py index 192f64c..c70d4ca 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py @@ -23,6 +23,7 @@ from resource_management.libraries.script.script import Script import os origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0]) if args[0][-2:] == "j2" else True)) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py index 3a351b2..7cde2cc 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py @@ -21,6 +21,7 @@ import os from mock.mock import MagicMock, call, patch from stacks.utils.RMFTestCase import * +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch("sys.executable", new = '/usr/bin/python2.6') class TestServiceCheck(RMFTestCase): COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package" http://git-wip-us.apache.org/repos/asf/ambari/blob/a69d17fa/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py index 26e6948..fed1350 100644 --- a/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py +++ b/ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py @@ -23,6 +23,7 @@ import os import resource_management.libraries.functions origin_exists = os.path.exists +@patch("platform.linux_distribution", new = MagicMock(return_value="Linux")) @patch.object(resource_management.libraries.functions, "check_process_status", new = MagicMock()) @patch.object(os.path, "exists", new=MagicMock( side_effect=lambda *args: origin_exists(args[0])
