diff options
Diffstat (limited to 'k8s/tests/test_k8sclient_deploy.py')
-rw-r--r-- | k8s/tests/test_k8sclient_deploy.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/k8s/tests/test_k8sclient_deploy.py b/k8s/tests/test_k8sclient_deploy.py index 3755855..30490a6 100644 --- a/k8s/tests/test_k8sclient_deploy.py +++ b/k8s/tests/test_k8sclient_deploy.py @@ -2,6 +2,7 @@ # org.onap.dcae # ================================================================================ # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2020 Nokia. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +23,8 @@ import pytest from common import do_deploy +from common import do_deploy_ext +from common import verify_external_cert def test_deploy_full_tls(mockk8sapi): ''' Deploy component with a full TLS configuration, to act as a server ''' @@ -46,3 +49,21 @@ def test_deploy_no_tls_info(mockk8sapi): app_container = dep.spec.template.spec.containers[0] assert app_container.volume_mounts[2].mount_path == "/opt/dcae/cacert" + +def test_deploy_external_cert(mockk8sapi): + ''' Deploy component with external TLS configuration ''' + + dep, deployment_description = do_deploy_ext({"external_cert_directory": "/path/to/container/cert/directory/", + "use_external_tls": True, + "cert_type": "P12", + "ca_name": "myname", + "external_certificate_parameters": { + "common_name": "mycommonname", + "sans": "mysans"} + }) + + app_container = dep.spec.template.spec.containers[0] + assert app_container.volume_mounts[2].mount_path == "/opt/dcae/cacert" + + # Make sure all of the external init container parameters are correct + verify_external_cert(dep) |