summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-06-16 17:25:04 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-08-07 12:49:47 +0200
commit6bb4eea348f9c90351987e20a49bbaca265291f4 (patch)
tree7bd8bd759208bb376edb92234300f4b3424b53a1 /ipatests
parent7caed6ecfb17050796c11fa9718aa8fb1464655d (diff)
downloadfreeipa-6bb4eea348f9c90351987e20a49bbaca265291f4.tar.gz
freeipa-6bb4eea348f9c90351987e20a49bbaca265291f4.tar.xz
freeipa-6bb4eea348f9c90351987e20a49bbaca265291f4.zip
ipatests: test_trust: Add test to cover lookup of trusdomains
Adds an integration tests that checks that all trustdomains are able to be found by trustdomain-find command right after the trust has been established. Also moves some code to allow easier adding common test cases for both POSIX and non-POSIX test classes. https://fedorahosted.org/freeipa/ticket/4208 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/test_trust.py36
1 files changed, 31 insertions, 5 deletions
diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py
index 95e48dd9c..597f4ced7 100644
--- a/ipatests/test_integration/test_trust.py
+++ b/ipatests/test_integration/test_trust.py
@@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import nose
import re
from ipatests.test_integration.base import IntegrationTest
@@ -29,6 +30,7 @@ class ADTrustBase(IntegrationTest):
topology = 'line'
num_ad_domains = 1
+ optional_extra_roles = ['ad_subdomain']
@classmethod
def install(cls):
@@ -38,6 +40,14 @@ class ADTrustBase(IntegrationTest):
cls.check_sid_generation()
cls.configure_dns_and_time()
+ # Determine whether the subdomain AD is available
+ try:
+ child_ad = cls.host_by_role(cls.optional_extra_roles[0])
+ cls.ad_subdomain = '.'.join(
+ child_ad.hostname.split('.')[1:])
+ except LookupError:
+ cls.ad_subdomain = None
+
@classmethod
def install_adtrust(cls):
"""Test adtrust support installation"""
@@ -64,16 +74,32 @@ class ADTrustBase(IntegrationTest):
tasks.configure_dns_for_trust(cls.master, cls.ad)
tasks.sync_time(cls.master, cls.ad)
-
-class TestBasicADTrust(ADTrustBase):
- """Basic Integration test for Active Directory"""
-
def test_establish_trust(self):
"""Tests establishing trust with Active Directory"""
tasks.establish_trust_with_ad(self.master, self.ad,
extra_args=['--range-type', 'ipa-ad-trust'])
+ def test_all_trustdomains_found(self):
+ """
+ Tests that all trustdomains can be found.
+ """
+
+ if self.ad_subdomain is None:
+ raise nose.SkipTest('AD subdomain is not available.')
+
+ result = self.master.run_command(['ipa',
+ 'trustdomain-find',
+ self.ad.domain.name])
+
+ # Check that both trustdomains appear in the result
+ assert self.ad.domain.name in result.stdout_text
+ assert self.ad_subdomain in result.stdout_text
+
+
+class TestBasicADTrust(ADTrustBase):
+ """Basic Integration test for Active Directory"""
+
def test_range_properties_in_nonposix_trust(self):
"""Check the properties of the created range"""
@@ -111,7 +137,7 @@ class TestBasicADTrust(ADTrustBase):
class TestPosixADTrust(ADTrustBase):
"""Integration test for Active Directory with POSIX support"""
- def test_establish_trust_with_posix_attributes(self):
+ def test_establish_trust(self):
# Not specifying the --range-type directly, it should be detected
tasks.establish_trust_with_ad(self.master, self.ad)