From 8fd4c874cac784948a81891d30d935e2fff2f023 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Mon, 12 Feb 2024 19:43:25 +0100 Subject: [PATCH] TESTS: system: skip 'passkey' tests if SSSD runs under non-root For a real device this is handled by udev rule that makes device readable by SSSD. This rule doesn't work with mocked device. --- src/tests/system/tests/test_passkey.py | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/tests/system/tests/test_passkey.py b/src/tests/system/tests/test_passkey.py index 3ce26a68a38..a64819b696e 100644 --- a/src/tests/system/tests/test_passkey.py +++ b/src/tests/system/tests/test_passkey.py @@ -82,6 +82,10 @@ def test_passkey__register__ipa(ipa: IPA, moduledatadir: str, testdatadir: str): @pytest.mark.importance("critical") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su(client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str): """ :title: Check su authentication of user with LDAP, IPA, AD and Samba @@ -116,6 +120,10 @@ def test_passkey__su(client: Client, provider: GenericProvider, moduledatadir: s @pytest.mark.importance("high") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su_fail_pin(client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str): """ :title: Check su authentication deny of user with LDAP, IPA, AD and Samba with incorrect pin @@ -150,6 +158,10 @@ def test_passkey__su_fail_pin(client: Client, provider: GenericProvider, moduled @pytest.mark.importance("critical") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su_fail_mapping(client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str): """ :title: Check su authentication deny of user with LDAP, IPA, AD and Samba with incorrect mapping @@ -186,6 +198,10 @@ def test_passkey__su_fail_mapping(client: Client, provider: GenericProvider, mod @pytest.mark.importance("high") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su_srv_not_resolvable( client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str ): @@ -246,6 +262,10 @@ def test_passkey__su_srv_not_resolvable( @pytest.mark.importance("high") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__offline_su(client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str): """ :title: Check offline su authentication of a user with LDAP, IPA, AD and Samba @@ -339,6 +359,10 @@ def test_passkey__user_fetch_from_cache( @pytest.mark.importance("high") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su_multi_keys_for_same_user( client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str ): @@ -378,6 +402,10 @@ def test_passkey__su_multi_keys_for_same_user( @pytest.mark.importance("high") @pytest.mark.topology(KnownTopologyGroup.AnyProvider) @pytest.mark.builtwith(client="passkey", provider="passkey") +@pytest.mark.require( + lambda client: (client.svc.get_property("sssd", "User") == "root"), + "Currently passkey tests don't work if SSSD runs under non-root", +) def test_passkey__su_same_key_for_multi_user( client: Client, provider: GenericProvider, moduledatadir: str, testdatadir: str ):