@@ -227,6 +227,22 @@ def test_tls_configuration() -> None:
227227 assert cfg .tls_key_password == Path ("tests/configuration/password" )
228228
229229
230+ def test_tls_configuration_in_service_configuration () -> None :
231+ """Test the TLS configuration in service configuration."""
232+ cfg = ServiceConfiguration (
233+ tls_config = TLSConfiguration (
234+ tls_certificate_path = Path ("tests/configuration/server.crt" ),
235+ tls_key_path = Path ("tests/configuration/server.key" ),
236+ tls_key_password = Path ("tests/configuration/password" ),
237+ )
238+ )
239+ assert cfg is not None
240+ assert cfg .tls_config is not None
241+ assert cfg .tls_config .tls_certificate_path == Path ("tests/configuration/server.crt" )
242+ assert cfg .tls_config .tls_key_path == Path ("tests/configuration/server.key" )
243+ assert cfg .tls_config .tls_key_password == Path ("tests/configuration/password" )
244+
245+
230246def test_tls_configuration_wrong_certificate_path () -> None :
231247 """Test the TLS configuration loading when some path is broken."""
232248 with pytest .raises (ValueError , match = "Path does not point to a file" ):
@@ -416,7 +432,13 @@ def test_dump_configuration(tmp_path) -> None:
416432 """
417433 cfg = Configuration (
418434 name = "test_name" ,
419- service = ServiceConfiguration (),
435+ service = ServiceConfiguration (
436+ tls_config = TLSConfiguration (
437+ tls_certificate_path = Path ("tests/configuration/server.crt" ),
438+ tls_key_path = Path ("tests/configuration/server.key" ),
439+ tls_key_password = Path ("tests/configuration/password" ),
440+ )
441+ ),
420442 llama_stack = LlamaStackConfiguration (
421443 use_as_library_client = True ,
422444 library_client_config_path = "tests/configuration/run.yaml" ,
@@ -462,9 +484,9 @@ def test_dump_configuration(tmp_path) -> None:
462484 "color_log" : True ,
463485 "access_log" : True ,
464486 "tls_config" : {
465- "tls_certificate_path" : None ,
466- "tls_key_path " : None ,
467- "tls_key_password " : None ,
487+ "tls_certificate_path" : "tests/configuration/server.crt" ,
488+ "tls_key_password " : "tests/configuration/password" ,
489+ "tls_key_path " : "tests/configuration/server.key" ,
468490 },
469491 },
470492 "llama_stack" : {
0 commit comments