From 26ebaad42351dfee68678dec83d0c422f3cc9d42 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 22 Nov 2023 16:45:44 +0100 Subject: [PATCH] Run 'id' tests against SSSD running under both "root" and "sssd" (if supported) --- src/tests/system/requirements.txt | 2 +- src/tests/system/tests/test_id.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/system/requirements.txt b/src/tests/system/requirements.txt index 5210bc23cb1..0849c4b6576 100644 --- a/src/tests/system/requirements.txt +++ b/src/tests/system/requirements.txt @@ -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 diff --git a/src/tests/system/tests/test_id.py b/src/tests/system/tests/test_id.py index 8ee34b6f729..1f105511a67 100644 --- a/src/tests/system/tests/test_id.py +++ b/src/tests/system/tests/test_id.py @@ -14,7 +14,8 @@ @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")) +def test_id__getpwnam(client: Client, provider: GenericProvider, sssd_service_user): """ :title: Resolve user by name with id :setup: @@ -31,6 +32,9 @@ def test_id__getpwnam(client: Client, provider: GenericProvider): 3. Users have correct ids :customerscenario: False """ + if not client.set_sssd_user(sssd_service_user): + pytest.skip("SSSD was built without support of running under non-root") + ids = [("user1", 10001), ("user2", 10002), ("user3", 10003)] for user, id in ids: provider.user(user).add(uid=id, gid=id + 500)