diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-02-05 14:56:19 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-02-11 16:37:44 +0100 |
commit | 2e45002a2a320cdc797b5a475e6ef5a60a247bff (patch) | |
tree | 88a6eb2c3469cbe60da18f2fd12b09dcc83697fc /ipatests/test_integration/test_legacy_clients.py | |
parent | ba7d404912409152f1df128d9f9b3e0148e2cc8d (diff) | |
download | freeipa.git-2e45002a2a320cdc797b5a475e6ef5a60a247bff.tar.gz freeipa.git-2e45002a2a320cdc797b5a475e6ef5a60a247bff.tar.xz freeipa.git-2e45002a2a320cdc797b5a475e6ef5a60a247bff.zip |
ipatests: Change expected home directories returned by getent
The hardcoded values for the home directories for the AD users did
not properly scale up from the POSIX attrs only test scanario.
When using POSIX attrs, the home dir is returned as whatever is set
in the AD (/home/username by default). Without using POSIX attributes,
the /home/domain/username form is taken by default.
Refactor the tests to take this behaviour into account.
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Diffstat (limited to 'ipatests/test_integration/test_legacy_clients.py')
-rw-r--r-- | ipatests/test_integration/test_legacy_clients.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ipatests/test_integration/test_legacy_clients.py b/ipatests/test_integration/test_legacy_clients.py index d58cdc3a..ba811c09 100644 --- a/ipatests/test_integration/test_legacy_clients.py +++ b/ipatests/test_integration/test_legacy_clients.py @@ -125,11 +125,15 @@ class BaseTestLegacyClient(object): testuser = 'testuser@%s' % self.ad.domain.name result = self.legacy_client.run_command(['getent', 'passwd', testuser]) - testuser_regex = "testuser@%s:*:%s:%s:"\ - "Test User:/home/testuser:/bin/sh"\ + testuser_regex = "testuser@%s:\*:%s:%s:"\ + "Test User:%s:/bin/sh"\ % (re.escape(self.ad.domain.name), self.testuser_uid_regex, - self.testuser_gid_regex) + self.testuser_gid_regex, + self.homedir_template.format( + username='testuser', + domain=re.escape(self.ad.domain.name)) + ) assert re.search(testuser_regex, result.stdout_text) @@ -236,11 +240,16 @@ class BaseTestLegacyClient(object): testuser = 'subdomaintestuser@%s' % self.ad_subdomain result = self.legacy_client.run_command(['getent', 'passwd', testuser]) - testuser_regex = "subdomaintestuser@%s:*:%s:%s:"\ - "Subdomain Test User:/home/subdomaintestuser:/bin/sh"\ + testuser_regex = "subdomaintestuser@%s:\*:%s:%s:"\ + "Subdomain Test User:%s:"\ + "/bin/sh"\ % (re.escape(self.ad_subdomain), self.subdomain_testuser_uid_regex, - self.subdomain_testuser_gid_regex) + self.subdomain_testuser_gid_regex, + self.homedir_template.format( + username='subdomaintestuser', + domain=re.escape(self.ad_subdomain)) + ) assert re.search(testuser_regex, result.stdout_text) @@ -385,6 +394,7 @@ class BaseTestLegacyClientPosix(BaseTestLegacyClient, testuser_gid_regex = '10047' subdomain_testuser_uid_regex = '10142' subdomain_testuser_gid_regex = '10147' + homedir_template = "/home/{username}" def test_remove_trust_with_posix_attributes(self): pass @@ -397,6 +407,7 @@ class BaseTestLegacyClientNonPosix(BaseTestLegacyClient, testuser_gid_regex = '(?!10047)(\d+)' subdomain_testuser_uid_regex = '(?!10142)(\d+)' subdomain_testuser_gid_regex = '(?!10147)(\d+)' + homedir_template = '/home/{domain}/{username}' def test_remove_nonposix_trust(self): pass |