From 0e5879c0e3f83b0bbaff79d9c97f672055b61c4f Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Wed, 30 Mar 2011 08:38:41 -0400 Subject: Configuration parsing updates These changes are all related to following ticket: https://fedorahosted.org/sssd/ticket/763 Changes in SSSDConfig.py merge old and new domain record instead of just deleting the old and inserting the new one. The old approach let to loss of some information like comments and blank lines in the config file. Changes in API config were performed so our Python scripts (like sss_obfuscate) don't add extra config options to the config file. --- src/config/SSSDConfigTest.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'src/config/SSSDConfigTest.py') diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py index cad183ea0..af32acc67 100755 --- a/src/config/SSSDConfigTest.py +++ b/src/config/SSSDConfigTest.py @@ -599,33 +599,7 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase): # First test default options options = domain.list_mandatory_options() - control_list = [ - 'cache_credentials', - 'id_provider', - 'auth_provider'] - - self.assertTrue(type(options) == dict, - "Options should be a dictionary") - - # Ensure that all of the expected defaults are there - for option in control_list: - self.assertTrue(option in options.keys(), - "Option [%s] missing" % - option) - - # Ensure that there aren't any unexpected options listed - for option in options.keys(): - self.assertTrue(option in control_list, - 'Option [%s] unexpectedly found' % - option) - - # Add a provider and verify that the new options appear - domain.add_provider('local', 'id') - control_list.extend( - ['default_shell', - 'base_directory']) - - options = domain.list_mandatory_options() + control_list = ['id_provider'] self.assertTrue(type(options) == dict, "Options should be a dictionary") @@ -1000,11 +974,6 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase): def testRemoveOption(self): domain = SSSDConfig.SSSDDomain('sssd', self.schema) - # Positive test - Remove existing option - self.assertTrue('cache_credentials' in domain.get_all_options().keys()) - domain.remove_option('cache_credentials') - self.assertFalse('cache_credentials' in domain.get_all_options().keys()) - # Positive test - Remove unset but valid option self.assertFalse('max_id' in domain.get_all_options().keys()) domain.remove_option('max_id') -- cgit