-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nss_checker: Make user/group names platform-dependent #248
Conversation
have to fix |
39b1cea
to
faf9758
Compare
tests/test_ipa_nss.py
Outdated
def test_ipaapi_group_ok(self, mock_grp): | ||
mock_grp.return_value = make_group('apache', ('apache', 'ipaapi',)) | ||
|
||
def test_ipaapi_group_ok(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the test system is configured properly doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests require freeipa-server
RPM package which pulls apache
as well, both have RPM post-scripts creating system users for them. Thus, IPA (including underlying components) has all the needed system users upon installation, the configuration is not required. So, actually mocking is required only for negative test cases. But adding a mocking for the existing group is not a big deal.
Just the one question, otherwise this looks great. |
faf9758
to
257d070
Compare
- make use of ipaplatform for user/group names to avoid hardcoded values - correct mocking in tests There were several issues with these tests: - mocking of builtins on global level is discouraged, mock on target module level instead - wrong mocked group, `IPAGroupMemberCheck` checks if apache user has supplementary group `ipaapi`, while test mocked `apache` group - wrong mocked `struct_group`, it should include user names having given supplementary group, not a primary one: ipaapi: (ipaapi, apache) => ipaapi: (apache,) Fixes: freeipa#247 Signed-off-by: Stanislav Levin <slev@altlinux.org>
- make use of ipaplatform for user/group names to avoid hardcoded values Fixes: freeipa#247 Signed-off-by: Stanislav Levin <slev@altlinux.org>
257d070
to
01a3852
Compare
added platform dependent changes for |
PR looks good, thanks. ack. |
User/group names were hardcoded, this broke ipaplatforms having
different names.
Fixes: #247
Signed-off-by: Stanislav Levin slev@altlinux.org