Skip to content
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

test: authentication, adding generic password policy tests #7728

Closed

Conversation

danlavu
Copy link

@danlavu danlavu commented Nov 30, 2024

Copy link
Contributor

@spoore1 spoore1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of places missing ()'s I think.

@spoore1 spoore1 self-assigned this Feb 5, 2025
@danlavu danlavu force-pushed the tests-authentication-password-changes branch from aea7f4e to 1242992 Compare February 5, 2025 22:49
@danlavu danlavu force-pushed the tests-authentication-password-changes branch from 1242992 to 20248d2 Compare March 15, 2025 20:08
@danlavu danlavu marked this pull request as ready for review March 15, 2025 20:12
@danlavu
Copy link
Author

danlavu commented Mar 15, 2025

ests/test_ldap.py::test_ldap__ppolicy_change_password_with_complexity_requirement[exop] (ldap) 
tests/test_ldap.py::test_ldap__ppolicy_change_password_with_complexity_requirement[ldap_modify] (ldap) 
tests/test_ldap.py::test_ldap__ppolicy_change_password_with_complexity_requirement[exop_force] (ldap) 
tests/test_ldap.py::test_ldap__authenticate_user_with_whitespace_prefix_in_userid (ldap) 
tests/test_ldap.py::test_ldap__shadow_policy_change_password[su] (ldap) 
tests/test_ldap.py::test_ldap__shadow_policy_change_password[ssh] (ldap) 
tests/test_ldap.py::test_ldap__search_base_is_discovered_and_defaults_to_root_dse (ldap) 
tests/test_ldap.py::test_ldap__search_base_is_discovered_and_defaults_to_root_dse_users_groups_and_netgroups[ldap_user_search_base-ou=People,dc=ldap,dc=test] (ldap) 
tests/test_ldap.py::test_ldap__search_base_is_discovered_and_defaults_to_root_dse_users_groups_and_netgroups[ldap_group_search_base-ou=Groups,dc=ldap,dc=test] (ldap) 
tests/test_ldap.py::test_ldap__search_base_is_discovered_and_defaults_to_root_dse_users_groups_and_netgroups[ldap_netgroup_search_base-ou=Netgroup,dc=ldap,dc=test] (ldap) 
tests/test_ldap.py::test_ldap__lookup_user_with_search_bases (ldap) 
tests/test_ldap.py::test_ldap__lookup_and_authenticate_as_user_with_different_object_search_bases[dc=ldap,dc=test] (ldap) 
tests/test_ldap.py::test_ldap__lookup_and_authenticate_as_user_with_different_object_search_bases[dc=shanks,dc=com] (ldap) 
tests/test_ldap.py::test_ldap__password_change_no_grace_logins_left[exop-1-Expected login failure] (ldap) 
tests/test_ldap.py::test_ldap__password_change_no_grace_logins_left[exop_force-3-Expected password change request] (ldap) 
tests/test_ldap.py::test_ldap__empty_attribute (ldap) 
tests/test_ldap.py::test_ldap__limit_search_base_group (ldap) 


================ 17 passed, 670 deselected in 164.95s (0:02:44) ================
PASSED [  5%]PASSED [ 11%]PASSED [ 17%]PASSED [ 23%]PASSED [ 29%]PASSED [ 35%]PASSED [ 41%]PASSED [ 47%]PASSED [ 52%]PASSED [ 58%]PASSED [ 64%]PASSED [ 70%]PASSED [ 76%]PASSED [ 82%]PASSED [ 88%]PASSED             [ 94%]PASSED     [100%]
Process finished with exit code 0

Will post the test_authentication runs when they are done, but all the test are passing with SSSD/sssd-test-framework#139

@danlavu danlavu marked this pull request as draft March 15, 2025 20:14
@danlavu danlavu marked this pull request as ready for review March 17, 2025 22:42
@danlavu danlavu force-pushed the tests-authentication-password-changes branch 2 times, most recently from bf3564c to a1a7718 Compare March 17, 2025 22:52
@danlavu danlavu requested a review from aplopez March 17, 2025 22:53
@danlavu
Copy link
Author

danlavu commented Mar 17, 2025

This is ready for review.

@danlavu danlavu requested a review from spoore1 March 17, 2025 22:53
@danlavu danlavu force-pushed the tests-authentication-password-changes branch from a1a7718 to 28554ea Compare March 18, 2025 17:05
Copy link
Contributor

@spoore1 spoore1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly comment/wording changes suggested with a few questions mixed in. Looks like a good set of tests for password policy.

@danlavu danlavu force-pushed the tests-authentication-password-changes branch 4 times, most recently from 1da3edb to 922826c Compare March 19, 2025 18:32
@alexey-tikhonov alexey-tikhonov requested a review from spoore1 April 7, 2025 13:14
@danlavu danlavu force-pushed the tests-authentication-password-changes branch 6 times, most recently from 39c5577 to adb13f2 Compare April 7, 2025 23:31
Dan Lavu added 2 commits April 8, 2025 09:55
* user is forced to changed password at login
* user logins and issues a password change
* few scenarios have been removed
* ppolicy tests have been made into ppolicy tests only, since normal ldap is covered by the generic provider now
* renamed some of the test cases
* removed su from a password change test
* removed some test cases that are now covered by the new test cases
@danlavu
Copy link
Author

danlavu commented Apr 8, 2025

I cancelled the CI run since they are going to fail. Here is the link to a successful run, the failure in Fedora 42 is not related.

https://github.com/SSSD/sssd/actions/runs/14335416822

Copy link
Contributor

@spoore1 spoore1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly questions about docstring setup/steps wording.

:customerscenario: True
"""
old_password = "Secret123"
invalid_password = "secret"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the variables match wording used in the docstrings (i.e. bad_password instead of invalid_password)?

3. Start SSSD
:steps:
1. Login as user
2. Issue password change as user with password that does not meet complexity requirements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought but if we're trying to simplify wording in docstrings, could we drop "as user with password" from this and the next step and have it still explain well enough what is happening?

LDAP modify.
The 'test_authentication__change_password' test is a generic provider test that already
covers LDAP. This test is an edited copy that only tests LDAP with the ppolicy overlay.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "covers" indented an extra space?

2. Configure the LDAP ACI to permit user password changes
3. Set "ldap_pwmodify_mode"
4. Start SSSD
1. Create user 'user'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were we going to suggest dropping specifics like 'user' from the docstring setup and steps?

2. Configure the LDAP ACI to permit user password changes
3. Set "ldap_pwmodify_mode"
4. Start SSSD
1. Create user 'user'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to state 'user' here or would removing that be in line with some of the simplification of steps/setup we've talked about?

4. Start SSSD
:steps:
1. Attempt to change the password but enter the incorrect password
1. Login as user
2. Issue password change as user with password that does not meet complexity requirements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above about shortening steps by removing "as user with password".

Copy link
Contributor

@spoore1 spoore1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussing with @danlavu , I'm approving this now since all of my latest questions/comments are related to docstring wording in some way. This can be addressed in a later effort.

@alexey-tikhonov
Copy link
Member

F42 still fails test_ipa__hostpublickeys_by_ip (ipa) but this is probably another issue.

@alexey-tikhonov alexey-tikhonov added Ready to push Ready to push and removed Ready to push Ready to push branch: sssd-2-9 branch: sssd-2-9-4 Corresponds to C8S labels Apr 9, 2025
@alexey-tikhonov
Copy link
Member

Pushed PR: #7728

  • master
    • f8f7f84 - tests: removed overlapping test scenarios from authentication tests
    • 08a3c41 - tests: adding generic password change tests
  • sssd-2-10
    • f1a8634 - tests: removed overlapping test scenarios from authentication tests
    • d678e67 - tests: adding generic password change tests

@alexey-tikhonov
Copy link
Member

Conflict in sssd-2-9
Conflict in sssd-2-9-4

@danlavu, please open explicit backport requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants