ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-18273. Add logging to differentiate between ambari-server start/restart commands vs. other commands.(vbrodetskyi)
Date Mon, 05 Sep 2016 19:21:57 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 32e02482d -> 2a18fe4fe


AMBARI-18273. Add logging to differentiate between ambari-server start/restart commands vs.
other commands.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 2a18fe4feaf3ff1c75c77c443f40f2cfc79a0677
Parents: 32e0248
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Mon Sep 5 22:21:44 2016 +0300
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Mon Sep 5 22:21:44 2016 +0300

----------------------------------------------------------------------
 .../src/test/python/TestAmbariServer.py         | 41 +++++++++++++++-----
 1 file changed, 31 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a18fe4f/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py
index f6bf685..37af554 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -295,7 +295,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "setup_security")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_setup_security(self, logger_mock, OptionParserMock,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_setup_security(self, setup_logging_mock, get_ambari_properties_mock,
logger_mock, OptionParserMock,
                                     setup_security_method):
     opm = OptionParserMock.return_value
     options = MagicMock()
@@ -393,7 +395,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "reset")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_setup(self, logger_mock, OptionParserMock, reset_method, stop_method,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_setup(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
OptionParserMock, reset_method, stop_method,
                            start_method, setup_method, exit_mock):
     opm = OptionParserMock.return_value
     options = self._create_empty_options_mock()
@@ -459,7 +463,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "setup")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_with_preset_dbms(self, logger_mock, optionParserMock, setup_method):
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_with_preset_dbms(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
optionParserMock, setup_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
     args = ["setup"]
@@ -478,7 +484,10 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "fix_database_options")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_fix_database_options_called(self, logger_mock, optionParserMock, fixDBOptionsMock,
setup_method):
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_fix_database_options_called(self, setup_logging_mock, get_ambari_properties_mock,
logger_mock, optionParserMock,
+                                       fixDBOptionsMock, setup_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
     args = ["setup"]
@@ -498,7 +507,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "reset")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_start(self, logger_mock, optionParserMock, reset_method, stop_method,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_start(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
optionParserMock, reset_method, stop_method,
                            start_method, setup_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
@@ -629,7 +640,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "restore")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_backup(self, logger_mock, optionParserMock, restore_mock, backup_mock,
reset_method, stop_method,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_backup(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
optionParserMock, restore_mock, backup_mock, reset_method, stop_method,
                            start_method, setup_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
@@ -662,7 +675,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "restore")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_restore(self, logger_mock, optionParserMock, restore_mock, backup_mock,
reset_method, stop_method,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_restore(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
optionParserMock, restore_mock, backup_mock, reset_method, stop_method,
                             start_method, setup_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
@@ -756,7 +771,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "reset")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_reset(self, logger_mock, optionParserMock, reset_method, stop_method,
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_reset(self, setup_logging_mock, get_ambari_properties_mock, logger_mock,
optionParserMock, reset_method, stop_method,
                            start_method, setup_method):
     opm = optionParserMock.return_value
 
@@ -8489,7 +8506,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "is_server_runing")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_status_running(self, logger_mock,  optionParserMock, is_server_runing_method):
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_status_running(self, setup_logging_mock, get_ambari_properties_mock,
logger_mock,  optionParserMock, is_server_runing_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
     del options.exit_message
@@ -8516,7 +8535,9 @@ class TestAmbariServer(TestCase):
   @patch.object(_ambari_server_, "is_server_runing")
   @patch("optparse.OptionParser")
   @patch.object(_ambari_server_, "logger")
-  def test_main_test_status_not_running(self, logger_mock, optionParserMock, is_server_runing_method):
+  @patch("ambari_server.serverConfiguration.get_ambari_properties")
+  @patch.object(_ambari_server_, "setup_logging")
+  def test_main_test_status_not_running(self, setup_logging_mock, get_ambari_properties_mock,
logger_mock, optionParserMock, is_server_runing_method):
     opm = optionParserMock.return_value
     options = self._create_empty_options_mock()
     del options.exit_message


Mime
View raw message