Tests: Provide AD cleanup for trust tests

Providing cleanup of trust information from AD machines for trusts tests.

https://fedorahosted.org/freeipa/ticket/6396

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
Lenka Doudova
2016-10-06 07:44:47 +02:00
committed by Martin Babinsky
parent a22a5dd676
commit 8a177732af
2 changed files with 14 additions and 0 deletions

View File

@@ -509,6 +509,17 @@ def remove_trust_with_ad(master, ad_domain):
range_name = ad_domain.upper() + '_id_range'
master.run_command(['ipa', 'idrange-del', range_name])
remove_trust_info_from_ad(master, ad_domain)
def remove_trust_info_from_ad(master, ad_domain):
# Remove record about trust from AD
master.run_command(['rpcclient', ad_domain,
'-U\\Administrator%{}'.format(
master.config.ad_admin_password),
'-c', 'deletetrustdom {}'.format(master.domain.name)],
raiseonerr=False)
def configure_auth_to_local_rule(master, ad):
"""

View File

@@ -35,6 +35,9 @@ class ADTrustBase(IntegrationTest):
@classmethod
def install(cls, mh):
if not cls.master.transport.file_exists('/usr/bin/rpcclient'):
raise nose.SkipTest("Package samba-client not available "
"on {}".format(cls.master.hostname))
super(ADTrustBase, cls).install(mh)
cls.ad = cls.ad_domains[0].ads[0]
cls.ad_domain = cls.ad.domain.name