From d885339f1cbf208b06c1eb26c49c60d11d62f1c3 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 22 Jul 2010 14:16:22 -0400 Subject: Require that hosts be resolvable in DNS. Use --force to ignore warnings. This also requires a resolvable hostname on services as well. I want people to think long and hard about adding things that aren't resolvable. The cert plugin can automatically create services on the user's behalf when issuing a cert. It will always set the force flag to True. We use a lot of made-up host names in the test system, all of which require the force flag now. ticket #25 --- tests/test_xmlrpc/test_service_plugin.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tests/test_xmlrpc/test_service_plugin.py') diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py index 299c64fc1..96827e4c5 100644 --- a/tests/test_xmlrpc/test_service_plugin.py +++ b/tests/test_xmlrpc/test_service_plugin.py @@ -40,8 +40,8 @@ class test_service(XMLRPC_test): """ Test adding a HTTP principal using the `xmlrpc.service_add` method. """ - self.failsafe_add(api.Object.host, self.host) - entry = self.failsafe_add(api.Object.service, self.principal)['result'] + self.failsafe_add(api.Object.host, self.host, force=True) + entry = self.failsafe_add(api.Object.service, self.principal, force=True)['result'] assert_attr_equal(entry, 'krbprincipalname', self.principal) assert_attr_equal(entry, 'objectclass', 'ipaobject') @@ -50,11 +50,6 @@ class test_service(XMLRPC_test): Test adding a host principal using `xmlrpc.service_add`. Host services are not allowed. """ - # FIXME: Are host principals not allowed still? Running this test gives - # this error: - # - # NotFound: The host 'ipatest.example.com' does not exist to add a service to. - kw = {'krbprincipalname': self.hostprincipal} try: api.Command['service_add'](**kw) @@ -67,7 +62,7 @@ class test_service(XMLRPC_test): """ Test adding a malformed principal ('foo'). """ - kw = {'krbprincipalname': u'foo'} + kw = {'krbprincipalname': u'foo', 'force': True} try: api.Command['service_add'](**kw) except errors.MalformedServicePrincipal: @@ -79,7 +74,7 @@ class test_service(XMLRPC_test): """ Test adding a malformed principal ('HTTP/foo@FOO.NET'). """ - kw = {'krbprincipalname': u'HTTP/foo@FOO.NET'} + kw = {'krbprincipalname': u'HTTP/foo@FOO.NET', 'force': True} try: api.Command['service_add'](**kw) except errors.RealmMismatch: @@ -115,3 +110,5 @@ class test_service(XMLRPC_test): pass else: assert False + + api.Command['host_del'](self.host) -- cgit