aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfunctest/ci/testcases.yaml14
-rw-r--r--functest/core/vnf_base.py15
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py6
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.yaml4
-rwxr-xr-xfunctest/opnfv_tests/vnf/ims/orchestra_ims.py11
-rw-r--r--functest/tests/unit/core/test_vnf_base.py22
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py19
-rw-r--r--functest/utils/functest_utils.py8
8 files changed, 34 insertions, 65 deletions
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index e3d5ffad..6bc12ab8 100755
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -436,20 +436,6 @@ tiers:
# module: 'functest.opnfv_tests.openstack.tempest.tempest'
# class: 'TempestFullParallel'
-
- name: tempest_defcore
- criteria: 'success_rate == 100%'
- blocking: false
- clean_flag: false
- description: >-
- This is the set of Tempest test cases created by OpenStack
- Interop Working Group for certification purposes.
- dependencies:
- installer: ''
- scenario: 'nosdn-nofeature-ha'
- run:
- module: 'functest.opnfv_tests.openstack.tempest.tempest'
- class: 'TempestDefcore'
- -
name: tempest_custom
criteria: 'success_rate == 100%'
blocking: false
diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py
index 0300dd22..f5e86054 100644
--- a/functest/core/vnf_base.py
+++ b/functest/core/vnf_base.py
@@ -52,8 +52,13 @@ class VnfOnBoardingBase(base.TestcaseBase):
def execute(self):
self.start_time = time.time()
# Prepare the test (Create Tenant, User, ...)
- self.logger.info("Create VNF Onboarding environment")
- self.prepare()
+ try:
+ self.logger.info("Create VNF Onboarding environment")
+ self.prepare()
+ except Exception:
+ self.logger.error("Error during VNF Onboarding environment" +
+ "creation", exc_info=True)
+ return base.TestcaseBase.EX_TESTCASE_FAILED
# Deploy orchestrator
try:
@@ -179,11 +184,11 @@ class VnfOnBoardingBase(base.TestcaseBase):
# TODO see how to use built-in exception from releng module
def deploy_vnf(self):
self.logger.error("VNF must be deployed")
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception("VNF not deployed")
def test_vnf(self):
self.logger.error("VNF must be tested")
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception("VNF not tested")
def clean(self):
self.logger.info("test cleaning")
@@ -232,4 +237,4 @@ class VnfOnBoardingBase(base.TestcaseBase):
self.details[part]['status'] = 'FAIL'
self.details[part]['result'] = error_msg
self.logger.error("Step failure:{}".format(error_msg))
- return base.TestcaseBase.EX_TESTCASE_FAILED
+ raise Exception(error_msg)
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index 354bf889..f7dfd532 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -203,7 +203,7 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
flavor_exist, flavor_id = os_utils.get_or_create_flavor(
"m1.small",
self.vnf['requirements']['ram_min'],
- '20',
+ '30',
'1',
public=True)
self.logger.debug("Flavor id: %s" % flavor_id)
@@ -276,6 +276,8 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
i = 30
while rq.status_code != 201 and i > 0:
rq = requests.post(url, data=params)
+ self.logger.debug("Account creation http status code: %s"
+ % rq.status_code)
i = i - 1
time.sleep(10)
@@ -292,6 +294,8 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
i = 24
while rq.status_code != 200 and i > 0:
rq = requests.post(url, cookies=cookies)
+ self.logger.debug("Number creation http status code: %s"
+ % rq.status_code)
i = i - 1
time.sleep(25)
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
index b84ef8fd..74b9e958 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
@@ -6,7 +6,7 @@ cloudify:
url: https://github.com/boucherv-orange/cloudify-manager-blueprints.git
branch: '3.3.1-build'
requirements:
- ram_min: 4000
+ ram_min: 4096
os_image: centos_7
inputs:
keystone_username: ""
@@ -29,7 +29,7 @@ clearwater:
branch: stable
deployment_name: clearwater-opnfv
requirements:
- ram_min: 2000
+ ram_min: 2048
os_image: ubuntu_14.04
inputs:
image_id: ''
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_ims.py b/functest/opnfv_tests/vnf/ims/orchestra_ims.py
index df57800a..d13fe8fe 100755
--- a/functest/opnfv_tests/vnf/ims/orchestra_ims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_ims.py
@@ -308,12 +308,15 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
if self.ob_projectid == "":
self.step_failure("Default project id was not found!")
+ creds = os_utils.get_credentials()
+ self.logger.info("PoP creds: %s" % creds)
+
vim_json = {
"name": "vim-instance",
- "authUrl": os_utils.get_credentials().get("auth_url"),
- "tenant": os_utils.get_credentials().get("tenant_name"),
- "username": os_utils.get_credentials().get("username"),
- "password": os_utils.get_credentials().get("password"),
+ "authUrl": creds.get("auth_url"),
+ "tenant": os.environ.get("OS_PROJECT_ID"),
+ "username": creds.get("username"),
+ "password": creds.get("password"),
"securityGroups": [
"default",
"orchestra-sec-group"
diff --git a/functest/tests/unit/core/test_vnf_base.py b/functest/tests/unit/core/test_vnf_base.py
index 25a74b7c..1680f03f 100644
--- a/functest/tests/unit/core/test_vnf_base.py
+++ b/functest/tests/unit/core/test_vnf_base.py
@@ -8,11 +8,9 @@
# http://www.apache.org/licenses/LICENSE-2.0
import logging
-import mock
import unittest
from functest.core import vnf_base
-from functest.core import testcase_base
class VnfBaseTesting(unittest.TestCase):
@@ -37,17 +35,15 @@ class VnfBaseTesting(unittest.TestCase):
"result": "",
"duration": 5}}
- @mock.patch('logging.Logger.error')
- def test_deploy_vnf_unimplemented(self, mock):
- self.assertEqual(self.test.deploy_vnf(),
- testcase_base.TestcaseBase.EX_TESTCASE_FAILED)
- mock.assert_called_with('VNF must be deployed')
-
- @mock.patch('logging.Logger.error')
- def test_test_vnf_unimplemented(self, mock):
- self.assertEqual(self.test.test_vnf(),
- testcase_base.TestcaseBase.EX_TESTCASE_FAILED)
- mock.assert_called_with('VNF must be tested')
+ def test_deploy_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.deploy_vnf()
+ self.assertTrue('VNF not deployed' in context.exception)
+
+ def test_test_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.test_vnf()()
+ self.assertTrue('VNF not tested' in context.exception)
def test_parse_results(self):
self.assertNotEqual(self.test.parse_results(), 0)
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index e5bae62f..eb241e5d 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -295,25 +295,6 @@ class FunctestUtilsTesting(unittest.TestCase):
def test_push_results_to_db_missing_buildtag(self):
self._test_push_results_to_db_missing_env('BUILD_TAG')
- def test_push_results_to_db_incorrect_buildtag(self):
- dic = self._get_env_dict(None)
- dic['BUILD_TAG'] = 'incorrect_build_tag'
- with mock.patch('functest.utils.functest_utils.get_db_url',
- return_value=self.db_url), \
- mock.patch.dict(os.environ,
- dic,
- clear=True), \
- mock.patch('functest.utils.functest_utils.logger.error') \
- as mock_logger_error:
- self.assertFalse(functest_utils.
- push_results_to_db(self.project, self.case_name,
- self.start_date,
- self.stop_date,
- self.criteria, self.details))
- mock_logger_error.assert_called_once_with("Please fix BUILD_TAG"
- " env var: incorrect_"
- "build_tag")
-
def test_push_results_to_db_request_post_failed(self):
dic = self._get_env_dict(None)
with mock.patch('functest.utils.functest_utils.get_db_url',
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index 9e13ffe9..7cc5029d 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -207,13 +207,7 @@ def push_results_to_db(project, case_name,
except KeyError as e:
logger.error("Please set env var: " + str(e))
return False
- rule = "daily-(.+?)-[0-9]*"
- m = re.search(rule, build_tag)
- if m:
- version = m.group(1)
- else:
- logger.error("Please fix BUILD_TAG env var: " + build_tag)
- return False
+ version = get_version()
test_start = dt.fromtimestamp(start_date).strftime('%Y-%m-%d %H:%M:%S')
test_stop = dt.fromtimestamp(stop_date).strftime('%Y-%m-%d %H:%M:%S')