-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: authentication, adding override_homedir tests
* moving ad specific test out of authentication and to it's own file
- Loading branch information
Dan Lavu
committed
Sep 30, 2024
1 parent
67ba42c
commit d9e4692
Showing
2 changed files
with
113 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
SSSD Active Directory (AD) Test Cases | ||
:requirement: ad | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import pytest | ||
from sssd_test_framework.roles.ad import AD | ||
from sssd_test_framework.roles.client import Client | ||
from sssd_test_framework.topology import KnownTopology | ||
|
||
|
||
@pytest.mark.topology(KnownTopology.AD) | ||
@pytest.mark.ticket(gh=7174) | ||
@pytest.mark.parametrize("method", ["su", "ssh"]) | ||
@pytest.mark.parametrize("sssd_service_user", ("root", "sssd")) | ||
@pytest.mark.importance("critical") | ||
@pytest.mark.require( | ||
lambda client, sssd_service_user: ((sssd_service_user == "root") or client.features["non-privileged"]), | ||
"SSSD was built without support for running under non-root", | ||
) | ||
def test_authentication__using_the_users_email_address(client: Client, ad: AD, method: str, sssd_service_user: str): | ||
""" | ||
:title: Login using the user's email address | ||
:description: | ||
Testing the feature to login using an email address instead of the userid. The username used, | ||
must match one of the user's LDAP attribute values, "EmailAddress". The login should be | ||
case-insensitive and permit special characters. | ||
:setup: | ||
1. Add AD users with different email addresses | ||
2. Start SSSD | ||
:steps: | ||
1. Authenticate users using their email address and in different cases | ||
:expectedresults: | ||
1. Authentication is successful using the email address and is case-insensitive | ||
:customerscenario: False | ||
""" | ||
ad.user("user-1").add(password="Secret123", email=f"user-1@{ad.host.domain}") | ||
ad.user("user-2").add(password="Secret123", email="user-2@alias-domain.com") | ||
ad.user("user_3").add(password="Secret123", email="user_3@alias-domain.com") | ||
|
||
client.sssd.start(service_user=sssd_service_user) | ||
|
||
assert client.auth.parametrize(method).password( | ||
f"user-1@{ad.host.domain}", "Secret123" | ||
), f"User user-1@{ad.host.domain} failed login!" | ||
assert client.auth.parametrize(method).password( | ||
"user-2@alias-domain.com", "Secret123" | ||
), "User user-2@alias-domain.com failed login!" | ||
assert client.auth.parametrize(method).password( | ||
"uSEr_3@alias-dOMain.com", "Secret123" | ||
), "User uSEr_3@alias-dOMain.com failed login!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters