Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -23,8 +23,7 @@ Test the `ipalib/plugins/realmdomains.py` module.
|
||||
from ipalib import api, errors
|
||||
from ipapython.dn import DN
|
||||
from ipatests.test_xmlrpc import objectclasses
|
||||
from ipatests.test_xmlrpc.xmlrpc_test import Declarative
|
||||
import pytest
|
||||
from xmlrpc_test import Declarative
|
||||
|
||||
|
||||
cn = u'Realm Domains'
|
||||
@@ -35,12 +34,8 @@ new_domain_2 = u'example2.com'
|
||||
bad_domain = u'doesnotexist.test'
|
||||
|
||||
|
||||
@pytest.mark.tier1
|
||||
class test_realmdomains(Declarative):
|
||||
|
||||
# Make sure your environment has sound DNS configuration where
|
||||
# the IPA domain has either NS or SOA record. Check your resolver
|
||||
# if getting errors with the realmdomains_mod cleanup command.
|
||||
cleanup_commands = [
|
||||
('realmdomains_mod', [], {'associateddomain': [our_domain]}),
|
||||
]
|
||||
@@ -94,20 +89,10 @@ class test_realmdomains(Declarative):
|
||||
),
|
||||
dict(
|
||||
desc='Replace list of realm domains with "%s"' % [our_domain, new_domain_1],
|
||||
command=('realmdomains_mod', [], {'associateddomain': [our_domain, new_domain_1], 'force':True}),
|
||||
command=('realmdomains_mod', [], {'associateddomain': [our_domain, new_domain_1]}),
|
||||
expected=dict(
|
||||
value=None,
|
||||
summary=None,
|
||||
messages=({u'message': u"The _kerberos TXT record from domain "
|
||||
"example1.com could not be created (%s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please create the record "
|
||||
"manually, containing the following value: "
|
||||
"'%s'" % (new_domain_1, api.env.realm),
|
||||
u'code': 13011,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordCreationFailure'},
|
||||
),
|
||||
result=dict(
|
||||
associateddomain=[our_domain, new_domain_1],
|
||||
),
|
||||
@@ -115,24 +100,13 @@ class test_realmdomains(Declarative):
|
||||
),
|
||||
dict(
|
||||
desc='Add domain "%s" to list' % new_domain_2,
|
||||
command=('realmdomains_mod', [], {'add_domain': new_domain_2, 'force': True}),
|
||||
command=('realmdomains_mod', [], {'add_domain': new_domain_2}),
|
||||
expected=dict(
|
||||
value=None,
|
||||
summary=None,
|
||||
result=dict(
|
||||
associateddomain=[our_domain, new_domain_1, new_domain_2],
|
||||
),
|
||||
messages=({u'message': u"The _kerberos TXT record from domain "
|
||||
"%(domain)s could not be created (%(domain)s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please create the record "
|
||||
"manually, containing the following value: "
|
||||
"'%(realm)s'" % dict(domain=new_domain_2,
|
||||
realm=api.env.realm),
|
||||
u'code': 13011,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordCreationFailure'},
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
@@ -144,45 +118,17 @@ class test_realmdomains(Declarative):
|
||||
result=dict(
|
||||
associateddomain=[our_domain, new_domain_1],
|
||||
),
|
||||
messages=({u'message': u"The _kerberos TXT record from domain "
|
||||
"%(domain)s could not be removed (%(domain)s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please remove the record "
|
||||
"manually." % dict(domain=new_domain_2),
|
||||
u'code': 13012,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordDeletionFailure'},
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
desc='Add domain "%s" and delete domain "%s"' % (new_domain_2, new_domain_1),
|
||||
command=('realmdomains_mod', [], {'add_domain': new_domain_2, 'del_domain': new_domain_1, 'force': True}),
|
||||
command=('realmdomains_mod', [], {'add_domain': new_domain_2, 'del_domain': new_domain_1}),
|
||||
expected=dict(
|
||||
value=None,
|
||||
summary=None,
|
||||
result=dict(
|
||||
associateddomain=[our_domain, new_domain_2],
|
||||
),
|
||||
messages=({u'message': u"The _kerberos TXT record from domain "
|
||||
"%(domain)s could not be created (%(domain)s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please create the record "
|
||||
"manually, containing the following value: "
|
||||
"'%(realm)s'" % dict(domain=new_domain_2,
|
||||
realm=api.env.realm),
|
||||
u'code': 13011,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordCreationFailure'},
|
||||
{u'message': u"The _kerberos TXT record from domain "
|
||||
"%(domain)s could not be removed (%(domain)s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please remove the record "
|
||||
"manually." % dict(domain=new_domain_1),
|
||||
u'code': 13012,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordDeletionFailure'},
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
@@ -192,31 +138,31 @@ class test_realmdomains(Declarative):
|
||||
'add_domain': new_domain_1,
|
||||
}),
|
||||
expected=errors.MutuallyExclusiveError(
|
||||
reason='The --domain option cannot be used together with --add-domain or --del-domain. Use --domain to specify the whole realm domain list explicitly, to add/remove individual domains, use --add-domain/del-domain.'),
|
||||
reason='you cannot specify the --domain option together with --add-domain or --del-domain'),
|
||||
),
|
||||
dict(
|
||||
desc='Try to replace list of realm domains with a list without our domain',
|
||||
command=('realmdomains_mod', [], {'associateddomain': [new_domain_1]}),
|
||||
expected=errors.ValidationError(
|
||||
name='realmdomain list', error='IPA server domain cannot be omitted'),
|
||||
name='domain', error='cannot delete domain of IPA server'),
|
||||
),
|
||||
dict(
|
||||
desc='Try to replace list of realm domains with a list with an invalid domain "%s"' % bad_domain,
|
||||
command=('realmdomains_mod', [], {'associateddomain': [our_domain, bad_domain]}),
|
||||
expected=errors.ValidationError(
|
||||
name='domain', error='DNS zone for each realmdomain must contain SOA or NS records. No records found for: %s' % bad_domain),
|
||||
name='domain', error='no SOA or NS records found for domains: %s' % bad_domain),
|
||||
),
|
||||
dict(
|
||||
desc='Try to add an invalid domain "%s"' % bad_domain,
|
||||
command=('realmdomains_mod', [], {'add_domain': bad_domain}),
|
||||
expected=errors.ValidationError(
|
||||
name='domain', error='DNS zone for each realmdomain must contain SOA or NS records. No records found for: %s' % bad_domain),
|
||||
name='add_domain', error='no SOA or NS records found for domain %s' % bad_domain),
|
||||
),
|
||||
dict(
|
||||
desc='Try to delete our domain',
|
||||
command=('realmdomains_mod', [], {'del_domain': our_domain}),
|
||||
expected=errors.ValidationError(
|
||||
name='del_domain', error='IPA server domain cannot be deleted'),
|
||||
name='del_domain', error='cannot delete domain of IPA server'),
|
||||
),
|
||||
dict(
|
||||
desc='Try to delete domain which is not in list',
|
||||
@@ -233,17 +179,6 @@ class test_realmdomains(Declarative):
|
||||
result=dict(
|
||||
associateddomain=[our_domain, new_domain_2, bad_domain],
|
||||
),
|
||||
messages=({u'message': u"The _kerberos TXT record from domain "
|
||||
"%(domain)s could not be created (%(domain)s.: "
|
||||
"DNS zone not found).\nThis can happen if the zone "
|
||||
"is not managed by IPA. Please create the record "
|
||||
"manually, containing the following value: "
|
||||
"'%(realm)s'" % dict(domain=bad_domain,
|
||||
realm=api.env.realm),
|
||||
u'code': 13011,
|
||||
u'type': u'warning',
|
||||
u'name': u'KerberosTXTRecordCreationFailure'},
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user