diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-02-06 16:08:04 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-02-11 16:37:44 +0100 |
commit | 11505d9bce3a375af7f22686ef2a9e3a3a70e397 (patch) | |
tree | 7ba0d82de5fe25cc27502b4bf571405d18e4fc68 | |
parent | 2e45002a2a320cdc797b5a475e6ef5a60a247bff (diff) | |
download | freeipa.git-11505d9bce3a375af7f22686ef2a9e3a3a70e397.tar.gz freeipa.git-11505d9bce3a375af7f22686ef2a9e3a3a70e397.tar.xz freeipa.git-11505d9bce3a375af7f22686ef2a9e3a3a70e397.zip |
ipatests: Do not require group name resolution for the non-posix tests
In the non-posix tests on the legacy clients, the testuser does not
belong to the testgroup (since this is represented by the NIS
group membership).
Relax the regular expression check for the output of the id testuser.
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
-rw-r--r-- | ipatests/test_integration/test_legacy_clients.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ipatests/test_integration/test_legacy_clients.py b/ipatests/test_integration/test_legacy_clients.py index ba811c09..d70dd101 100644 --- a/ipatests/test_integration/test_legacy_clients.py +++ b/ipatests/test_integration/test_legacy_clients.py @@ -51,6 +51,9 @@ class BaseTestLegacyClient(object): subdomain_testuser_uid_regex = None subdomain_testuser_gid_regex = None + # To allow custom validation dependent on the trust type + posix_trust = False + @classmethod def setup_class(cls): super(BaseTestLegacyClient, cls).setup_class() @@ -152,9 +155,13 @@ class BaseTestLegacyClient(object): result = self.legacy_client.run_command(['id', testuser]) + # Only for POSIX trust testing does the testuser belong to the + # testgroup + group_name = '\(%s\)' % testgroup if self.posix_trust else '' + uid_regex = "uid=%s\(%s\)" % (self.testuser_uid_regex, testuser) - gid_regex = "gid=%s\(%s\)" % (self.testuser_gid_regex, testgroup) - groups_regex = "groups=%s\(%s\)" % (self.testuser_gid_regex, testgroup) + gid_regex = "gid=%s%s" % (self.testuser_gid_regex, group_name) + groups_regex = "groups=%s%s" % (self.testuser_gid_regex, group_name) assert re.search(uid_regex, result.stdout_text) assert re.search(gid_regex, result.stdout_text) @@ -274,9 +281,13 @@ class BaseTestLegacyClient(object): result = self.legacy_client.run_command(['id', testuser]) + # Only for POSIX trust testing does the testuser belong to the + # testgroup + group_name = '\(%s\)' % testgroup if self.posix_trust else '' + uid_regex = "uid=%s\(%s\)" % (self.testuser_uid_regex, testuser) - gid_regex = "gid=%s\(%s\)" % (self.testuser_gid_regex, testgroup) - groups_regex = "groups=%s\(%s\)" % (self.testuser_gid_regex, testgroup) + gid_regex = "gid=%s%s" % (self.testuser_gid_regex, group_name) + groups_regex = "groups=%s%s" % (self.testuser_gid_regex, group_name) assert re.search(uid_regex, result.stdout_text) assert re.search(gid_regex, result.stdout_text) @@ -395,6 +406,7 @@ class BaseTestLegacyClientPosix(BaseTestLegacyClient, subdomain_testuser_uid_regex = '10142' subdomain_testuser_gid_regex = '10147' homedir_template = "/home/{username}" + posix_trust = True def test_remove_trust_with_posix_attributes(self): pass |