aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/vIMS/CI
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2016-01-05 11:43:09 +0100
committerboucherv <valentin.boucher@orange.com>2016-01-05 11:43:09 +0100
commit4919b0f1a128fc5c5fd18c51964b5c75569d5503 (patch)
tree8542be36242c06a7fe199b7c626e13f0e8058c47 /testcases/vIMS/CI
parentab93e47b58512d1f38cebff9adb3e335f937ebdd (diff)
Ensure no ssh key file already exists before launch cloudify deployment
JIRA: FUNCTEST-115 Change-Id: Icef3da22f8cd4a528bd466d955037a9f37864f9b Signed-off-by: boucherv <valentin.boucher@orange.com>
Diffstat (limited to 'testcases/vIMS/CI')
-rw-r--r--testcases/vIMS/CI/orchestrator.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/testcases/vIMS/CI/orchestrator.py b/testcases/vIMS/CI/orchestrator.py
index 409b3e0cb..729e67881 100644
--- a/testcases/vIMS/CI/orchestrator.py
+++ b/testcases/vIMS/CI/orchestrator.py
@@ -72,8 +72,17 @@ class orchestrator:
f.write(yaml.dump(self.config, default_style='"') )
f.close()
- if self.logger:
+ # Ensure no ssh key file already exists
+ key_files = ["/.ssh/cloudify-manager-kp.pem", "/.ssh/cloudify-agent-kp.pem"]
+ home = os.path.expanduser("~")
+
+ for key_file in key_files:
+ if os.path.isfile(home + key_file):
+ os.remove(home + key_file)
+
+ if self.logger:
self.logger.info("Launching the cloudify-manager deployment")
+
script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; "
script += "cd " + self.testcase_dir + "; "
script += "cfy init -r; "
@@ -97,7 +106,7 @@ class orchestrator:
script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; "
script += "cd " + self.testcase_dir + "; "
- script += "cfy teardown -f; "
+ script += "cfy teardown -f --ignore-deployments=True; "
cmd = "/bin/bash -c '" + script + "'"
execute_command(cmd, self.logger)
@@ -144,7 +153,10 @@ class orchestrator:
script += "cfy deployments delete -d " + dep_name + "; "
cmd = "/bin/bash -c '" + script + "'"
- execute_command(cmd, self.logger)
+ try:
+ execute_command(cmd, self.logger)
+ except:
+ logger.error("Clearwater undeployment failed")
def execute_command(cmd, logger):