-
Notifications
You must be signed in to change notification settings - Fork 148
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
Update pam_userdb database backend for RHEL10 #1289
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
Note that first time contributors cannot run tests automatically - they need to be started by a reviewer. It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
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.
Thanks for the contribution. There are a few blockers that need to be addressed. And also the question of in which phase should the prepare_pam_user_db
actor run must be solved
repos/system_upgrade/el9toel10/actors/scanpamuserdb/tests/files/pam_userdb_basic
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/scanpamuserdb/libraries/scanpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/scanpamuserdb/tests/test_scanpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/scanpamuserdb/tests/test_scanpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/checkpamuserdb/libraries/checkpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/actor.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/libraries/preparepamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/libraries/preparepamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/tests/test_preparepamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/actor.py
Outdated
Show resolved
Hide resolved
@matejmatuska the code has been updated taking into account your feedback. Looking forward to your next round of reviews |
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.
Most of the comments were addressed, some are still left e.g. the OSError and some are new.
We will further discuss error handling of the db_converter
call with @ikerexxe, because there might be some details I might have overlooked.
I have yet to test this, I will add a comment when I do
repos/system_upgrade/el9toel10/actors/checkpamuserdb/libraries/checkpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/checkpamuserdb/libraries/checkpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/convertpamuserdb/libraries/convertpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/convertpamuserdb/tests/test_convertpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/convertpamuserdb/tests/test_convertpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/preparepamuserdb/libraries/preparepamuserdb.py
Outdated
Show resolved
Hide resolved
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.
Added a couple more comments.
Also since this has grown to 4 actors, can you move them into a subdirectory in .../el9toel10/actors/? It could be named pamuserdb
or maybe even just pam
.
repos/system_upgrade/el9toel10/actors/removeoldpamuserdb/libraries/removeoldpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/convertpamuserdb/libraries/convertpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/checkpamuserdb/libraries/checkpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/checkpamuserdb/libraries/checkpamuserdb.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/el9toel10/actors/convertpamuserdb/libraries/convertpamuserdb.py
Outdated
Show resolved
Hide resolved
I prefer to use |
/packit test |
/packit build |
@ikerexxe Linters report wrong imports order, can you fix that? We have I am now running packit builds and will run packit test again then (first time they failed because there were no builds) |
Running |
/packit build |
/packit copr-build |
I tested the "success case":
Converted to GDBM:
And the original DB is properly cleaned up:
|
I think the PR is ready for proper review and merging, so I'm moving it. |
/packit copr-build |
Tested the error case with an updated RPM containing the patch in The upgrade is stopped with an error in
|
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.
lgtm
/packit retest-failed |
LGTM, please rebase and squash the commits |
pam_userdb module changed its backend database technology from lidb to gdbm for RHEL10. This requires a set of leapp actors to perform the database migration automatically when upgrading to RHEL10: * ScanPamUserDB takes care of scanning the PAM service folder to detect whether pam_userdb is used and the location of the database in use. This information is stored in a model. * CheckPamUserDB checks the databases reported by ScanPamUserDB and prints a report about them. * ConvertPamUserDB checks the databases reported by ScanPamUserDB and converts them to GDBM format. * RemoveOldPamUserDB checks the databases reported by ScanPamUserDB and removes them. All these actors include unit-tests. Finally, there's also a spec file change to add `libdb-utils` dependency as it is required to convert pam_userdb databases from BerkeleyDB to GDBM. Signed-off-by: Iker Pedrosa <[email protected]>
Done! |
Merged, thanks again for the contribution! |
pam_userdb module changed its backend database technology from libdb to
gdbm for RHEL10. This requires a set of leapp actors to perform the
database migration automatically when upgrading to RHEL10.
Three actors were created: PAM service folder scan to detect the location of the
database, database location reporting and conversion to the new format.
The changes include unit and component tests to.
Jira: SSSD-7379