aboutsummaryrefslogtreecommitdiffstats
path: root/infra-healthcheck/infra_healthcheck
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-09-01 15:37:25 +0200
committermrichomme <morgan.richomme@orange.com>2020-09-03 11:25:09 +0200
commit3d9e6522e7aa87567aa73ab389a5ddb1d4bb70a6 (patch)
tree548687129d6bb609be6bfb07956c5b27636a7555 /infra-healthcheck/infra_healthcheck
parent66eefb845990d01c0296074eabdad3a5ad86281a (diff)
Integrate nodeport cert verification in xtesting
this tests checks the validity of the certificates by testing each SSL termination corresponding to node ports retrieved from the k8s python client It generates an html page with the list of the SSL certficiates, it indicates - the expiration date - the certificate owner A code color is provided too indicate if the cert is about to expire and/or is too wide (364 days max) The integration to xtesting is the first step before adding the test in Master daily CI Issue-ID: INT-1570 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: Ia20fc999610d1967eb9eed9415a568b3dbdda3e7 Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'infra-healthcheck/infra_healthcheck')
-rw-r--r--infra-healthcheck/infra_healthcheck/k8stest.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/infra-healthcheck/infra_healthcheck/k8stest.py b/infra-healthcheck/infra_healthcheck/k8stest.py
index da1d764..a22bcda 100644
--- a/infra-healthcheck/infra_healthcheck/k8stest.py
+++ b/infra-healthcheck/infra_healthcheck/k8stest.py
@@ -109,8 +109,6 @@ class K8sTesting(testcase.TestCase):
class OnapHelmTest(K8sTesting):
"""Kubernetes conformance test suite"""
def __init__(self, **kwargs):
- if "case_name" not in kwargs:
- kwargs.get("case_name", 'onap-helm')
super(OnapHelmTest, self).__init__(**kwargs)
self.cmd = ['/check_onap_helm.sh']
self.criteria_string = "Nb Failed Helm Charts"
@@ -119,9 +117,17 @@ class OnapHelmTest(K8sTesting):
class OnapSecurityNodePortsIngress(K8sTesting):
"""Check that there is no NodePort without corresponding Ingress port."""
def __init__(self, **kwargs):
- if "case_name" not in kwargs:
- kwargs.get("case_name", 'nodeport_ingress')
super(OnapSecurityNodePortsIngress, self).__init__(**kwargs)
self.cmd = ['python3', '/check_for_ingress_and_nodeports.py',
'--conf', '/root/.kube/config']
self.criteria_string = "NodePort without corresponding Ingress found"
+
+class OnapSecurityNodePortsCerts(K8sTesting):
+ """Check the cerfificates fot he nodeports."""
+ def __init__(self, **kwargs):
+ super(OnapSecurityNodePortsCerts, self).__init__(**kwargs)
+ os.chdir('/usr/lib/python3.8/site-packages/check_certificates')
+ self.cmd = ['python3', 'check_certificates_validity.py',
+ '--mode','nodeport','--namespace','onap','--dir',
+ '/var/lib/xtesting/results/nodeport_check_certs']
+ self.criteria_string = ">>> Test Check certificates PASS"