2022-06-20 12:16:55 +02:00
|
|
|
""" testing get_radius_token """
|
|
|
|
|
|
|
|
|
|
|
|
import json
|
|
|
|
import logging
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
# pylint: disable=unused-import
|
|
|
|
from testutils import client, client_configfile
|
|
|
|
from kanidm import KanidmClient
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
|
2022-09-29 02:08:15 +02:00
|
|
|
RADIUS_TEST_USER = "test"
|
2022-06-20 12:16:55 +02:00
|
|
|
|
2022-09-29 02:08:15 +02:00
|
|
|
|
|
|
|
@pytest.mark.network
|
2022-06-20 12:16:55 +02:00
|
|
|
@pytest.mark.asyncio
|
|
|
|
async def test_radius_call(client_configfile: KanidmClient) -> None:
|
|
|
|
"""tests the radius call step"""
|
2022-09-29 02:08:15 +02:00
|
|
|
print("Doing auth_init using token")
|
2022-06-20 12:16:55 +02:00
|
|
|
|
2022-09-29 02:08:15 +02:00
|
|
|
if client_configfile.config.auth_token is None:
|
2022-10-31 13:23:24 +01:00
|
|
|
pytest.skip(
|
|
|
|
"You can't test auth if you don't have an auth_token in ~/.config/kanidm"
|
|
|
|
)
|
2022-09-29 02:08:15 +02:00
|
|
|
result = await client_configfile.get_radius_token(RADIUS_TEST_USER)
|
2022-06-20 12:16:55 +02:00
|
|
|
|
|
|
|
print(f"{result=}")
|
2024-01-31 04:27:43 +01:00
|
|
|
print(json.dumps(result.model_dump_json(), indent=4, default=str))
|