diff options
Diffstat (limited to 'functest/opnfv_tests')
19 files changed, 115 insertions, 18 deletions
diff --git a/functest/opnfv_tests/features/copper.py b/functest/opnfv_tests/features/copper.py index 735b315d..735b315d 100755..100644 --- a/functest/opnfv_tests/features/copper.py +++ b/functest/opnfv_tests/features/copper.py diff --git a/functest/opnfv_tests/features/doctor.py b/functest/opnfv_tests/features/doctor.py index 4d295a67..4d295a67 100755..100644 --- a/functest/opnfv_tests/features/doctor.py +++ b/functest/opnfv_tests/features/doctor.py diff --git a/functest/opnfv_tests/features/domino.py b/functest/opnfv_tests/features/domino.py index b36220fa..b36220fa 100755..100644 --- a/functest/opnfv_tests/features/domino.py +++ b/functest/opnfv_tests/features/domino.py diff --git a/functest/opnfv_tests/features/odl_sfc.py b/functest/opnfv_tests/features/odl_sfc.py index 3b68d420..431cd47e 100644 --- a/functest/opnfv_tests/features/odl_sfc.py +++ b/functest/opnfv_tests/features/odl_sfc.py @@ -8,13 +8,15 @@ # http://www.apache.org/licenses/LICENSE-2.0 # import functest.core.feature_base as base +from sfc.tests.functest import run_tests 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 + + def execute(self): + return run_tests.main() diff --git a/functest/opnfv_tests/features/promise.py b/functest/opnfv_tests/features/promise.py index 15636fbf..15636fbf 100755..100644 --- a/functest/opnfv_tests/features/promise.py +++ b/functest/opnfv_tests/features/promise.py diff --git a/functest/opnfv_tests/features/sdnvpn.py b/functest/opnfv_tests/features/sdnvpn.py index 1919a03c..1919a03c 100755..100644 --- a/functest/opnfv_tests/features/sdnvpn.py +++ b/functest/opnfv_tests/features/sdnvpn.py diff --git a/functest/opnfv_tests/features/security_scan.py b/functest/opnfv_tests/features/security_scan.py index 58f0ec74..58f0ec74 100755..100644 --- a/functest/opnfv_tests/features/security_scan.py +++ b/functest/opnfv_tests/features/security_scan.py diff --git a/functest/opnfv_tests/mano/orchestra.py b/functest/opnfv_tests/mano/orchestra.py index fd5e40d0..fd5e40d0 100755..100644 --- a/functest/opnfv_tests/mano/orchestra.py +++ b/functest/opnfv_tests/mano/orchestra.py diff --git a/functest/opnfv_tests/openstack/healthcheck/healthcheck.sh b/functest/opnfv_tests/openstack/healthcheck/healthcheck.sh index 7fa957c0..7fa957c0 100755..100644 --- a/functest/opnfv_tests/openstack/healthcheck/healthcheck.sh +++ b/functest/opnfv_tests/openstack/healthcheck/healthcheck.sh diff --git a/functest/opnfv_tests/openstack/refstack_client/defcore_201608.txt b/functest/opnfv_tests/openstack/refstack_client/defcore.txt index 26eddafc..be8fd899 100644 --- a/functest/opnfv_tests/openstack/refstack_client/defcore_201608.txt +++ b/functest/opnfv_tests/openstack/refstack_client/defcore.txt @@ -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] diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py index d388dcd7..7d4c568a 100755 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -7,7 +7,10 @@ # http://www.apache.org/licenses/LICENSE-2.0 import argparse import os +import re import sys +import subprocess +import time from functest.core import testcase_base from functest.opnfv_tests.openstack.tempest import conf_utils @@ -24,6 +27,7 @@ class RefstackClient(testcase_base.TestcaseBase): def __init__(self): super(RefstackClient, self).__init__() + self.case_name = "refstack_defcore" self.FUNCTEST_TEST = CONST.dir_functest_test self.CONF_PATH = CONST.refstack_tempest_conf_path self.DEFCORE_LIST = CONST.refstack_defcore_list @@ -63,7 +67,80 @@ class RefstackClient(testcase_base.TestcaseBase): "cd -;".format(CONST.dir_refstack_client, self.confpath, self.defcorelist)) - ft_utils.execute_command(cmd) + logger.info("Starting Refstack_defcore test case: '%s'." % cmd) + + header = ("Tempest environment:\n" + " Installer: %s\n Scenario: %s\n Node: %s\n Date: %s\n" % + (CONST.INSTALLER_TYPE, + CONST.DEPLOY_SCENARIO, + CONST.NODE_NAME, + time.strftime("%a %b %d %H:%M:%S %Z %Y"))) + + f_stdout = open( + os.path.join(conf_utils.REFSTACK_RESULTS_DIR, + "refstack.log"), 'w+') + f_stderr = open( + os.path.join(conf_utils.REFSTACK_RESULTS_DIR, + "refstack-error.log"), 'w+') + f_env = open(os.path.join(conf_utils.REFSTACK_RESULTS_DIR, + "environment.log"), 'w+') + f_env.write(header) + + p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, + stderr=f_stderr, bufsize=1) + + with p.stdout: + for line in iter(p.stdout.readline, b''): + if 'Tests' in line: + break + logger.info(line.replace('\n', '')) + f_stdout.write(line) + p.wait() + + f_stdout.close() + f_stderr.close() + f_env.close() + + def parse_refstack_result(self): + try: + with open(os.path.join(conf_utils.REFSTACK_RESULTS_DIR, + "refstack.log"), 'r') as logfile: + output = logfile.read() + + for match in re.findall("Ran: (\d+) tests in (\d+\.\d{4}) sec.", + output): + num_tests = match[0] + for match in re.findall("- Passed: (\d+)", output): + num_success = match + for match in re.findall("- Skipped: (\d+)", output): + num_skipped = match + for match in re.findall("- Failed: (\d+)", output): + num_failures = match + success_testcases = "" + for match in re.findall(r"\{0\}(.*?)[. ]*ok", output): + success_testcases += match + ", " + failed_testcases = "" + for match in re.findall(r"\{0\}(.*?)[. ]*FAILED", output): + failed_testcases += match + ", " + skipped_testcases = "" + for match in re.findall(r"\{0\}(.*?)[. ]*SKIPPED:", output): + skipped_testcases += match + ", " + + num_executed = int(num_tests) - int(num_skipped) + success_rate = 100 * int(num_success) / int(num_executed) + + self.details = {"tests": int(num_tests), + "failures": int(num_failures), + "success": success_testcases, + "errors": failed_testcases, + "skipped": skipped_testcases} + except Exception: + success_rate = 0 + + self.criteria = ft_utils.check_success_rate( + self.case_name, success_rate) + logger.info("Testcase %s success_rate is %s%%, is marked as %s" + % (self.case_name, success_rate, self.criteria)) def defcore_env_prepare(self): try: @@ -80,14 +157,21 @@ class RefstackClient(testcase_base.TestcaseBase): return res def run(self): + self.start_time = time.time() + + if not os.path.exists(conf_utils.REFSTACK_RESULTS_DIR): + os.makedirs(conf_utils.REFSTACK_RESULTS_DIR) + try: self.defcore_env_prepare() self.run_defcore_default() + self.parse_refstack_result() res = testcase_base.TestcaseBase.EX_OK except Exception as e: logger.error('Error with run: %s', e) res = testcase_base.TestcaseBase.EX_RUN_ERROR + self.stop_time = time.time() return res def main(self, **kwargs): diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index 18549974..a21322d8 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -35,6 +35,8 @@ TEMPEST_DEFCORE = os.path.join(REPO_PATH, TEMPEST_TEST_LIST_DIR, 'defcore_req.txt') TEMPEST_RAW_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_raw_list.txt') TEMPEST_LIST = os.path.join(TEMPEST_RESULTS_DIR, 'test_list.txt') +REFSTACK_RESULTS_DIR = os.path.join(CONST.dir_results, + 'refstack') CI_INSTALLER_TYPE = CONST.INSTALLER_TYPE CI_INSTALLER_IP = CONST.INSTALLER_IP diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index 2ced92e9..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) @@ -261,6 +261,9 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): dns_ip = dep_outputs.json()['outputs']['dns_ip'] ellis_ip = dep_outputs.json()['outputs']['ellis_ip'] + self.logger.debug("DNS ip : %s" % dns_ip) + self.logger.debug("ELLIS ip : %s" % ellis_ip) + ellis_url = "http://" + ellis_ip + "/" url = ellis_url + "accounts" @@ -270,9 +273,11 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): "signup_code": "secret"} rq = requests.post(url, data=params) - i = 20 + 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) @@ -281,8 +286,7 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): rq = requests.post(url, data=params) cookies = rq.cookies else: - self.step_failure("Unable to create an account for number" + - " provision: %s" % rq.json()['reason']) + self.step_failure("Unable to create an account") url = ellis_url + "accounts/" + params['email'] + "/numbers" if cookies != "": @@ -290,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/opera_ims.py b/functest/opnfv_tests/vnf/ims/opera_ims.py index 7ead401f..7ead401f 100644..100755 --- a/functest/opnfv_tests/vnf/ims/opera_ims.py +++ b/functest/opnfv_tests/vnf/ims/opera_ims.py diff --git a/functest/opnfv_tests/vnf/ims/orchestra_ims.py b/functest/opnfv_tests/vnf/ims/orchestra_ims.py index 42b218e6..d13fe8fe 100644..100755 --- a/functest/opnfv_tests/vnf/ims/orchestra_ims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_ims.py @@ -245,7 +245,7 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): % (self.imagename, network_id, userdata)) instance = os_utils.create_instance_and_wait_for_active( - "m1.medium", + "orchestra", os_utils.get_image_id(glance_client, self.imagename), network_id, "orchestra-openbaton", @@ -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/opnfv_tests/vnf/ims/orchestra_ims.yaml b/functest/opnfv_tests/vnf/ims/orchestra_ims.yaml index 86d6e604..5923a775 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_ims.yaml +++ b/functest/opnfv_tests/vnf/ims/orchestra_ims.yaml @@ -2,8 +2,8 @@ tenant_images: ubuntu_14.04: http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img openims: http://marketplace.openbaton.org:8082/api/v1/images/52e2ccc0-1dce-4663-894d-28aab49323aa/img openbaton: - bootstrap_link: http://get.openbaton.org/bootstrap - bootstrap_config_link: http://get.openbaton.org/bootstrap-config-file + bootstrap_link: http://get.openbaton.org/bootstraps/bootstrap_3.2.0_opnfv/bootstrap + bootstrap_config_link: http://get.openbaton.org/bootstraps/bootstrap_3.2.0_opnfv/bootstrap-config-file marketplace_link: http://marketplace.openbaton.org:8082/api/v1/nsds/fokus/OpenImsCore/3.2.0/json imagename: ubuntu_14.04 vIMS: diff --git a/functest/opnfv_tests/vnf/router/__init__.py b/functest/opnfv_tests/vnf/router/__init__.py index e69de29b..e69de29b 100755..100644 --- a/functest/opnfv_tests/vnf/router/__init__.py +++ b/functest/opnfv_tests/vnf/router/__init__.py diff --git a/functest/opnfv_tests/vnf/router/vyos_vrouter.py b/functest/opnfv_tests/vnf/router/vyos_vrouter.py index 94a3ecfd..94a3ecfd 100755..100644 --- a/functest/opnfv_tests/vnf/router/vyos_vrouter.py +++ b/functest/opnfv_tests/vnf/router/vyos_vrouter.py |