summaryrefslogtreecommitdiffstats
path: root/k8s/tests/test_k8sclient_deploy.py
diff options
context:
space:
mode:
authorVijay Venkatesh Kumar <vv770d@att.com>2020-07-27 16:57:57 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-27 16:57:57 +0000
commit3465a3b57448f406a3308949d4951c305973e935 (patch)
treebbb939f3b9ab632fda4583883e36042c343fb643 /k8s/tests/test_k8sclient_deploy.py
parent3fd47a1851c68758eec3dbfe11b86fe1562544bb (diff)
parentbd7d70b16ffce30e31acd0bf1013b1392ca5fb81 (diff)
Merge "Add support to request certificates from CMPv2 server in DCAE cloudify blueprints"
Diffstat (limited to 'k8s/tests/test_k8sclient_deploy.py')
-rw-r--r--k8s/tests/test_k8sclient_deploy.py21
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)