diff --git a/tests/test_spawner.py b/tests/test_spawner.py index 9daa7cdc..6a64f923 100644 --- a/tests/test_spawner.py +++ b/tests/test_spawner.py @@ -1,4 +1,5 @@ import asyncio +import base64 import json import os from functools import partial @@ -365,6 +366,32 @@ async def test_spawn_component_label( await spawner.stop() +async def test_spawner_internal_ssl_secret( + ssl_app, + config, +): + spawner = KubeSpawner( + config=config, + # hub=hub_ssl, + user=MockUser(name="ssl"), + # api_token="abc123", + # oauth_client_id="unused", + internal_ssl=True, + internal_trust_bundles=ssl_app.internal_trust_bundles, + internal_certs_location=ssl_app.internal_certs_location, + _mock=True, + ) + # initialize ssl config + hub_paths = await spawner.create_certs() + + spawner.cert_paths = await spawner.move_certs(hub_paths) + + # Validate that certificates were correctly encoded as base64 + manifest = spawner.get_secret_manifest(None) + for _, secret in manifest.data.items(): + base64.b64decode(secret, validate=True) + + async def test_spawn_internal_ssl( kube_ns, kube_client,