You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2015/03/04 03:30:43 UTC

ambari git commit: AMBARI-9916. Fix minor issues with test_security_status test cases (rlevas)

Repository: ambari
Updated Branches:
  refs/heads/trunk 3d1dd509a -> 33a84155f


AMBARI-9916. Fix minor issues with test_security_status test cases (rlevas)


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

Branch: refs/heads/trunk
Commit: 33a84155f28ebeee5584c690860342f9ce604fe1
Parents: 3d1dd50
Author: Robert Levas <rl...@hortonworks.com>
Authored: Tue Mar 3 21:29:26 2015 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Tue Mar 3 21:29:26 2015 -0500

----------------------------------------------------------------------
 .../stacks/2.0.6/HBASE/test_hbase_master.py     | 21 ++++++--------------
 .../test/python/stacks/2.0.6/HDFS/test_zkfc.py  |  1 -
 2 files changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/33a84155/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
index bc4d942..36c942e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
@@ -567,7 +567,6 @@ class TestHBaseMaster(RMFTestCase):
   @patch("resource_management.libraries.script.Script.put_structured_out")
   def test_security_status(self, put_structured_out_mock, cached_kinit_executor_mock, validate_security_config_mock, get_params_mock, build_exp_mock):
     # Test that function works when is called with correct parameters
-    import collections
 
     security_params = {
       'hbase-site': {
@@ -576,13 +575,6 @@ class TestHBaseMaster(RMFTestCase):
       }
     }
 
-    status_params = {
-      'kinit_path_local' : '/bin/kinit',
-      'hbase_user' : 'hbase',
-      'hostname' : 'localhost',
-      'tmp_dir' : '/thisdoesmotexost'
-    }
-
     result_issues = []
     props_value_check = {"hbase.security.authentication": "kerberos",
                            "hbase.security.authorization": "true"}
@@ -604,13 +596,12 @@ class TestHBaseMaster(RMFTestCase):
 
     build_exp_mock.assert_called_with('hbase-site', props_value_check, props_empty_check, props_read_check)
     put_structured_out_mock.assert_called_with({"securityState": "SECURED_KERBEROS"})
-    cached_kinit_executor_mock.called_with(status_params['kinit_path_local'],
-                              status_params['hbase_user'],
-                              security_params['hbase-site']['hbase.master.keytab.file'],
-                              security_params['hbase-site']['hbase.master.kerberos.principal'],
-                              status_params['hostname'],
-                              status_params['tmp_dir'],
-                              30)
+    cached_kinit_executor_mock.called_with('/usr/bin/kinit',
+                                           self.config_dict['configurations']['hbase-env']['hbase_user'],
+                                           security_params['hbase-site']['hbase.master.keytab.file'],
+                                           security_params['hbase-site']['hbase.master.kerberos.principal'],
+                                           self.config_dict['hostname'],
+                                           '/tmp')
 
      # Testing that the exception throw by cached_executor is caught
     cached_kinit_executor_mock.reset_mock()

http://git-wip-us.apache.org/repos/asf/ambari/blob/33a84155/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
index b9d49b4..8aa4871 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py
@@ -346,7 +346,6 @@ class TestZkfc(RMFTestCase):
   @patch("resource_management.libraries.functions.security_commons.cached_kinit_executor")
   @patch("resource_management.libraries.script.Script.put_structured_out")
   def test_security_status(self, put_structured_out_mock, cached_kinit_executor_mock, validate_security_config_mock, get_params_mock, build_exp_mock):
-    print "HELLO WORLD!!!!"
 
     # Test that function works when is called with correct parameters
     security_params = {