From f9ebd47f9367e1c66337deec4fa258fa8d2e3e12 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Wed, 26 Mar 2014 12:34:55 +0100 Subject: ipatests: Do not depend on the case of the attributes when testing ID ranges In test_trust.py, several tests did case sensitive search on the output of the ipa idrange-show command. This could cause false negatives. Part of: https://fedorahosted.org/freeipa/ticket/4267 Reviewed-By: Martin Kosek --- ipatests/test_integration/test_trust.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ipatests/test_integration') diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py index 4afc13440..95e48dd9c 100644 --- a/ipatests/test_integration/test_trust.py +++ b/ipatests/test_integration/test_trust.py @@ -80,8 +80,12 @@ class TestBasicADTrust(ADTrustBase): range_name = self.ad.domain.name.upper() + '_id_range' result = self.master.run_command(['ipa', 'idrange-show', range_name, '--all', '--raw']) - assert " ipaRangeType: ipa-ad-trust" in result.stdout_text - assert " ipaIDRangeSize: 200000" in result.stdout_text + + iparangetype_regex = r'ipaRangeType: ipa-ad-trust' + iparangesize_regex = r'ipaIDRangeSize: 200000' + + assert re.search(iparangetype_regex, result.stdout_text, re.IGNORECASE) + assert re.search(iparangesize_regex, result.stdout_text, re.IGNORECASE) def test_user_gid_uid_resolution_in_nonposix_trust(self): """Check that user has SID-generated UID""" @@ -120,8 +124,11 @@ class TestPosixADTrust(ADTrustBase): '--all', '--raw']) # Check the range type and size - assert " ipaRangeType: ipa-ad-trust-posix" in result.stdout_text - assert " ipaIDRangeSize: 200000" in result.stdout_text + iparangetype_regex = r'ipaRangeType: ipa-ad-trust-posix' + iparangesize_regex = r'ipaIDRangeSize: 200000' + + assert re.search(iparangetype_regex, result.stdout_text, re.IGNORECASE) + assert re.search(iparangesize_regex, result.stdout_text, re.IGNORECASE) def test_user_uid_gid_resolution_in_posix_trust(self): # Check that user has AD-defined UID -- cgit