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 2017/10/04 12:58:45 UTC

ambari git commit: AMBARI-22130. Agent UT fail on trunk (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 15cd1c598 -> de981ca00


AMBARI-22130. Agent UT fail on trunk (aonishuk)


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

Branch: refs/heads/trunk
Commit: de981ca006eba891868d97983c03a3cb019e23ef
Parents: 15cd1c5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Oct 4 15:57:54 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Oct 4 15:57:54 2017 +0300

----------------------------------------------------------------------
 ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py | 5 +----
 ambari-agent/src/test/python/ambari_agent/TestMain.py       | 5 ++---
 ambari-agent/src/test/python/ambari_agent/TestSecurity.py   | 1 -
 3 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/de981ca0/ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py b/ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py
index 930c845..abd7def 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestLiveStatus.py
@@ -25,7 +25,6 @@ import os, sys, StringIO
 from ambari_agent import ActualConfigHandler
 from mock.mock import patch, MagicMock
 import pprint
-from ambari_agent import StatusCheck
 from ambari_commons import OSCheck
 from only_for_platform import os_distro_value
 
@@ -43,8 +42,7 @@ class TestLiveStatus(TestCase):
 
   @patch.object(OSCheck, "os_distribution", new = MagicMock(return_value = os_distro_value))
   @patch.object(ActualConfigHandler.ActualConfigHandler, "read_actual_component")
-  @patch.object(StatusCheck.StatusCheck, "getStatus")
-  def test_build_predefined(self, getStatus_mock, read_actual_component_mock):
+  def test_build_predefined(self, read_actual_component_mock):
     read_actual_component_mock.return_value = "actual_component"
     """
     Tests that if live status us defined (using default parameter),
@@ -62,6 +60,5 @@ class TestLiveStatus(TestCase):
                      "'configurationTags': 'actual_component',\n "
                      "'msg': '',\n 'serviceName': 'SOME_UNKNOWN_SERVICE',\n "
                      "'stackVersion': '',\n 'status': 'STARTED'}")
-    self.assertFalse(getStatus_mock.called)
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/de981ca0/ambari-agent/src/test/python/ambari_agent/TestMain.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestMain.py b/ambari-agent/src/test/python/ambari_agent/TestMain.py
index 504ca08..35f5e6f 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestMain.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestMain.py
@@ -36,7 +36,7 @@ from mock.mock import MagicMock, patch, ANY, Mock, call
 
 with patch.object(OSCheck, "os_distribution", new = MagicMock(return_value = os_distro_value)):
   from ambari_agent import NetUtil, security
-  from ambari_agent import ProcessHelper, main
+  from ambari_agent import main
   from ambari_agent.AmbariConfig import AmbariConfig
   from ambari_agent.PingPortListener import PingPortListener
   from ambari_agent.Controller import Controller
@@ -62,8 +62,7 @@ class TestMain(unittest.TestCase):
   @patch("ambari_agent.HeartbeatHandlers.HeartbeatStopHandlersLinux")
   @patch("sys.exit")
   @patch("os.getpid")
-  @patch.object(ProcessHelper, "stopAgent")
-  def test_signal_handler(self, stopAgent_mock, os_getpid_mock, sys_exit_mock, heartbeat_handler_mock):
+  def test_signal_handler(self,os_getpid_mock, sys_exit_mock, heartbeat_handler_mock):
     # testing exit of children
     main.agentPid = 4444
     os_getpid_mock.return_value = 5555

http://git-wip-us.apache.org/repos/asf/ambari/blob/de981ca0/ambari-agent/src/test/python/ambari_agent/TestSecurity.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestSecurity.py b/ambari-agent/src/test/python/ambari_agent/TestSecurity.py
index c9a7fbe..ac295b5 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestSecurity.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestSecurity.py
@@ -35,7 +35,6 @@ from only_for_platform import os_distro_value
 with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
   from ambari_agent import NetUtil
   from ambari_agent.security import CertificateManager
-  from ambari_agent import ProcessHelper, main
   from ambari_agent.AmbariConfig import AmbariConfig
   from ambari_agent.Controller import Controller
   from ambari_agent import security