ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-13440. Unit test fixes (smohanty)
Date Thu, 15 Oct 2015 20:50:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 f6a2ecc67 -> c8f1e53df


AMBARI-13440. Unit test fixes (smohanty)


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

Branch: refs/heads/branch-2.1
Commit: c8f1e53df3a2689b6ce1c2ad1d1d7af8979b0d4f
Parents: f6a2ecc
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Thu Oct 15 13:50:15 2015 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Thu Oct 15 13:50:15 2015 -0700

----------------------------------------------------------------------
 ambari-agent/src/test/python/ambari_agent/TestController.py       | 2 ++
 ambari-agent/src/test/python/ambari_agent/TestHardware.py         | 1 +
 ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py        | 3 +++
 ambari-agent/src/test/python/ambari_agent/TestRegistration.py     | 1 +
 .../org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java   | 1 -
 5 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c8f1e53d/ambari-agent/src/test/python/ambari_agent/TestController.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestController.py b/ambari-agent/src/test/python/ambari_agent/TestController.py
index ba6e6c8..1d2cc07 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestController.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestController.py
@@ -182,6 +182,7 @@ class TestController(unittest.TestCase):
 
 
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch("urllib2.build_opener")
   @patch("urllib2.install_opener")
@@ -221,6 +222,7 @@ class TestController(unittest.TestCase):
     self.assertTrue(aq.start.called)
 
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch("urllib2.build_opener")
   @patch("urllib2.install_opener")

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8f1e53d/ambari-agent/src/test/python/ambari_agent/TestHardware.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestHardware.py b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
index f35ff98..e096b95 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHardware.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
@@ -36,6 +36,7 @@ from ambari_commons import OSCheck
 @patch.object(socket, "gethostbyname", new = MagicMock(return_value = "192.168.1.1"))
 class TestHardware(TestCase):
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch.object(OSCheck, "get_os_type")
   @patch.object(OSCheck, "get_os_version")

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8f1e53d/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py b/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
index 0c78fdb..b2825bd 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
@@ -77,6 +77,7 @@ class TestHeartbeat(TestCase):
     self.assertEquals(not heartbeat.reports, True, "Heartbeat should not contain task in
progress")
 
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch.object(ActionQueue, "result")
   @patch.object(HostInfoLinux, "register")
@@ -202,6 +203,7 @@ class TestHeartbeat(TestCase):
     self.assertEquals(hb, expected)
 
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch.object(HostInfoLinux, 'register')
   def test_heartbeat_no_host_check_cmd_in_queue(self, register_mock):
@@ -229,6 +231,7 @@ class TestHeartbeat(TestCase):
     self.assertFalse(args[1])
 
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch.object(HostInfoLinux, 'register')
   def test_heartbeat_host_check_no_cmd(self, register_mock):

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8f1e53d/ambari-agent/src/test/python/ambari_agent/TestRegistration.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestRegistration.py b/ambari-agent/src/test/python/ambari_agent/TestRegistration.py
index c6aa019..b365889 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestRegistration.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestRegistration.py
@@ -32,6 +32,7 @@ from ambari_agent.Hardware import Hardware
 @not_for_platform(PLATFORM_WINDOWS)
 class TestRegistration(TestCase):
 
+  @patch.object(Hardware, "osdisks", new = MagicMock(return_value=[]))
   @patch.object(Hardware, "_chk_mount", new = MagicMock(return_value=True))
   @patch("ambari_commons.firewall.run_os_command")
   @patch.object(OSCheck, "get_os_type")

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8f1e53d/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
index 8851f72..8d82967 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
@@ -396,7 +396,6 @@ public class UpgradeCatalog213Test {
     expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
       put("normal", mockClusterExpected);
     }}).once();
-    expect(mockClusterExpected.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.2"));
 
     expect(mockClusterExpected.getDesiredConfigByType("storm-site")).andReturn(mockStormSite).atLeastOnce();
     expect(mockStormSite.getProperties()).andReturn(propertiesExpectedHiveSite).atLeastOnce();


Mime
View raw message