From 5a1e1526e04d9837dbe4adfffd6b5ff438d3e653 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 25 Mar 2024 10:39:23 +0100 Subject: [PATCH] test: set 'local_auth_policy = only' for all passkey test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro López Reviewed-by: Iker Pedrosa Reviewed-by: Justin Stephenson Reviewed-by: Scott Poore (cherry picked from commit 79c384fb0c41a205b8119f86ef23860c223c853e) --- src/tests/system/tests/test_passkey.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/tests/system/tests/test_passkey.py b/src/tests/system/tests/test_passkey.py index 3ce26a68a38..13460111e4c 100644 --- a/src/tests/system/tests/test_passkey.py +++ b/src/tests/system/tests/test_passkey.py @@ -96,8 +96,7 @@ def test_passkey__su(client: Client, provider: GenericProvider, moduledatadir: s """ suffix = type(provider).__name__.lower() - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" with open(f"{testdatadir}/passkey-mapping.{suffix}") as f: provider.user("user1").add().passkey_add(f.read().strip()) @@ -130,8 +129,7 @@ def test_passkey__su_fail_pin(client: Client, provider: GenericProvider, moduled """ suffix = type(provider).__name__.lower() - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" with open(f"{testdatadir}/passkey-mapping.{suffix}") as f: provider.user("user1").add().passkey_add(f.read().strip()) @@ -164,8 +162,7 @@ def test_passkey__su_fail_mapping(client: Client, provider: GenericProvider, mod """ suffix = type(provider).__name__.lower() - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" # Here, we are using passkey-mapping from the other FIDO2 key. @@ -209,12 +206,13 @@ def test_passkey__su_srv_not_resolvable( server_url = "ipa_server" elif suffix == "ldap": server_url = "ldap_uri" - client.sssd.domain["local_auth_policy"] = "only" elif suffix == "samba" or "ad": server_url = "ad_server" else: assert False, "provider not found" + client.sssd.domain["local_auth_policy"] = "only" + with open(f"{testdatadir}/passkey-mapping.{suffix}") as f: provider.user("user1").add().passkey_add(f.read().strip()) @@ -269,8 +267,7 @@ def test_passkey__offline_su(client: Client, provider: GenericProvider, moduleda with open(f"{testdatadir}/passkey-mapping.{suffix}") as f: provider.user("user1").add().passkey_add(f.read().strip()) - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" client.sssd.start() @@ -357,8 +354,7 @@ def test_passkey__su_multi_keys_for_same_user( suffix = type(provider).__name__.lower() user_add = provider.user("user1").add() - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" for n in range(1, 5): with open(f"{testdatadir}/passkey-mapping.{suffix}{n}") as f: @@ -394,8 +390,7 @@ def test_passkey__su_same_key_for_multi_user( """ suffix = type(provider).__name__.lower() - if suffix == "ldap": - client.sssd.domain["local_auth_policy"] = "only" + client.sssd.domain["local_auth_policy"] = "only" client.sssd.start()