summaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/ims/cloudify_ims.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/vnf/ims/cloudify_ims.py')
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index 36862bd43..7ec647c69 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -22,7 +22,7 @@ import scp
import six
from functest.core import cloudify
-from functest.opnfv_tests.vnf.ims import clearwater_ims_base
+from functest.opnfv_tests.vnf.ims import clearwater
from functest.utils import config
from functest.utils import env
@@ -61,20 +61,17 @@ class CloudifyIms(cloudify.Cloudify):
self.case_dir = pkg_resources.resource_filename(
'functest', 'opnfv_tests/vnf/ims')
config_file = os.path.join(self.case_dir, self.config)
- self.orchestrator = dict(
- requirements=get_config("orchestrator.requirements", config_file),
- )
+
self.details['orchestrator'] = dict(
name=get_config("orchestrator.name", config_file),
version=get_config("orchestrator.version", config_file),
status='ERROR',
result=''
)
- self.__logger.debug("Orchestrator configuration %s", self.orchestrator)
+
self.vnf = dict(
descriptor=get_config("vnf.descriptor", config_file),
- inputs=get_config("vnf.inputs", config_file),
- requirements=get_config("vnf.requirements", config_file)
+ inputs=get_config("vnf.inputs", config_file)
)
self.details['vnf'] = dict(
descriptor_version=self.vnf['descriptor']['version'],
@@ -90,6 +87,7 @@ class CloudifyIms(cloudify.Cloudify):
self.image_alt = None
self.flavor_alt = None
+ self.clearwater = None
def check_requirements(self):
if env.get('NEW_USER_ROLE').lower() == "admin":
@@ -194,33 +192,34 @@ class CloudifyIms(cloudify.Cloudify):
execution = wait_for_execution(
self.cfy_client, execution, self.__logger, timeout=3600)
- duration = time.time() - start_time
-
self.__logger.info(execution)
- if execution.status == 'terminated':
- self.details['vnf'].update(status='PASS', duration=duration)
- self.result += 1/3 * 100
- result = True
- else:
- self.details['vnf'].update(status='FAIL', duration=duration)
- result = False
- return result
+ if execution.status != 'terminated':
+ self.details['vnf'].update(status='FAIL',
+ duration=time.time() - start_time)
+ return False
+
+ ellis_ip = self.cfy_client.deployments.outputs.get(
+ self.vnf['descriptor'].get('name'))['outputs']['ellis_ip']
+ self.clearwater = clearwater.ClearwaterTesting(self.case_name,
+ ellis_ip)
+ self.clearwater.availability_check_by_creating_numbers()
+
+ self.details['vnf'].update(status='PASS',
+ duration=time.time() - start_time)
+ self.result += 1/3 * 100
+ return True
def test_vnf(self):
"""Run test on clearwater ims instance."""
start_time = time.time()
- testing = clearwater_ims_base.ClearwaterOnBoardingBase(self.case_name)
- outputs = self.cfy_client.deployments.outputs.get(
- self.vnf['descriptor'].get('name'))['outputs']
- dns_ip = outputs['dns_ip']
- ellis_ip = outputs['ellis_ip']
- testing.config_ellis(ellis_ip)
+ dns_ip = self.cfy_client.deployments.outputs.get(
+ self.vnf['descriptor'].get('name'))['outputs']['dns_ip']
if not dns_ip:
return False
- short_result = testing.run_clearwater_live_test(
+ short_result = self.clearwater.run_clearwater_live_test(
dns_ip=dns_ip,
public_domain=self.vnf['inputs']["public_domain"])
duration = time.time() - start_time