From 8a177732afc404a830b75cab03fb420af93fa441 Mon Sep 17 00:00:00 2001 From: Lenka Doudova Date: Nov 14 2016 13:32:10 +0000 Subject: 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 --- diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py index 4412c14..e7c33d0 100644 --- a/ipatests/test_integration/tasks.py +++ b/ipatests/test_integration/tasks.py @@ -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): """ diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py index 6b30338..27c0e56 100644 --- a/ipatests/test_integration/test_trust.py +++ b/ipatests/test_integration/test_trust.py @@ -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