aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2020-09-02 10:03:47 +0200
committermrichomme <morgan.richomme@orange.com>2020-09-02 14:39:30 +0200
commit89499f0614c1dbc13b99917a3ff67f28b36cb66c (patch)
tree8459e7afce14e2653edc50c5170d5ef6e14e7aea /test
parent0d9647bb7af932581c22b13a331d08fa6345f537 (diff)
check_certificates: create result dir if needed
an arg allows to specify the results dir but if the dir path is not valid, we got an error try to create the dir before running the test Issue-ID: INT-1570 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: I32363af1f066dc5e5a0adf45619fb4e1a9052a7d Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'test')
-rw-r--r--test/security/check_certificates/check_certificates/check_certificates_validity.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/security/check_certificates/check_certificates/check_certificates_validity.py b/test/security/check_certificates/check_certificates/check_certificates_validity.py
index c38a7dc67..7447a64be 100644
--- a/test/security/check_certificates/check_certificates/check_certificates_validity.py
+++ b/test/security/check_certificates/check_certificates/check_certificates_validity.py
@@ -89,6 +89,10 @@ args = parser.parse_args()
onap_namespace = args.namespace
LOGGER.info("Verification of the %s certificates started", onap_namespace)
+# Create the target dir (in case it does not exist)
+if os.pardir not in args.dir:
+ os.makedirs(args.dir, exist_ok=True)
+
# Nodeport specific section
# Retrieve the kubernetes IP for mode nodeport
if args.mode == "nodeport":