-
Notifications
You must be signed in to change notification settings - Fork 247
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
Tests: Test transformation of bash-ldap-id-ldap-auth netgroup #7648
base: master
Are you sure you want to change the base?
Conversation
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.
Why are you using a specially created function to run libc's group membership, when the framework already provides an automation to check this?
As an example test_netgroups__add_remove_netgroup_member
uses client.tools.getent.netgroup("ng-2")
to check the membership.
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.
Please reference current code for examples to better conform to the new coding standards. Let's pause any other PRs until this one meets the new guidelines.
f0c4c4e
to
50ad1c3
Compare
40b026b
to
a19c0cb
Compare
This is much better, but you resolved an issue that still needs to be resolved. These tests are specific to LDAP should go in test_ldap.py. Is there a reason why we cannot use the generic provider? We want to start using this for more coverage and reduce the amount of test cases. Not related to this PR, here is an example of using one test to cover the same scenario for AD/IPA/LDAP/Samba, 12 lines of code instead of copying the test case. https://github.com/SSSD/sssd/blob/master/src/tests/system/tests/test_failover.py I'll take a closer look later, all the checks need to be green before we merge, please resolve the ci failures, like the 'static code analysis' and the ci system tests. |
These are ldap specific tests. I have tries running them against GenericProvider but its failed . So moving them to _test_ldap.py |
78ca7f8
to
fe91a15
Compare
This function is helping me not repeat same line in different tests .
As i said before this is LDAP compatible script . (Pdb) ou = provider.ou("Netgroup")
Defiantly i will try to improve the doc part of the script . |
That function is creating a set of users and groups that you aren't using anywhere. That's my main concern.
The
Perfect! |
Its not about network groups its about ou. This script is for ldap provider not generic.
|
dd3ad88
to
c75b4d5
Compare
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.
I've consulted Sumit and although the netgroup functionality is provided, IPA's exposed interface is not the same as in LDAP or AD's environment. So I have an important question before I continue reviewing the code. Ultimately what do we want to test? Do we want to test that the high-level functionality works, or that the functionality of each provider works? According to the response, we can decide what to do with this PR.
The high-level functionality works |
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.
Some minor comments added. I think there is not much time left to approve it.
client.sssd.restart() | ||
|
||
member = client.tools.getent.netgroup("nested_netgroup").members | ||
assert "(testhost1,ng1,ldap.test)" in member | ||
assert "(-,ng3,)" in member | ||
assert "(testhost5,ng2,ldap.test)" in member |
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.
Why is this needed? Are you expecting some change may happen?
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.
No, this is assertion to make sure everything works
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.
What do you mean by everything? What is the exact use case you are trying to test?
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.
After sssd restart i want to make sure that Nesting netgroups works and i can remove that part if it does not make sense .
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.
IMO it doesn't. @danlavu what do you think? Does it make sense to check again the nesting groups after restarting sssd?
Test transformation of bash-ldap-id-ldap-auth netgroup
Test transformation of bash-ldap-id-ldap-auth netgroup