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
Do not build the local provider by default #611
Conversation
Good idea. How did you configure the files provider? You can you |
Thanks, this is a good start. We also want to remove the whole pysss.local interface and don't build the If you want to remove the usage of the local provider from tests, does it make sense to keep the code at all using the is_local_provider functions? Remember the code is not lost forever, we can always ressurect it from git history. |
btw I'm not sold either way myself, on one hand the local provider might be handy for tests, on the other hand I haven't used it in a long time myself. So I would not be completely mad if it goes away. |
src/tests/cmocka/test_sysdb_views.c
Outdated
gid = 0; | ||
} else { | ||
uid = 1234 + i; | ||
gid = 1234 + i; |
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 would even say we can drop the conditional and just use the else branch.
src/tests/sysdb-tests.c
Outdated
gid = 0; | ||
} else { | ||
uid = 1234; | ||
gid = 1234; |
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 would even drop the if branch and only use the else branch.
src/tests/sysdb-tests.c
Outdated
@@ -1095,6 +1105,9 @@ START_TEST(test_user_group_by_name) | |||
* ldap provider differently with auto_private_groups. | |||
*/ | |||
test_ctx->domain->provider = discard_const_p(char, "ldap"); | |||
if (!local_provider_is_built()) { |
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.
On the other hand, this test might be handy. Since some functions differ in functionality with mpg enabled domain, I think we want to have a test. But I think just adding a unit test with mpg=true is simpler and more error proof than having an if-else branch based on how sssd is built.
@@ -1827,6 +1844,7 @@ START_TEST (test_sysdb_remove_nonexistent_group) | |||
} | |||
END_TEST | |||
|
|||
#ifdef BUILD_LOCAL_PROVIDER |
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.
OTOH, I think this ifdef is fine because the get_new_id function is only useful for the local provider.
About the sysdb tests, can you paste what issues you faced here? Or push a branch? I could see issues with not matching number of groups returned because the local provider is mpg-enabled by default, but I don't know what the issue with users could be. |
Definitely drop all the code related to local provider. It makes the code complicated since it is a special case. It is also very easy to forget it. If it will be needed again, we can implement a simple backend for local provider just returning EOK from the dbus handlers. But I have literally never used it for testing ever. In addition, it does not really tests anything today since it never goes to backend and requires special casing in responders. |
9d97810
to
e70a864
Compare
It's been discussed on IRC a few times already and let me try to make it explicit here. The help needed here and asked on IRC a few times before is in order to figure out the changes that have to be done. |
e70a864
to
2b0053d
Compare
I've updated the patches, @pbrezina helped me with the most part of the issues I was facing. There are still an issue in the ldap_id_cleanup() test as the test fails when ran by the first time but passes if ran again after a minute or two. Summing up, there's still work to be done in this PR, thus i"m adding the "Changes requested" label. |
2b0053d
to
19a7b09
Compare
Do you need help with triaging the failure? |
19a7b09
to
618a2bf
Compare
@jhrozek, that would be really appreciated. What I've found so far is that when not building the local provider the ldap_id_cleanup test is bailing out because when trying to cleanup the groups the search done doesn't return any records from the cache. I've checked that those records are present in the timestamp cache and if searched there we'd bea ble to move forward. However, the search is done in the cache itself. So, what I'm trying to understand here is why the cache has not been updated (following the timestamp cache) when not using the local provider. |
618a2bf
to
cd00107
Compare
So, thanks to both @jhrozek and @pbrezina the tests are now passing! I've decided to re-order/re-organize the patches and all comments made should be addressed. The series now contain:
|
I wish we had more time to nuke the code completely, but not building it by default is a good start. We can remove the stuff completely in 2.1 |
I'll ack once coverity finishes |
Coverity and CI were OK |
Also start to consider the "files" provider when cleaning up the files. This change will let us start to moving to "files" provider in our test suite. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Apart from the obvious change from "local" to "files" and from "LOCAL" to "FILES", we're also passing an on-the-fly created uid/gid to the sysdb_store_user() function in order to avoid calling sysdb_get_new_id(), which only should be used with the "local" provider. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Apart from the obvious change from "local" to "files" and from "LOCAL" to "FILES", we're also passing a static uid/gid to the sysdb_add_user() function in order to avoid calling sysdb_get_new_id(), which only should be used with the "local" provider. Another change doneis to explicitly set mpg to true as it was enabled by default when using the "local" provider. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Apart from the obvious change from "local" to "files" and from "LOCAL" to "FILES", we also had to change the cleanup function as this test suite doesn't rely on test_multidom_suite_cleanup(). Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Apart from the obvious change from "local" to "files" and from "LOCAL" to "FILES", we also had to change the cleanup function as this test suite doesn't rely on test_multidom_suite_cleanup(). Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Only a simple change from "local" to "files" was required. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
When trying to get rid of the "local" provider references in ldap_id_cleanup tests by switching to "files" provider, it's been noticed that the linearized dn wasn't coming sanitized, which would make the test to fail. While I'm not sure here's the right place to have it fixed, this is the simplest proposal I could come up with. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
The reason for specifically passing a ts_subfilter is because when using a provider that relies on a cache and on a timestamp cache, the search done each cache is different. The difference in the search is that on timestamp cache we add a (dateExpireTimestamp <= XXX), but it shouldn't be added to the cache search. This commit is needed in order to have the ldap_id_cleanup test running when switching from local provider (which has no timestamp cache) to the files provider (which exposed this issue). Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. The only changes requred were the obvious change from "local" to "files" and from "LOCAL" to "FILES". Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Let's just replace "LOCAL_SYSDB_FILE" for NULL as This test suite doesn't create local sysdb file. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
…ution_order_ Let's take advantage of the files provider and start to get rid of the local provider references in our code. Let's just replace "LOCAL_SYSDB_FILE" for NULL as This test suite doesn't create local sysdb file. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's take advantage of the files provider and start to get rid of the local provider references in our code. Let's just replace "LOCAL_SYSDB_FILE" for NULL as This test suite doesn't create local sysdb file. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
As all tests are now taking advantage of the "files" provider instead of the "local" one, let's just remove the last reference of LOCAL_SYSDB_FILE from our tests. Together with the reference, let's also remove the whole if-block as we're not relying on "local" provider anymore. Related: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Let's "get rid" of the local provider and only build it conditionally. The local provider is only used by our integration tests and those will be ran in the CI enabling the local provider. If someone, for some reason, still needs to use it, "--enable-local-provider" has been added as a configure option and the provider can be built using that (as done in our integration tests). Resolves: https://pagure.io/SSSD/sssd/issue/3304 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
"local" -> "password" Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
The pysss.local interface has been de-emphasized in favour of the files domain. As there's no current consumer of this API, let's just remove it. Resolves: https://pagure.io/SSSD/sssd/issue/3493 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
cd00107
to
e224db7
Compare
retest this please |
1 similar comment
retest this please |
Folks,
This series is the first attempt to avoid building the local provider by default. With we only build it conditionally and the default is set to not build it. The problems:
My personal preference would be to start using the files provider in our tests instead of using the "local" one. However, I've faced some issues related to the amount of users being find in some sysdb tests (ping me, we can discuss this either here or in the #sssd channel) (maybe because it also finds the local users/groups created on my machine?).
Again, this is a first attempt, let's discuss improvements needed :-)