You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/05/10 20:51:31 UTC

[ambari] branch trunk updated: AMBARI-21816. test_kms_server timing issue (#1235)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8419a1a  AMBARI-21816. test_kms_server timing issue (#1235)
8419a1a is described below

commit 8419a1a4bb75e24896ed16c0763a84d4b5832a90
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Thu May 10 22:51:28 2018 +0200

    AMBARI-21816. test_kms_server timing issue (#1235)
---
 ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py b/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py
index a5466b8..678a5ad 100644
--- a/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py
+++ b/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py
@@ -500,6 +500,7 @@ class TestRangerKMS(RMFTestCase):
   @patch("resource_management.libraries.functions.ranger_functions_v2.RangeradminV2.get_repository_by_name_curl", new=MagicMock(return_value=({'name': 'c1_kms'})))
   @patch("resource_management.libraries.functions.ranger_functions_v2.RangeradminV2.create_repository_curl", new=MagicMock(return_value=({'name': 'c1_kms'})))
   @patch("os.path.isfile")
+  @patch("kms.datetime", new=DTMOCK())
   def test_start_secured(self, isfile_mock):
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kms_server.py",
@@ -513,7 +514,7 @@ class TestRangerKMS(RMFTestCase):
 
     # TODO repo call in secure
 
-    current_datetime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+    current_datetime = self.current_date.strftime("%Y-%m-%d %H:%M:%S")
 
     self.assertResourceCalled('File', '/usr/hdp/current/ranger-kms/conf/ranger-security.xml',
       owner = 'kms',

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.