|
@@ -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()
|