WiP: extend support for UUID user ID as home dir#561
Conversation
…tantly expected e.g. during useradm operations like edit_user, delete_user, etc. and therefore difficult to do without when adding test coverage a.o. in #561. Introduce two more common DNs used across tests: Other User and No Such User. Polish a long comment with some typos and incomplete ending.
|
Hmmm, odd that one unit test consistently fails here while consistently succeeding when I run |
…ion user helper (#563) * Add a few more user state dirs made by actual user creation and importantly expected e.g. during useradm operations like edit_user, delete_user, etc. and therefore difficult to do without when adding test coverage a.o. in #561. Introduce two more common DNs used across tests: Other User and No Such User. Polish a long comment with some typos and incomplete ending. * Add a couple of good points from review feedback (thanks @albu-diku) as comments to get the PR wrapped up. Minor format-only changes from automatic long-line wrap in editor.
276d742 to
bcb2dae
Compare
Think I pinpointed the mentioned test failure to come from a different (by definition non-deterministic) order of entries in |
8e3cf0c to
9ce937a
Compare
c35ffa4 to
388cc27
Compare
… test using email alias.
…s a start. Bail out in create_user if UUID format is chosen and user doesn't have the corresponding unique_id field.
…th X509 and UUID format. Reuse constants a bit more.
…plicity. Add unit tests for edit_user both in the default and UUID format setup to cover more of the ground needed for supporting the latter.
…d` to be specific to the UUID user ID format and elaborate what it does in the function docstring.
update_account_expire_cache and reset_account_expire_cache. Simiplifi existing tests to rely more on before_each helper and constants. Fix a bug in reset_account_expire_cache for specific client_id which wasn't correctly translated from client_id to a client_dir style filemark.
update_account_status_cache .
…pire and adjust test without start_time to be more robust against rounding issues.
…stants to other existing tests for consistency.
…ectly look up user X509 ID before checking account access. The default X509 user format should remain functionally unchanged despite minor adjustments. Extra care is needed while following the relative alias links from email, short ID and X509 DN to the final UUID user home. Additionally we must be cautious about the link traversal loop always terminating to avoid unpleasant surprises.
…D user ID format cases. Also tests the recently adjusted check_account_accessible helper thoroughly.
…nwhile updated to handle it gracefully.
b77279c to
9c86f29
Compare
…580) * Implement fundamental unit test coverage of the `accountstate` module. Fixes a corner-case bug in `reset_account_expire_cache` when called with a specific `client_id` rather than the default (None) to reset all expire marks. NOTE: that form is not used anywhere else at the moment so it should be safe. * Add tests for check_account_status . * Add tests for check_account_accessible. * Add tests for check_update_account_expire and sync back some constants to other existing tests for consistency. * Try to address review feedback by making the entangled asserts fail independently even if the assertRaises does not kick in. The tested code is a bit clunky to quietly patch incorrect use but this version should make the test more consistent. Fixed a couple of similar issues with other tests using a `with X` construct and not keeping variables aligned. Simplified a few `self.configuration` uses where we already have aliased it as `configuration`. * Rework invalid expire test again into one for invalid types and one for invalid values to avoid inconsistent handling and address further feedback. The underlying function could really use more robust handling of such invalid values but for now we just want to make sure that the tests closely cover the existing behaviour in order to let the UUID version aim for complete (bug-for-bug) compatibility as a start. * Sync back some cosmetic changes from #561 branch and one additional test using email alias. * Reformat with make format-python.
… X509 and a comment in conf that UUID format is still only experimental.
…d break if both the UUID -> X509 link and say a leftover matching reverse X509 to UUID link exist in the `user_id_alias_dir`. Includes a regression test initially used to confirm its existence and assure that it is now really fixed.
Extend the existing skeleton to support using UUID as the name of the user home dir with just symlinks to the X509 form in order to ease updating any of the X509 fields without renaming entire user home.
First step is to add/extend unit test coverage of the relevant helpers to narrow down what works already and what is still missing. Therefore builds on top of #575, #576 and #580 , which were merged in the meantime. Further tests on top of stand-alone test suite extension PRs may follow.
We already identified and fixed some UUID issues based on those added unit tests so there should already be some progress.
Additional work is required if we also want e.g. the participation in VGrids to be independent of such X509 field updates.