summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-02-22 17:42:38 -0500
committerMartin Kosek <mkosek@redhat.com>2012-02-23 20:17:12 +0100
commitd4a1dc5712cd2fa9e028a43e5b7146891e5012f0 (patch)
tree7259092817babb11ba0ea02022d8b9f6a199f467 /tests
parent915286fed2771415b48f5476047b283b8a5fed3c (diff)
downloadfreeipa-d4a1dc5712cd2fa9e028a43e5b7146891e5012f0.tar.gz
freeipa-d4a1dc5712cd2fa9e028a43e5b7146891e5012f0.tar.xz
freeipa-d4a1dc5712cd2fa9e028a43e5b7146891e5012f0.zip
Don't allow IPA master hosts or important services be deleted.
Deleting these would cause the IPA master to blow up. For services I'm taking a conservative approach and only limiting the deletion of known services we care about. https://fedorahosted.org/freeipa/ticket/2425
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py9
-rw-r--r--tests/test_xmlrpc/test_service_plugin.py17
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 372ee256e..0323ac39a 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -661,4 +661,13 @@ class test_host(Declarative):
),
),
+
+ # This test will only succeed when running against lite-server.py
+ # on same box as IPA install.
+ dict(
+ desc='Delete the current host (master?) %s should be caught' % api.env.host,
+ command=('host_del', [api.env.host], {}),
+ expected=errors.ValidationError(name='fqdn', error='An IPA master host cannot be deleted'),
+ ),
+
]
diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py
index d36dac984..e97fb7c87 100644
--- a/tests/test_xmlrpc/test_service_plugin.py
+++ b/tests/test_xmlrpc/test_service_plugin.py
@@ -467,4 +467,21 @@ class test_service(Declarative):
expected=errors.HostService()
),
+
+ # These tests will only succeed when running against lite-server.py
+ # on same box as IPA install.
+ dict(
+ desc='Delete the current host (master?) %s HTTP service, should be caught' % api.env.host,
+ command=('service_del', ['HTTP/%s' % api.env.host], {}),
+ expected=errors.ValidationError(name='principal', error='This principal is required by the IPA master'),
+ ),
+
+
+ dict(
+ desc='Delete the current host (master?) %s ldap service, should be caught' % api.env.host,
+ command=('service_del', ['ldap/%s' % api.env.host], {}),
+ expected=errors.ValidationError(name='principal', error='This principal is required by the IPA master'),
+ ),
+
+
]