Merge "Add reveal.js as a submodule"
authorvalentin boucher <valentin.boucher@orange.com>
Thu, 23 Mar 2017 09:46:52 +0000 (09:46 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Thu, 23 Mar 2017 09:46:52 +0000 (09:46 +0000)
32 files changed:
docker/Dockerfile
docker/Dockerfile.aarch64
functest/ci/__init__.py [changed mode: 0755->0644]
functest/ci/check_os.sh
functest/ci/config_functest.yaml
functest/ci/testcases.yaml
functest/ci/tier_builder.py [changed mode: 0755->0644]
functest/ci/tier_handler.py [changed mode: 0755->0644]
functest/core/vnf_base.py
functest/opnfv_tests/features/copper.py [changed mode: 0755->0644]
functest/opnfv_tests/features/doctor.py [changed mode: 0755->0644]
functest/opnfv_tests/features/domino.py [changed mode: 0755->0644]
functest/opnfv_tests/features/odl_sfc.py
functest/opnfv_tests/features/promise.py [changed mode: 0755->0644]
functest/opnfv_tests/features/sdnvpn.py [changed mode: 0755->0644]
functest/opnfv_tests/features/security_scan.py [changed mode: 0755->0644]
functest/opnfv_tests/mano/orchestra.py [changed mode: 0755->0644]
functest/opnfv_tests/openstack/healthcheck/healthcheck.sh [changed mode: 0755->0644]
functest/opnfv_tests/openstack/refstack_client/defcore.txt [moved from functest/opnfv_tests/openstack/refstack_client/defcore_201608.txt with 99% similarity]
functest/opnfv_tests/openstack/refstack_client/refstack_client.py
functest/opnfv_tests/vnf/ims/cloudify_ims.py
functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
functest/opnfv_tests/vnf/ims/opera_ims.py [changed mode: 0644->0755]
functest/opnfv_tests/vnf/ims/orchestra_ims.py [changed mode: 0644->0755]
functest/opnfv_tests/vnf/router/__init__.py [changed mode: 0755->0644]
functest/opnfv_tests/vnf/router/vyos_vrouter.py [changed mode: 0755->0644]
functest/tests/unit/core/test_vnf_base.py
functest/tests/unit/utils/test_functest_utils.py
functest/tests/unit/utils/test_openstack_utils.py
functest/utils/functest_logger.py [changed mode: 0755->0644]
functest/utils/functest_utils.py
functest/utils/openstack_utils.py [changed mode: 0755->0644]

index 30c31da..af3f8ec 100644 (file)
@@ -120,8 +120,20 @@ RUN cd ${REPOS_DIR}/barometer \
     && pip install .
 
 RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
-    -not -path "*tests/unit*" |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
-    && find ${FUNCTEST_REPO_DIR} -name "*.sh" |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
+    -not -path "*tests/unit*" \
+    -not -path "*functest_venv*" \
+    |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 \
+    && find ${FUNCTEST_REPO_DIR} -name "*.sh" \
+    -not -path "*functest_venv*" \
+    |xargs grep -L \#\! |cut -d\:  -f 1 |xargs chmod -c 644
+
+RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
+    -not -path "*tests/unit*" \
+    -not -path "*functest_venv*" \
+    |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
+    && find ${FUNCTEST_REPO_DIR} -name "*.sh" \
+    -not -path "*functest_venv*" \
+    |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
 
 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
 RUN ${REPOS_DIR}/rally/install_rally.sh --yes
index 15f0bdc..60f72a2 100644 (file)
@@ -112,8 +112,20 @@ RUN cd ${RELENG_MODULE_DIR} \
     && pip install -e .
 
 RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
-    -not -path "*tests/unit*" |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
-    && find ${FUNCTEST_REPO_DIR} -name "*.sh" |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
+    -not -path "*tests/unit*" \
+    -not -path "*functest_venv*" \
+    |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 &&
+    find ${FUNCTEST_REPO_DIR} -name "*.sh" \
+    -not -path "*functest_venv*" \
+    |xargs grep -L \#\! |cut -d\:  -f 1 |xargs chmod -c 644
+
+RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
+    -not -path "*tests/unit*" \
+    -not -path "*functest_venv*" \
+    |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 &&
+    find ${FUNCTEST_REPO_DIR} -name "*.sh" \
+    -not -path "*functest_venv*" \
+    |xargs grep \#\! |cut -d\:  -f 1 |xargs chmod -c 755
 
 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
 RUN ${REPOS_DIR}/rally/install_rally.sh --yes
old mode 100755 (executable)
new mode 100644 (file)
index 2c5c021..3920b7a 100755 (executable)
@@ -26,6 +26,11 @@ verify_connectivity() {
     return 1
 }
 
+verify_SSL_connectivity() {
+    openssl s_client -connect $1:$2 &>/dev/null
+    return $?
+}
+
 check_service() {
     local service cmd
     service=$1
@@ -63,10 +68,16 @@ fi
 
 echo "Checking OpenStack endpoints:"
 publicURL=$(openstack catalog show  identity |awk '/public/ {print $4}')
-publicIP=$(echo $publicURL|sed 's/^.*http\:\/\///'|sed 's/.[^:]*$//')
+publicIP=$(echo $publicURL|sed 's/^.*http.*\:\/\///'|sed 's/.[^:]*$//')
 publicPort=$(echo $publicURL|sed 's/^.*://'|sed 's/\/.*$//')
-echo ">>Verifying connectivity to the public endpoint $publicIP:$publicPort..."
-verify_connectivity $publicIP $publicPort
+https_enabled=$(echo $publicURL | grep 'https')
+if [[ -n $https_enabled ]]; then
+    echo ">>Verifying SSL connectivity to the public endpoint $publicIP:$publicPort..."
+    verify_SSL_connectivity $publicIP $publicPort
+else
+    echo ">>Verifying connectivity to the public endpoint $publicIP:$publicPort..."
+    verify_connectivity $publicIP $publicPort
+fi
 RETVAL=$?
 if [ $RETVAL -ne 0 ]; then
     echo "ERROR: Cannot talk to the public endpoint $publicIP:$publicPort ."
@@ -81,10 +92,16 @@ if [ -z ${adminURL} ]; then
     openstack catalog show identity
     exit 1
 fi
-adminIP=$(echo $adminURL|sed 's/^.*http\:\/\///'|sed 's/.[^:]*$//')
+adminIP=$(echo $adminURL|sed 's/^.*http.*\:\/\///'|sed 's/.[^:]*$//')
 adminPort=$(echo $adminURL|sed 's/^.*://'|sed 's/.[^\/]*$//')
-echo ">>Verifying connectivity to the admin endpoint $adminIP:$adminPort..."
-verify_connectivity $adminIP $adminPort
+https_enabled=$(echo $adminURL | grep 'https')
+if [[ -n $https_enabled ]]; then
+    echo ">>Verifying SSL connectivity to the admin endpoint $adminIP:$adminPort..."
+    verify_SSL_connectivity $adminIP $adminPort
+else
+    echo ">>Verifying connectivity to the admin endpoint $adminIP:$adminPort..."
+    verify_connectivity $adminIP $adminPort
+fi
 RETVAL=$?
 if [ $RETVAL -ne 0 ]; then
     echo "ERROR: Cannot talk to the admin endpoint $adminIP:$adminPort ."
index 00e44ad..4d5a621 100755 (executable)
@@ -125,7 +125,7 @@ rally:
 
 refstack:
     tempest_conf_path: openstack/refstack_client/tempest.conf
-    defcore_list: openstack/refstack_client/defcore_201608.txt
+    defcore_list: openstack/refstack_client/defcore.txt
 
 vnf:
     aaa:
index e3d5ffa..5f54b97 100755 (executable)
@@ -132,7 +132,7 @@ tiers:
 
             -
                 name: refstack_defcore
-                criteria: 'success_rate >= 80%'
+                criteria: 'success_rate == 100%'
                 blocking: false
                 clean_flag: false
                 description: >-
@@ -168,7 +168,7 @@ tiers:
             -
                 name: odl_netvirt
                 criteria: 'success_rate == 100%'
-                blocking: true
+                blocking: false
                 clean_flag: false
                 description: >-
                     Test Suite for the OpenDaylight SDN Controller when
@@ -435,20 +435,6 @@ tiers:
 #                run:
 #                    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%'
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 0300dd2..f5e8605 100644 (file)
@@ -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)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3b68d42..1956c9c 100644 (file)
@@ -14,7 +14,7 @@ class OpenDaylightSFC(base.FeatureBase):
 
     def __init__(self):
         super(OpenDaylightSFC, self).__init__(project='sfc',
-                                              case='functest-odl-sfc"',
+                                              case='functest-odl-sfc',
                                               repo='dir_repo_sfc')
         dir_sfc_functest = '{}/sfc/tests/functest'.format(self.repo)
         self.cmd = 'cd %s && python ./run_tests.py' % dir_sfc_functest
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
@@ -77,7 +77,7 @@ tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_u
 tempest.api.compute.test_quotas.QuotasTestJSON.test_get_default_quotas[id-9bfecac7-b966-4f47-913f-1a9e2c12134a]
 tempest.api.compute.test_quotas.QuotasTestJSON.test_get_quotas[id-f1ef0a97-dbbb-4cca-adc5-c9fbc4f76107]
 tempest.api.compute.test_versions.TestVersions.test_list_api_versions[id-6c0a0990-43b6-4529-9b61-5fd8daf7c55c]
-tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume[id-52e9045a-e90d-4c0d-9087-79d657faffff]
+tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_attach_detach_volume[id-52e9045a-e90d-4c0d-9087-79d657faffff]
 tempest.api.compute.volumes.test_attach_volume.AttachVolumeTestJSON.test_list_get_volume_attachments[id-7fa563fe-f0f7-43eb-9e22-a1ece036b513]
 tempest.api.identity.v3.TestApiDiscovery.test_api_media_types[id-657c1970-4722-4189-8831-7325f3bc4265]
 tempest.api.identity.v3.TestApiDiscovery.test_api_version_resources[id-b9232f5e-d9e5-4d97-b96c-28d3db4de1bd]
index c9f0f27..7d4c568 100755 (executable)
@@ -129,10 +129,10 @@ class RefstackClient(testcase_base.TestcaseBase):
             num_executed = int(num_tests) - int(num_skipped)
             success_rate = 100 * int(num_success) / int(num_executed)
 
-            self.details = {"num_tests": int(num_tests),
-                            "num_failures": int(num_failures),
+            self.details = {"tests": int(num_tests),
+                            "failures": int(num_failures),
                             "success": success_testcases,
-                            "failed": failed_testcases,
+                            "errors": failed_testcases,
                             "skipped": skipped_testcases}
         except Exception:
             success_rate = 0
index 354bf88..f7dfd53 100644 (file)
@@ -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)
 
index b84ef8f..74b9e95 100644 (file)
@@ -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: ''
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index df57800..d13fe8f
@@ -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"
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 25a74b7..1680f03 100644 (file)
@@ -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)
index e5bae62..eb241e5 100644 (file)
@@ -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',
index ef3764c..f51a499 100644 (file)
@@ -28,7 +28,8 @@ class OSUtilsTesting(unittest.TestCase):
                 'OS_PROJECT_DOMAIN_NAME': os_prefix + 'project_domain_name',
                 'OS_PROJECT_NAME': os_prefix + 'project_name',
                 'OS_ENDPOINT_TYPE': os_prefix + 'endpoint_type',
-                'OS_REGION_NAME': os_prefix + 'region_name'}
+                'OS_REGION_NAME': os_prefix + 'region_name',
+                'OS_CACERT': os_prefix + 'https_cacert'}
 
     def _get_os_env_vars(self):
         return {'username': 'test_username', 'password': 'test_password',
@@ -37,7 +38,8 @@ class OSUtilsTesting(unittest.TestCase):
                 'project_domain_name': 'test_project_domain_name',
                 'project_name': 'test_project_name',
                 'endpoint_type': 'test_endpoint_type',
-                'region_name': 'test_region_name'}
+                'region_name': 'test_region_name',
+                'https_cacert': 'test_https_cacert'}
 
     def setUp(self):
         self.env_vars = ['OS_AUTH_URL', 'OS_USERNAME', 'OS_PASSWORD']
@@ -299,7 +301,7 @@ class OSUtilsTesting(unittest.TestCase):
                          'OS_PROJECT_DOMAIN_NAME'])
         self.assertEqual(openstack_utils.get_rc_env_vars(), exp_resp)
 
-    @mock.patch('functest.utils.openstack_utils.get_rc_env_vars')
+    @mock.patch('functest.utils.openstack_utils')
     def test_check_credentials_missing_env(self, mock_get_rc_env):
         exp_resp = self.env_vars
         exp_resp.extend(['OS_TENANT_NAME'])
old mode 100755 (executable)
new mode 100644 (file)
index 9e13ffe..7cc5029 100644 (file)
@@ -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')
 
old mode 100755 (executable)
new mode 100644 (file)
index e33af63..ffc870f
@@ -82,7 +82,8 @@ def get_env_cred_dict():
         'OS_PROJECT_DOMAIN_NAME': 'project_domain_name',
         'OS_PROJECT_NAME': 'project_name',
         'OS_ENDPOINT_TYPE': 'endpoint_type',
-        'OS_REGION_NAME': 'region_name'
+        'OS_REGION_NAME': 'region_name',
+        'OS_CACERT': 'https_cacert'
     }
     return env_cred_dict
 
@@ -149,6 +150,11 @@ def get_credentials_for_rally():
     if region_name is not None:
         cred_key = env_cred_dict.get('OS_REGION_NAME')
         rally_conf[cred_key] = region_name
+
+    cacert = os.getenv('OS_CACERT')
+    if cacert is not None:
+        cred_key = env_cred_dict.get('OS_CACERT')
+        rally_conf[cred_key] = cacert
     return rally_conf
 
 
@@ -168,7 +174,14 @@ def get_endpoint(service_type, endpoint_type='publicURL'):
 
 def get_session(other_creds={}):
     auth = get_session_auth(other_creds)
-    return session.Session(auth=auth)
+    cacert = os.getenv('OS_CACERT')
+    if cacert is not None:
+        if not os.path.isfile(cacert):
+            raise Exception("The 'OS_CACERT' environment"
+                            "variable is set to %s but the file"
+                            "does not exist.", cacert)
+
+    return session.Session(auth=auth, verify=cacert)
 
 
 # *********************************************