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

Run 'id' test against SSSD running under "sssd" user #7052

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tests/system/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ git+https://github.com/next-actions/pytest-mh
git+https://github.com/next-actions/pytest-ticket
git+https://github.com/next-actions/pytest-tier
git+https://github.com/next-actions/pytest-output
git+https://github.com/SSSD/sssd-test-framework
git+https://github.com/alexey-tikhonov/sssd-test-framework@detect-sssd-user
9 changes: 8 additions & 1 deletion src/tests/system/tests/test_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@

@pytest.mark.importance("critical")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_id__getpwnam(client: Client, provider: GenericProvider):
@pytest.mark.parametrize("sssd_service_user", ("root", "sssd"))
@pytest.mark.require(
lambda client, sssd_service_user: ((sssd_service_user == "root") or client.features["non-privileged"]),
"SSSD was built without support of running under non-root"
)
def test_id__getpwnam(client: Client, provider: GenericProvider, sssd_service_user: str):
"""
:title: Resolve user by name with id
:setup:
Expand All @@ -31,6 +36,8 @@ def test_id__getpwnam(client: Client, provider: GenericProvider):
3. Users have correct ids
:customerscenario: False
"""
client.sssd.set_service_user(sssd_service_user)

ids = [("user1", 10001), ("user2", 10002), ("user3", 10003)]
for user, id in ids:
provider.user(user).add(uid=id, gid=id + 500)
Expand Down