Skip to content

Commit

Permalink
test: set 'local_auth_policy = only' for all passkey test
Browse files Browse the repository at this point in the history
Reviewed-by: Alejandro López <[email protected]>
Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Justin Stephenson <[email protected]>
Reviewed-by: Scott Poore <[email protected]>
  • Loading branch information
sumit-bose authored and alexey-tikhonov committed Apr 2, 2024
1 parent 05df816 commit 79c384f
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/tests/system/tests/test_passkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,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())
Expand Down Expand Up @@ -139,8 +138,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())
Expand Down Expand Up @@ -174,8 +172,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.

Expand Down Expand Up @@ -220,12 +217,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())

Expand Down Expand Up @@ -281,8 +279,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()

Expand Down Expand Up @@ -370,8 +367,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:
Expand Down Expand Up @@ -408,8 +404,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()

Expand Down

0 comments on commit 79c384f

Please sign in to comment.