Imported Debian patch 4.8.10-2
This commit is contained in:
committed by
Mario Fetka
parent
8bc559c5a1
commit
358acdd85f
@@ -42,6 +42,7 @@ fqdn2 = u'testhost2.%s' % api.env.domain
|
||||
fqdn3 = u'TestHost3.%s' % api.env.domain
|
||||
service1_no_realm = u'HTTP/%s' % fqdn1
|
||||
service1 = u'%s@%s' % (service1_no_realm, api.env.realm)
|
||||
badservice = u'badservice@%s' % api.env.realm # no hostname
|
||||
hostprincipal1 = u'host/%s@%s' % (fqdn1, api.env.realm)
|
||||
service1dn = DN(('krbprincipalname',service1),('cn','services'),('cn','accounts'),api.env.basedn)
|
||||
host1dn = DN(('fqdn',fqdn1),('cn','computers'),('cn','accounts'),api.env.basedn)
|
||||
@@ -119,6 +120,12 @@ class test_service(Declarative):
|
||||
reason=u'%s: service not found' % service1),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc='Try to delete service without hostname %r' % badservice,
|
||||
command=('service_del', [badservice], {}),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: service not found' % badservice),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc='Create %r' % fqdn1,
|
||||
@@ -757,6 +764,16 @@ class test_service(Declarative):
|
||||
reason=u'%s: service not found' % service1),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc='Try to update service without hostname %r' % badservice,
|
||||
command=(
|
||||
'service_mod',
|
||||
[badservice],
|
||||
dict(usercertificate=servercert)
|
||||
),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: service not found' % badservice),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc='Try to delete non-existent %r' % service1,
|
||||
@@ -794,28 +811,109 @@ class test_service(Declarative):
|
||||
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'),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='HTTP/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
# DN is case insensitive, see https://pagure.io/freeipa/issue/8308
|
||||
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='http/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
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'),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='ldap/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc=('Delete the current host (master?) %s dns service,'
|
||||
' should be caught' % api.env.host),
|
||||
command=('service_del', ['DNS/%s' % api.env.host], {}),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='DNS/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc='Disable the current host (master?) %s HTTP service, should be caught' % api.env.host,
|
||||
command=('service_disable', ['HTTP/%s' % api.env.host], {}),
|
||||
expected=errors.ValidationError(name='principal', error='This principal is required by the IPA master'),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='HTTP/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc=(
|
||||
'Disable the current host (master?) %s HTTP service, should '
|
||||
'be caught'
|
||||
) % api.env.host,
|
||||
command=('service_disable', ['http/%s' % api.env.host], {}),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='http/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
dict(
|
||||
desc='Disable the current host (master?) %s ldap service, should be caught' % api.env.host,
|
||||
command=('service_disable', ['ldap/%s' % api.env.host], {}),
|
||||
expected=errors.ValidationError(name='principal', error='This principal is required by the IPA master'),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='ldap/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc=('Disable the current host (master?) %s dns service,'
|
||||
' should be caught' % api.env.host),
|
||||
command=('service_disable', ['DNS/%s' % api.env.host], {}),
|
||||
expected=errors.ValidationError(
|
||||
name='principal',
|
||||
error='DNS/%s@%s is required by the IPA master' % (
|
||||
api.env.host,
|
||||
api.env.realm
|
||||
)
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -920,6 +1018,7 @@ class test_service_in_role(Declarative):
|
||||
hostgroup=[],
|
||||
service=[],
|
||||
user=[],
|
||||
idoverrideuser=[],
|
||||
),
|
||||
),
|
||||
completed=1,
|
||||
@@ -1045,7 +1144,8 @@ class test_service_allowed_to(Declarative):
|
||||
completed=1,
|
||||
failed=dict(member=dict(group=[],
|
||||
service=[],
|
||||
user=[])),
|
||||
user=[],
|
||||
idoverrideuser=[])),
|
||||
result=dict(
|
||||
cn=[group1],
|
||||
gidnumber=[fuzzy_digits],
|
||||
@@ -1464,17 +1564,20 @@ def indicators_service(request):
|
||||
class TestAuthenticationIndicators(XMLRPC_test):
|
||||
def test_create_service_with_otp_indicator(
|
||||
self, indicators_host, indicators_service):
|
||||
""" Since range of authentication indicator values is not limited,
|
||||
only 'otp' option is tested """
|
||||
indicators_host.create()
|
||||
indicators_service.create()
|
||||
|
||||
def test_adding_second_indicator(
|
||||
def test_adding_all_indicators(
|
||||
self, indicators_host, indicators_service):
|
||||
indicators_host.create()
|
||||
indicators_service.create()
|
||||
indicators_service.update(
|
||||
updates={u'krbprincipalauthind': [u'otp', u'radius']})
|
||||
updates={
|
||||
u'krbprincipalauthind': [
|
||||
u'otp', u'radius', u'pkinit', u'hardened'
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
def test_update_indicator(self, indicators_host, indicators_service):
|
||||
indicators_host.create()
|
||||
|
||||
Reference in New Issue
Block a user