You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/04/16 23:57:52 UTC

ambari git commit: AMBARI-10548. Unit tests failing in b.a.o

Repository: ambari
Updated Branches:
  refs/heads/trunk 3c2fa88f5 -> 2ca95b32b


AMBARI-10548. Unit tests failing in b.a.o


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

Branch: refs/heads/trunk
Commit: 2ca95b32bd0a39fc16270857266c01428d4ed49f
Parents: 3c2fa88
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Apr 16 13:35:43 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Apr 16 14:57:15 2015 -0700

----------------------------------------------------------------------
 .../src/test/python/ambari_agent/TestHeartbeat.py       | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca95b32/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 fc52c95..11a4182 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHeartbeat.py
@@ -26,6 +26,7 @@ import time
 from mock.mock import patch, MagicMock, call
 import StringIO
 import sys
+from ambari_agent.RecoveryManager import RecoveryManager
 
 
 with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
@@ -37,9 +38,9 @@ with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
   from ambari_agent.StackVersionsFileHandler import StackVersionsFileHandler
   from ambari_agent.HostInfo import HostInfoLinux
 
-from only_for_platform import only_for_platform, PLATFORM_LINUX
+from only_for_platform import not_for_platform, PLATFORM_WINDOWS
 
-@only_for_platform(PLATFORM_LINUX)
+@not_for_platform(PLATFORM_WINDOWS)
 class TestHeartbeat(TestCase):
 
   def setUp(self):
@@ -114,6 +115,7 @@ class TestHeartbeat(TestCase):
     config.set('agent', 'cache_dir', "/var/lib/ambari-agent/cache")
     config.set('agent', 'tolerate_download_failures', "true")
     dummy_controller = MagicMock()
+    dummy_controller.recovery_manager = RecoveryManager()
     actionQueue = ActionQueue(config, dummy_controller)
     result_mock.return_value = {
       'reports': [{'status': 'IN_PROGRESS',
@@ -174,6 +176,7 @@ class TestHeartbeat(TestCase):
     expected = {'nodeStatus':
                   {'status': 'HEALTHY',
                    'cause': 'NONE'},
+                'recoveryReport': {'summary': 'DISABLED'},
                 'timestamp': 'timestamp', 'hostname': 'hostname',
                 'responseId': 10, 'reports': [
       {'status': 'IN_PROGRESS', 'roleCommand': u'INSTALL',
@@ -195,6 +198,7 @@ class TestHeartbeat(TestCase):
        'stderr': 'stderr'}], 'componentStatus': [
       {'status': 'HEALTHY', 'componentName': 'DATANODE'},
       {'status': 'UNHEALTHY', 'componentName': 'NAMENODE'}]}
+    self.assertEqual.__self__.maxDiff = None
     self.assertEquals(hb, expected)
 
 
@@ -214,13 +218,13 @@ class TestHeartbeat(TestCase):
       "componentName" : "DATANODE",
       'configurations':{'global' : {}}
     }
-    actionQueue.put([statusCommand])
+    actionQueue.put_status([statusCommand])
 
     heartbeat = Heartbeat(actionQueue)
     heartbeat.build(12, 6)
     self.assertTrue(register_mock.called)
     args, kwargs = register_mock.call_args_list[0]
-    self.assertTrue(args[2])
+    self.assertFalse(args[2])
     self.assertFalse(args[1])