summaryrefslogtreecommitdiffstats
path: root/server/config/SSSDConfigTest.py
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-12-07 15:14:51 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-12-08 23:35:29 -0500
commit9c7473b26897384b8c5d00612e082c1cabe49370 (patch)
tree61de812f84204dd3d021ad7d1de0e28f8501d5e5 /server/config/SSSDConfigTest.py
parentafa260fcc56bde83e4b77282c7b3b22cfb4eca47 (diff)
downloadsssd-9c7473b26897384b8c5d00612e082c1cabe49370.tar.gz
sssd-9c7473b26897384b8c5d00612e082c1cabe49370.tar.xz
sssd-9c7473b26897384b8c5d00612e082c1cabe49370.zip
Make SSSDDomain.remove_provider() remove configured options
We will remove all options for a provider that are not also required by another configured provider. (For example, we will not remove krb5_realm when deleting the krb5 auth provider if the LDAP provider is in use, since it may still require this argument).
Diffstat (limited to 'server/config/SSSDConfigTest.py')
-rw-r--r--server/config/SSSDConfigTest.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/config/SSSDConfigTest.py b/server/config/SSSDConfigTest.py
index fa111819f..3d8b596ac 100644
--- a/server/config/SSSDConfigTest.py
+++ b/server/config/SSSDConfigTest.py
@@ -664,6 +664,30 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
'Option [%s] unexpectedly found' %
option)
+ # Remove the local ID provider and add an LDAP one
+ # LDAP ID providers can also use the krb5_realm
+ domain.remove_provider('id')
+
+ domain.add_provider('ldap', 'id')
+
+ # Set the krb5_realm option and the ldap_uri option
+ domain.set_option('krb5_realm', 'EXAMPLE.COM')
+ domain.set_option('ldap_uri', 'ldap://ldap.example.com')
+
+ self.assertEquals(domain.get_option('krb5_realm'),
+ 'EXAMPLE.COM')
+ self.assertEquals(domain.get_option('ldap_uri'),
+ 'ldap://ldap.example.com')
+
+ # Remove the LDAP provider and verify that krb5_realm remains
+ domain.remove_provider('id')
+ self.assertEquals(domain.get_option('krb5_realm'),
+ 'EXAMPLE.COM')
+ self.assertFalse(domain.options.has_key('ldap_uri'))
+
+ # Put the LOCAL provider back
+ domain.add_provider('local', 'id')
+
# Remove the auth domain and verify that the options
# revert to the backup_list
domain.remove_provider('auth')
@@ -684,6 +708,9 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
'Option [%s] unexpectedly found' %
option)
+ # Ensure that the krb5_realm option is now gone
+ self.assertFalse(domain.options.has_key('krb5_realm'))
+
# Test removing nonexistent provider - Real
domain.remove_provider('id')